From ea156489f1f3f9f9fc093fd6a7bca55dd474e027 Mon Sep 17 00:00:00 2001 From: "Ouellette Jonathan (CSC FI SPS MESLEO)" Date: Tue, 22 Jul 2025 00:31:04 +0200 Subject: [PATCH] Merged PR 21245: Added in a check for the active flag when adding an operation to a lot. Added... Added in a check for the active flag when adding an operation to a lot. Added in material handler group to the CanUserModifyLot check. Given the addition of a check for the active flag to allow adding an operation. I checked all OPERATION records to ensure that flag has already been set. The only operations that had a value other than true were the OPERATION records related to Return To Fab Lot processing. Tested and verified creating test wafer lots, and creating RTF forms. --- LSL2/STPROC/LOT_OPERATION_SERVICES.txt | 129 +++++++++++++------------ LSL2/STPROC/LOT_SERVICES.txt | 2 + 2 files changed, 69 insertions(+), 62 deletions(-) diff --git a/LSL2/STPROC/LOT_OPERATION_SERVICES.txt b/LSL2/STPROC/LOT_OPERATION_SERVICES.txt index c5d4e18..12c4a18 100644 --- a/LSL2/STPROC/LOT_OPERATION_SERVICES.txt +++ b/LSL2/STPROC/LOT_OPERATION_SERVICES.txt @@ -29,68 +29,73 @@ Service AddOperationToLot(LotId, OperationId, PrescribedSequence, UserId) ErrorMessage = '' If RowExists('LOT', LotId) then If RowExists('OPERATION', OperationId) then - If PrescribedSequence AND Num(PrescribedSequence) then - If Lot_Services('CanUserModifyLot', UserId) then - LotCurrOperation = Lot_Services('GetLotCurrOperationId', LotId) - CurrOperationSequence = Xlate('LOT_OPERATION', LotCurrOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X') - If CurrOperationSequence LT PrescribedSequence then - //Get Curr Operation Sequence - Done = False$ - LotCurrOperationSequence = Lot_Services('GetLotOperationSequence', LotId) - for each Operation in LotCurrOperationSequence using @Fm setting OpPos - ThisOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', Operation) - ThisOperationSequence = ThisOperationRec - If ThisOperationSequence GE PrescribedSequence then - NewOperationSequence = ThisOperationSequence + 1 - ThisOperationRec = NewOperationSequence - Database_Services('WriteDataRow', 'LOT_OPERATION', Operation, ThisOperationRec) - If Error_Services('HasError') then - Done = True$ - ErrorMessage = Error_Services('GetMessage') - end - end - Until Done - Next Operation - If ErrorMessage EQ '' then - LotOperationRecID = RTI_CreateGUID() - If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then - OperationRec = Database_Services('ReadDataRow', 'OPERATION', OperationId) - Class = OperationRec - Type = OperationRec - Rework = OperationRec - ThisNewOperationRec = Database_Services('ReadDataRow', 'OPERATION', OperationId) - LotOperationRec = '' - LotOperationRec = LotId - LotOperationRec = OperationId - LotOperationRec = PrescribedSequence - LotOperationRec = Rework - LotOperationRec = Type - LotOperationRec = Class - LotOperationRec = OperationRec - LotOperationRec = OperationRec - LotOperationRec = OperationRec - LotOperationRec = OperationRec - LotOperationRec = OperationRec - IsOperationRework = Database_Services('ReadDataColumn', 'OPERATION', OperationId, OPERATION_REWORK$) - Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec) - If Error_Services('NoError') then - OperationDesc = XLATE('OPERATION', OperationId, OPERATION_OPERATION_DESCRIPTION$, 'X') - Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'ADD_LOT_OPERATION', 'Added operation ' : Quote(OperationDesc) : ' to lot.', '', UserId) - end else - ErrorMessage = Error_Services('GetMessage') - end - end else - ErrorMessage = 'Lot Operation already existed, cannot overwrite' - end - end - end else - ErrorMessage = 'Not allowed to add new operations prior to current operation' - end - end else - ErrorMessage = 'User ' : UserId : ' does not have permission to modify lots.' - end + OperationActive = XLATE('OPERATION', OperationId, OPERATION_ACTIVE$, 'X') + If OperationActive then + If PrescribedSequence AND Num(PrescribedSequence) then + If Lot_Services('CanUserModifyLot', UserId) then + LotCurrOperation = Lot_Services('GetLotCurrOperationId', LotId) + CurrOperationSequence = Xlate('LOT_OPERATION', LotCurrOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X') + If CurrOperationSequence LT PrescribedSequence then + //Get Curr Operation Sequence + Done = False$ + LotCurrOperationSequence = Lot_Services('GetLotOperationSequence', LotId) + for each Operation in LotCurrOperationSequence using @Fm setting OpPos + ThisOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', Operation) + ThisOperationSequence = ThisOperationRec + If ThisOperationSequence GE PrescribedSequence then + NewOperationSequence = ThisOperationSequence + 1 + ThisOperationRec = NewOperationSequence + Database_Services('WriteDataRow', 'LOT_OPERATION', Operation, ThisOperationRec) + If Error_Services('HasError') then + Done = True$ + ErrorMessage = Error_Services('GetMessage') + end + end + Until Done + Next Operation + If ErrorMessage EQ '' then + LotOperationRecID = RTI_CreateGUID() + If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then + OperationRec = Database_Services('ReadDataRow', 'OPERATION', OperationId) + Class = OperationRec + Type = OperationRec + Rework = OperationRec + ThisNewOperationRec = Database_Services('ReadDataRow', 'OPERATION', OperationId) + LotOperationRec = '' + LotOperationRec = LotId + LotOperationRec = OperationId + LotOperationRec = PrescribedSequence + LotOperationRec = Rework + LotOperationRec = Type + LotOperationRec = Class + LotOperationRec = OperationRec + LotOperationRec = OperationRec + LotOperationRec = OperationRec + LotOperationRec = OperationRec + LotOperationRec = OperationRec + IsOperationRework = Database_Services('ReadDataColumn', 'OPERATION', OperationId, OPERATION_REWORK$) + Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec) + If Error_Services('NoError') then + OperationDesc = XLATE('OPERATION', OperationId, OPERATION_OPERATION_DESCRIPTION$, 'X') + Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'ADD_LOT_OPERATION', 'Added operation ' : Quote(OperationDesc) : ' to lot.', '', UserId) + end else + ErrorMessage = Error_Services('GetMessage') + end + end else + ErrorMessage = 'Lot Operation already existed, cannot overwrite' + end + end + end else + ErrorMessage = 'Not allowed to add new operations prior to current operation' + end + end else + ErrorMessage = 'User ' : UserId : ' does not have permission to modify lots.' + end + end else + ErrorMessage = 'Invalid operation sequence entered.' + end end else - ErrorMessage = 'Invalid operation sequence entered.' + ErrorMessage = 'Operation is inactive. Unable to add.' end end else ErrorMessage = 'Operation ' : OperationId : 'not found in OPERATION table.' @@ -112,7 +117,7 @@ Service RemoveLotOperation(LotOperationId, UserId) //Todo User permission check ErrorMessage = '' Success = False$ - + If RowExists('LOT_OPERATION', LotOperationId) then If Lot_Services('CanUserModifyLot', UserId) then LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$) diff --git a/LSL2/STPROC/LOT_SERVICES.txt b/LSL2/STPROC/LOT_SERVICES.txt index 433c9f2..d219e13 100644 --- a/LSL2/STPROC/LOT_SERVICES.txt +++ b/LSL2/STPROC/LOT_SERVICES.txt @@ -1599,6 +1599,8 @@ Service CanUserModifyLot(UserId) Response = true$ Case MemberOf(UserId, 'LEAD') Response = true$ + Case MemberOf(UserId, 'MATERIAL_HANDLER') + Response = true$ Case UserId EQ 'SYSTEM' Response = true$ Case Otherwise$