Added calls to verify indexes and update indexes right after receiving and releasing material. Refactored codebase to adjust work order quantities instead of recalculate quantities.
Removing reliance on transaction queue for receive and releaase Added unlock call in case write fails
This commit is contained in:
@ -696,8 +696,14 @@ PerformQuery:
|
||||
end
|
||||
|
||||
If ErrorMsg EQ '' then
|
||||
If WOKeys NE '' then
|
||||
WOKeys = SRP_Array('SortSimpleList', WOKeys, 'DescendingNumbers', @VM)
|
||||
End_Dialog(@WINDOW,WOKeys)
|
||||
end else
|
||||
Def = ''
|
||||
Def<MICON$> = '*'
|
||||
Msg(@Window, Def, 'OK', '', 'Query Results':@FM:'No work orders found')
|
||||
end
|
||||
end else
|
||||
Msg(@Window, '', 'OK', '', 'Process Error':@FM:ErrorMsg)
|
||||
end
|
||||
|
@ -973,6 +973,7 @@ end service
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service WriteDataColumn(TableName, KeyID, ColumnNo, Value, IgnoreSelfLock, IgnoreMFSRoutines, IgnoreAllLocks)
|
||||
|
||||
ErrorMsg = ''
|
||||
If TableName NE '' AND KeyID NE '' AND ColumnNo NE '' then
|
||||
|
||||
If ( Num(ColumnNo) and (ColumnNo GT 0) ) then
|
||||
@ -1009,7 +1010,13 @@ Service WriteDataColumn(TableName, KeyID, ColumnNo, Value, IgnoreSelfLock, Ignor
|
||||
end
|
||||
end
|
||||
If IgnoreAllLocks EQ False$ then
|
||||
If Error_Services('HasError') then
|
||||
ErrorMsg = Error_Services('GetMessage')
|
||||
end
|
||||
Database_Services('ReleaseKeyIDLock', TableName, KeyID)
|
||||
If ErrorMsg NE '' then
|
||||
Error_Services('Add', ErrorMsg)
|
||||
end
|
||||
end
|
||||
end else
|
||||
Error_Services('Add', 'Unable to lock ' : KeyID : ' for the ' : TableName : ' table in the ' : Service : ' service.')
|
||||
@ -1109,4 +1116,3 @@ end service
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
@ -273,7 +273,8 @@ WRITE_RECORD:
|
||||
Next RDSNo
|
||||
|
||||
If (OrgQty NE NewQty) then
|
||||
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateScrappedQty':SD$:WorkOrderNo)
|
||||
ScrapAdj = NewQty - OrgQty
|
||||
Work_Order_Services('AdjustScrappedQty', WorkOrderNo, ScrapAdj)
|
||||
end
|
||||
|
||||
// On the write of the record, read then write associated WM_IN and WM_OUT records to trigger the WM_MFS.
|
||||
@ -294,8 +295,6 @@ WRITE_RECORD:
|
||||
Database_Services('WriteDataRow', 'WM_OUT', WMOKey, WMORec, True$, True$, False$)
|
||||
end
|
||||
|
||||
SAPTestFlag = Xlate('APP_INFO', 'SAP_TEST_FLAG', 1, 'X')
|
||||
If SAPTestFlag then
|
||||
// If NCR created after cassette has received a batch number, then inform SAP of new quantities
|
||||
SAPBatchNo = Xlate('WO_MAT', WOMatKey, 'SAP_BATCH_NO', 'X')
|
||||
IF SAPBatchNo NE '' THEN
|
||||
@ -331,7 +330,6 @@ WRITE_RECORD:
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
OrigStatus = OrigRecord<NCR_STATUS$>
|
||||
NewStatus = Record<NCR_STATUS$>
|
||||
@ -666,6 +664,7 @@ WRITE_RECORD:
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
DELETE_RECORD_PRE:
|
||||
@ -746,11 +745,13 @@ DELETE_RECORD:
|
||||
Pass_To_SQL('WRITE', 'RDS', RDSNo)
|
||||
Next RDSNo
|
||||
|
||||
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateScrappedQty':SD$:WorkOrderNo)
|
||||
OrgQty = Sum(obj_NCR('RejQty',NCRNo:@RM:OrigRecord))
|
||||
NewQty = 0
|
||||
AdjustQty = NewQty - OrgQty
|
||||
Work_Order_Services('AdjustScrappedQty', WorkOrderNo, AdjustQty)
|
||||
|
||||
return
|
||||
|
||||
|
||||
// ----- Internal Methods ----------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -22,7 +22,7 @@ DECLARE FUNCTION Return_To_Fab_Services
|
||||
DECLARE FUNCTION Logging_Services, Environment_Services, Error_Services, Signature_Services, Lot_Services, Supplement_Services
|
||||
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, obj_WM_In
|
||||
DECLARE SUBROUTINE Btree.Extract, RDS_React_Run, Environment_Services, Logging_Services, Error_Services, Send_Info
|
||||
DECLARE SUBROUTINE SRP_Stopwatch, Database_Services, Lot_Services, Supplement_Services
|
||||
DECLARE SUBROUTINE SRP_Stopwatch, Database_Services, Lot_Services, Supplement_Services, RDS_Services
|
||||
|
||||
$INSERT MSG_EQUATES
|
||||
$INSERT WO_VERIFY_EQU
|
||||
@ -375,6 +375,10 @@ Create:
|
||||
Result = ''
|
||||
END ELSE
|
||||
|
||||
RDS_Services('VerifyWOLogRDSKeyIndex', RDSNo)
|
||||
RDS_Services('VerifyWOMatRDSNoIndex', RDSNo)
|
||||
RDS_Services('VerifyWOStepRDSKeyIndex', RDSNo)
|
||||
|
||||
NewLotId = Lot_Services('CreateNewLot', 'RDS', '', WaferQty, SubPartNo, LotNo, SubVendCd, @User4, '', RDSNo)
|
||||
|
||||
If Rds_Services('IsEpiPro', RDSNo) then
|
||||
@ -1250,4 +1254,3 @@ CalcThickTarget:
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, NextKey, obj_WO_Verify, o
|
||||
DECLARE FUNCTION Database_Services, obj_RDS2, Logging_Services, Environment_Services, Error_Services
|
||||
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, Update_Index
|
||||
DECLARE SUBROUTINE obj_Post_Log, obj_WO_Mat_Log,obj_WO_Wfr, Set_Property, Database_Services, Extract_SI_Keys
|
||||
DECLARE SUBROUTINE Logging_Services, obj_Notes
|
||||
DECLARE SUBROUTINE Logging_Services, obj_Notes, WM_In_Services
|
||||
|
||||
$INSERT MSG_EQUATES
|
||||
$INSERT WO_LOG_EQU
|
||||
@ -128,6 +128,9 @@ Create:
|
||||
LogData<7> = WaferQty
|
||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||
Done = True$
|
||||
WM_In_Services('VerifyWoStepWMIKeyIndex', WMInKey)
|
||||
WM_In_Services('VerifyWOLogWMIKeyIndex', WMInKey)
|
||||
WM_In_Services('VerifyWOMatWMIKeyIndex', WMInKey)
|
||||
end
|
||||
Until ( (NumAttempts EQ 10) or (Done EQ True$) )
|
||||
Repeat
|
||||
@ -940,6 +943,3 @@ RepProdTW:
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ Declare Function Database_Services, SRP_Array, Return_To_Fab_Services
|
||||
Declare Subroutine Set_Status, Msg, obj_Tables, Send_Dyn, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, Btree.Extract
|
||||
Declare Subroutine Extract_SI_Keys, obj_WM_Out, obj_WO_Mat, obj_Post_Log, obj_WO_Mat_Log, ErrMsg, obj_WO_Wfr
|
||||
Declare Subroutine Logging_Services, Material_Services, Database_Services, Update_Index, Work_Order_Services
|
||||
Declare Subroutine Service_Services, obj_Notes, Delay
|
||||
Declare Subroutine Service_Services, obj_Notes, Delay, WM_Out_Services
|
||||
|
||||
$Insert MSG_EQUATES
|
||||
$Insert APP_INSERTS
|
||||
@ -40,7 +40,7 @@ $Insert CLEAN_INSP_EQUATES
|
||||
$Insert WMO_WFRS_EQUATES
|
||||
$Insert REACT_RUN_EQUATES
|
||||
|
||||
EQU NUM_RETRIES$ TO 50
|
||||
EQU NUM_RETRIES$ TO 60
|
||||
|
||||
ErrTitle = 'Error in Stored Procedure "obj_WM_Out"'
|
||||
ErrorMsg = ''
|
||||
@ -115,13 +115,12 @@ Create:
|
||||
|
||||
WONo = Parms[1,@RM]
|
||||
WOStep = Parms[COL2()+1,@RM]
|
||||
NewCassNos = Parms[COL2()+1,@RM]
|
||||
NewCassNo = Parms[COL2()+1,@RM]
|
||||
CassLoadQty = Parms[COL2()+1,@RM]
|
||||
|
||||
|
||||
IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')'
|
||||
IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')'
|
||||
IF NewCassNos = '' THEN ErrorMsg = 'Null Parameter "NewCassNos" passed to routine. (':Method:')'
|
||||
IF NewCassNo = '' THEN ErrorMsg = 'Null Parameter "NewCassNo" passed to routine. (':Method:')'
|
||||
|
||||
IF ErrorMsg NE '' THEN RETURN
|
||||
|
||||
@ -161,11 +160,8 @@ Create:
|
||||
WORec = XLATE('WO_LOG',WONo,'','X')
|
||||
|
||||
InboundWaferQty = 0
|
||||
FOR I = 1 TO COUNT(NewCassNos,@VM) + (NewCassNos NE '')
|
||||
NewCassNo = NewCassNos<1,I>
|
||||
CassWfrQty = XLATE('WO_MAT',WONo:'*':NewCassNo,WO_MAT_WAFER_QTY$,'X')
|
||||
InboundWaferQty += CassWfrQty
|
||||
NEXT I
|
||||
|
||||
WMOutKeys = XLATE('WO_STEP',WONo:'*':WOStep,WO_STEP_WM_OUT_KEYS$,'X')
|
||||
|
||||
@ -214,7 +210,7 @@ Create:
|
||||
OutOnlyCassIDs = '' ;* List of Outbound only Cassette IDs added 8/12/1011 JCH
|
||||
|
||||
LOOP
|
||||
UNTIL InboundWaferQty = 0
|
||||
UNTIL InboundWaferQty EQ 0
|
||||
WMOutKey = WONo:'*':WOStep:'*':WMOCassNo
|
||||
WMOutRec = XLATE('WM_OUT',WMOutKey,'','X') ;* In case there is a partial box
|
||||
NewBoxFlag = ''
|
||||
@ -250,7 +246,7 @@ Create:
|
||||
NumAttempts = 0
|
||||
Loop
|
||||
NumAttempts += 1
|
||||
If NumAttempts GT 1 then Delay(NumAttempts)
|
||||
If NumAttempts GT 1 then Delay(1)
|
||||
Database_Services('WriteDataRow', 'WM_OUT', WMOutKey, WMOutRec, True$, False$, False$)
|
||||
If Error_Services('HasError') then
|
||||
// Log the error
|
||||
@ -272,6 +268,9 @@ Create:
|
||||
LogData<6> = WMOCassNo
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
Done = True$
|
||||
WM_Out_Services('VerifyWOLogWMOKeyIndex', WONo:'*':WOStep:'*':WMOCassNo)
|
||||
WM_Out_Services('VerifyWOMatWMOKeyIndex', WONo:'*':WOStep:'*':WMOCassNo)
|
||||
WM_Out_Services('VerifyWoStepWMOKeyIndex', WONo:'*':WOStep:'*':WMOCassNo)
|
||||
end
|
||||
Until ( (NumAttempts GT NUM_RETRIES$) or (Done EQ True$) )
|
||||
Repeat
|
||||
@ -1999,6 +1998,3 @@ ConvertCleanInsp:
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, Btree.Extract, ErrMsg,
|
||||
DECLARE SUBROUTINE obj_Order_Change, obj_Vision, obj_Notes, obj_WM_In, obj_WM_Out, Msg, obj_WO_Mat, obj_Reprocess
|
||||
DECLARE SUBROUTINE obj_WO_Wfr, obj_WO_Step, Send_Info, obj_RDS2, obj_RDS, obj_Post_Log, obj_WO_Mat_Log, Sleepery
|
||||
DECLARE SUBROUTINE Environment_Services, Logging_Services, Error_Services, Database_Services, Update_Index
|
||||
DECLARE SUBROUTINE Work_Order_Services, Delay, Transaction_Services
|
||||
DECLARE SUBROUTINE Work_Order_Services, Delay, Transaction_Services, RDS_Services, WM_In_Services, WM_Out_Services
|
||||
|
||||
$INSERT MSG_EQUATES
|
||||
$INSERT ORDER_EQU
|
||||
@ -53,7 +53,7 @@ $INSERT LOGICAL
|
||||
$INSERT APPCOLORS
|
||||
$INSERT WM_IN_EQUATES
|
||||
|
||||
EQU NUM_RETRIES$ TO 50
|
||||
EQU NUM_RETRIES$ TO 60
|
||||
|
||||
EQU CRLF$ TO \0D0A\
|
||||
EQU COMMA$ TO ','
|
||||
@ -103,7 +103,7 @@ BEGIN CASE
|
||||
CASE Method = 'OpenWONos' ; GOSUB OpenWONos
|
||||
CASE Method = 'ShipWONos' ; GOSUB ShipWONos
|
||||
CASE Method = 'WOStepStatus' ; GOSUB WOStepStatus
|
||||
CASE Method = 'ReleaseCassettes' ; GOSUB ReleaseCassettes
|
||||
CASE Method = 'ReleaseCassette' ; GOSUB ReleaseCassette
|
||||
CASE Method = 'RecallWO' ; GOSUB RecallWO
|
||||
CASE Method = 'ChangeLotNo' ; GOSUB ChangeLotNo
|
||||
CASE Method = 'ChangeCassQty' ; GOSUB ChangeCassQty
|
||||
@ -967,11 +967,11 @@ RETURN
|
||||
|
||||
|
||||
* * * * * * *
|
||||
ReleaseCassettes:
|
||||
ReleaseCassette:
|
||||
* * * * * * *
|
||||
|
||||
WONo = Parms[1,@RM]
|
||||
CassNos = Parms[COL2()+1,@RM]
|
||||
CassNo = Parms[COL2()+1,@RM]
|
||||
ReleaseUser = Parms[COL2()+1,@RM]
|
||||
RelDtm = Parms[COL2()+1,@RM]
|
||||
|
||||
@ -979,7 +979,7 @@ ReleaseCassettes:
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<2> = ReleaseUser
|
||||
LogData<3> = WONo
|
||||
LogData<4> = 'WONo: ':WONo:' CassNos: ':CassNos:' ReleaseUser: ':ReleaseUser:' ||| Beginning ReleaseCassettes routine.'
|
||||
LogData<4> = 'WONo: ':WONo:' CassNo: ':CassNo:' ReleaseUser: ':ReleaseUser:' ||| Beginning ReleaseCassette routine.'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
IF WONo = '' THEN ErrorMsg = 'Null parameter WONo passed to routine (':Method:').'
|
||||
@ -1050,12 +1050,7 @@ ReleaseCassettes:
|
||||
|
||||
OrdSummary = '' ;* Holds Order Detail Lot Numbers and Associated Order Item Numbers
|
||||
|
||||
CassCnt = COUNT(CassNos,@VM) + (CassNos NE '')
|
||||
|
||||
WOMKeys = ''
|
||||
FOR K = 1 TO CassCnt
|
||||
WOMKeys<1,K> = WONo:'*':CassNos<1,K>
|
||||
NEXT K
|
||||
WOMKey = WONo:'*':CassNo
|
||||
|
||||
WOMTableVar = Database_Services('GetTableHandle', 'WO_MAT')
|
||||
|
||||
@ -1065,7 +1060,7 @@ ReleaseCassettes:
|
||||
END
|
||||
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' CassNos:':CassNos:' ||| Trace 1'
|
||||
LogData<4> = 'WONo:':WONo:' CassNo:':CassNo:' ||| Trace 1'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
EpiPN = WORec<WO_LOG_EPI_PART_NO$>
|
||||
@ -1093,37 +1088,27 @@ ReleaseCassettes:
|
||||
|
||||
// Log variables before obj_WM_Out('Create')
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' WMOLoadQty:':WMOLoadQty
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
IF ReactorType = 'EPP' THEN
|
||||
Send_Info('Creating WM_OUT records for WOStep ':WOStep:'...')
|
||||
OutOnlyCassIDS = obj_WM_Out('Create',WONO:@RM:WOStep:@RM:CassNos:@RM:WMOLoadQty)
|
||||
OutOnlyCassIDs = obj_WM_Out('Create',WONO:@RM:WOStep:@RM:CassNo:@RM:WMOLoadQty)
|
||||
END ELSE
|
||||
OutOnlyCassIDs = ''
|
||||
END
|
||||
|
||||
StepRDSNos = ''
|
||||
|
||||
CassCnt = COUNT(CassNos,@VM) + (CassNos NE '')
|
||||
|
||||
// Log variables after obj_WM_Out('Create')
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
FOR N = 1 TO CassCnt
|
||||
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.':N
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
CassNo = CassNos<1,N>
|
||||
|
||||
IF ReactorType EQ 'EPP' THEN
|
||||
|
||||
CassWaferQty = XLATE('WO_MAT',WONo:'*':CassNo,WO_MAT_WAFER_QTY$,'X')
|
||||
@ -1175,21 +1160,21 @@ ReleaseCassettes:
|
||||
IF ReactorType NE 'GAN' then
|
||||
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.':N:'.1 - Start obj_RDS("Create")'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.1 - Start obj_RDS("Create")'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
Done = False$
|
||||
For AttemptIndex = 1 to NUM_RETRIES$
|
||||
If (AttemptIndex GT 1) then Delay(AttemptIndex)
|
||||
If (AttemptIndex GT 1) then Delay(1)
|
||||
NewRDSNo = obj_RDS('Create',Parms)
|
||||
errCode = ''
|
||||
Begin Case
|
||||
Case Get_Status(errCode)
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.':N:'.1.1 - Attempt ':AttemptIndex:'. Error calling obj_RDS("Create"). Error message: ':errCode
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.1.1 - Attempt ':AttemptIndex:'. Error calling obj_RDS("Create"). Error message: ':errCode
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
Case (NewRDSNo EQ 0) or (NewRDSNo EQ '')
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.':N:'.1.1 - Attempt ':AttemptIndex:'. Error calling obj_RDS("Create"). Invalid RDSNo ':Quote(RDSNo):' returned.'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.1.1 - Attempt ':AttemptIndex:'. Error calling obj_RDS("Create"). Invalid RDSNo ':Quote(RDSNo):' returned.'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
Case RowExists('RDS', NewRDSNo)
|
||||
Done = True$
|
||||
@ -1198,7 +1183,7 @@ ReleaseCassettes:
|
||||
Next AttemptIndex
|
||||
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.':N:'.2 - End obj_RDS("Create")'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.2 - End obj_RDS("Create")'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
If ( (NewRDSNo EQ 0) or (NewRDSNo EQ '') ) then
|
||||
@ -1231,11 +1216,10 @@ ReleaseCassettes:
|
||||
END ;* End of check for GAN reactor
|
||||
END ;* End of Check for existing RDS
|
||||
END ;* End of check for EpiPRO reactor type
|
||||
NEXT N
|
||||
NEXT WOStep
|
||||
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
If RelDtm EQ '' then
|
||||
@ -1251,23 +1235,21 @@ ReleaseCassettes:
|
||||
|
||||
MaxShipQty = Xlate('WO_LOG', WONo, 'CUST_EPI_PART_SHIP_QTY', 'X')
|
||||
|
||||
FOR N = 1 TO CassCnt
|
||||
WOMKey = WOMKeys<1,N>
|
||||
CassNo = FIELD(WOMKey,'*',2)
|
||||
// Keep trying to get the lock. Another process may be updating this record at the same time.
|
||||
Done = False$
|
||||
For AttemptIndex = 1 to NUM_RETRIES$
|
||||
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
If (AttemptIndex GT 1) then Delay(AttemptIndex)
|
||||
HaveLock = Database_Services('GetKeyIDLock', 'WO_MAT', WOMKey)
|
||||
If (AttemptIndex GT 1) then Delay(1)
|
||||
HaveLock = Database_Services('GetKeyIDLock', 'WO_MAT', WOMKey, True$)
|
||||
If HaveLock then
|
||||
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Have lock!'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Have lock!'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
WOMatRec = XLATE('WO_MAT',WOMKey,'','X') ;* We have the lock, so just get the record this way
|
||||
@ -1313,11 +1295,11 @@ ReleaseCassettes:
|
||||
If Not(Get_Status(errCode)) then
|
||||
Done = True$
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Successfully updated WO_MAT record ':WOMKey:' with REL operation.'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Successfully updated WO_MAT record ':WOMKey:' with REL operation.'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
end else
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Failed to update WO_MAT record ':WOMKey:' with REL operation.'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Failed to update WO_MAT record ':WOMKey:' with REL operation.'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
end
|
||||
|
||||
@ -1326,20 +1308,18 @@ ReleaseCassettes:
|
||||
END
|
||||
END else
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Error! REL_DTM is not null.'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Error! REL_DTM is not null.'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
end
|
||||
end
|
||||
Until Done
|
||||
Next AttemptIndex
|
||||
|
||||
NEXT N
|
||||
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 4'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 4'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
OutOnlyCnt = COUNT(OutOnlyCassIDs,@VM) + (OutOnlyCassIDs NE '')
|
||||
OutOnlyCnt = DCount(OutOnlyCassIDs, @VM)
|
||||
ExistingWOMatKeys = WORec<WO_LOG_WO_MAT_KEY$>
|
||||
NewWOMatKeys = ExistingWOMatKeys
|
||||
FOR I = 1 TO OutOnlyCnt
|
||||
@ -1351,7 +1331,7 @@ ReleaseCassettes:
|
||||
NEXT I
|
||||
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 5'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 5'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
ReactNos = obj_Sched('GetReactNos',WONo) ; // 5/26/2-15 JCH Added schedule ReactNos and check for WO_START_DTM$
|
||||
@ -1401,12 +1381,12 @@ ReleaseCassettes:
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Error Message: ':ErrorMsg
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Error Message: ':ErrorMsg
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
end
|
||||
|
||||
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Ending ReleaseCassettes routine'
|
||||
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Ending ReleaseCassette routine'
|
||||
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
|
||||
|
||||
RETURN
|
||||
@ -2348,7 +2328,6 @@ Route:
|
||||
|
||||
IF Get_Status(errCode) THEN RETURN
|
||||
|
||||
|
||||
WOStepKeys = WOLogRec<WO_LOG_WO_STEP_KEY$>
|
||||
|
||||
IF WOStepKeys NE '' THEN
|
||||
@ -2386,7 +2365,6 @@ Route:
|
||||
|
||||
DefWMOCassQtys = XLATE('CUST_EPI_PART',CustNo:'*':EpiPartNo,CUST_EPI_PART_WMO_LOAD_CNT$,'X')
|
||||
|
||||
|
||||
WOStepKeys = ''
|
||||
DefWMOCassQty = ''
|
||||
|
||||
@ -2421,6 +2399,41 @@ Route:
|
||||
WOLogRec<WO_LOG_PROD_VER_NO$> = ProdVerNo
|
||||
WOLogRec<WO_LOG_CUST_NO$> = CustNo
|
||||
|
||||
WOQty = WOLogRec<WO_LOG_WO_QTY$>
|
||||
If WOQty EQ '' then
|
||||
WOQty = 0
|
||||
WOLogRec<WO_LOG_WO_QTY$> = WOQty
|
||||
end
|
||||
RxQty = WOLogRec<WO_LOG_RX_QTY_STATIC$>
|
||||
If RxQty EQ '' then
|
||||
RxQty = 0
|
||||
WOLOgRec<WO_LOG_RX_QTY_STATIC$> = RxQty
|
||||
end
|
||||
RelQty = WOLogRec<WO_LOG_REL_QTY_STATIC$>
|
||||
If RelQty EQ '' then
|
||||
RelQty = 0
|
||||
WOLogRec<WO_LOG_REL_QTY_STATIC$> = RelQty
|
||||
end
|
||||
UnRelQty = WOLogRec<WO_LOG_UNREL_QTY_STATIC$>
|
||||
If UnRelQty EQ '' then
|
||||
UnRelQty = WOQty - RelQty
|
||||
end
|
||||
OpenQty = WOLogRec<WO_LOG_OPEN_QTY_STATIC$>
|
||||
If OpenQty EQ '' then
|
||||
OpenQty = WOQty - RxQty
|
||||
WOLogRec<WO_LOG_OPEN_QTY_STATIC$> = OpenQty
|
||||
end
|
||||
ScrapQty = WOLogRec<WO_LOG_SCRAP_QTY_STATIC$>
|
||||
If ScrapQty EQ '' then
|
||||
ScrapQty = 0
|
||||
WOLogRec<WO_LOG_SCRAP_QTY_STATIC$> = ScrapQty
|
||||
end
|
||||
ShippedQty = WOLogRec<WO_LOG_STATIC_SHIP_QTY$>
|
||||
If ShippedQty EQ '' then
|
||||
ShippedQty = 0
|
||||
WOLogRec<WO_LOG_STATIC_SHIP_QTY$> = ShippedQty
|
||||
end
|
||||
|
||||
otParms = FIELDSTORE(otParms,@RM,4,0,WOLogRec)
|
||||
obj_Tables('WriteRec',otParms)
|
||||
|
||||
|
@ -568,6 +568,15 @@ RemQAMet:
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_WFR_TYPE$, DelPos, 0)
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_REACT_SCHED$, DelPos, 0)
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_SHIP_DOC$, DelPos, 0)
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_DATA_POINTS$, DelPos, 0)
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_MIN_RESULT$, DelPos, 0)
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_MAX_RESULT$, DelPos, 0)
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_RANGE_PCT_RESULT$, DelPos, 0)
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_EDGE_MEAN_RESULT$, DelPos, 0)
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_5MM_PCT_RESULT$, DelPos, 0)
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_OUT_OF_SPEC$, DelPos, 0)
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_PHASE_MIN$, DelPos, 0)
|
||||
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_FAIL_REASON$, DelPos, 0)
|
||||
|
||||
otParms = FIELDSTORE(otParms,@RM,4,0,WOMatQARec)
|
||||
obj_Tables('WriteRec',otParms)
|
||||
@ -754,5 +763,3 @@ QAResults:
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
@ -68,7 +68,7 @@ Declare function Tool_Parms_Services, Signature_Services, obj_WO_Mat_QA, Date
|
||||
Declare function Rds_Services, SRP_DateTime, SRP_Math, obj_WO_Mat, Lot_Services, SRP_Array
|
||||
Declare function Lot_Event_Services, GetTickCount, Work_Order_Services
|
||||
Declare subroutine Error_Services, Database_Services, Logging_Services, Service_Services, obj_WO_React
|
||||
Declare Subroutine Mona_Services
|
||||
Declare Subroutine Mona_Services, Work_Order_Services
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\RDS'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
@ -916,7 +916,12 @@ WRITE_RECORD:
|
||||
OrigPocketChar = OrigRecord<RDS_POCKET_CHAR$>
|
||||
NewPocketChar = Record<RDS_POCKET_CHAR$>
|
||||
If (OrigPocketChar NE NewPocketChar) then
|
||||
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateScrappedQty':SD$:WONo)
|
||||
OrigScrapQty = Count(OrigPocketChar, 'TEST')
|
||||
NewScrapQty = Count(NewPocketChar, 'TEST')
|
||||
AdjustQty = NewScrapQty - OrigScrapQty
|
||||
If AdjustQty NE 0 then
|
||||
Work_Order_Services('AdjustScrappedQty', WONo, AdjustQty)
|
||||
end
|
||||
end
|
||||
|
||||
If {WO} NE '' then Service_Services('PostProcedure', 'RDS_SERVICES', 'VerifyWOLogRDSKeyIndex':SD$:Name)
|
||||
@ -1018,3 +1023,4 @@ Restore_System_Variables:
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
@ -131,11 +131,13 @@ EQU NEW_EXIST$ To 0 ; * Reduce Mode 0
|
||||
equ NEXT_CUR$ To 1
|
||||
equ ADD_EXIST$ to 2
|
||||
|
||||
Equ NUM_ATTEMPTS$ to 60
|
||||
|
||||
AutoDisplayErrors = FALSE$ ; // Set this to True$ when debugging so all errors will automatically display.
|
||||
|
||||
Declare subroutine SRP_Stopwatch, Error_Services, obj_Tables, Metrology_Services, obj_RDS_Test, SRP_JSON, Logging_Services
|
||||
Declare subroutine RTI_Set_Debugger, Database_Services, Btree.Extract, Extract_SI_Keys, Obj_WO_Mat, Obj_WO_Mat_Log
|
||||
Declare subroutine Dialog_Box, Obj_Notes, RList, Set_Status, Errmsg, Obj_React_Status, Reactor_Services
|
||||
Declare subroutine Dialog_Box, Obj_Notes, RList, Set_Status, Errmsg, Obj_React_Status, Reactor_Services, Delay
|
||||
Declare subroutine Rds_Services, Obj_Post_Log, Mona_Services, Transaction_Services, Reduce, Update_Index
|
||||
Declare function SRP_Sort_Array, Metrology_Services, obj_RDS_Test, obj_Test_Point_Map, Database_Services
|
||||
Declare function Work_Order_Services, SRP_JSON, Logging_Services, Environment_Services, SRP_Trim, Error_Services
|
||||
@ -2259,10 +2261,9 @@ Service VerifyWOMatRDSNoIndex(RDSNo)
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS WO_MAT{RDS_NO} Log.csv'
|
||||
Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOMatKey':@FM:'Result'
|
||||
objVerifyRDSNoLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<2> = RDSNo
|
||||
LogData<4> = 'Begin ':Service
|
||||
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
|
||||
@ -2273,35 +2274,48 @@ Service VerifyWOMatRDSNoIndex(RDSNo)
|
||||
WOMatKey = Xlate('RDS', RDSNo, 'WO_MAT_KEY', 'X')
|
||||
If WOMatKey NE '' then
|
||||
WOMatRDSNo = Xlate('WO_MAT', WOMatKey, 'RDS_NO', 'X')
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<3> = WOMatKey
|
||||
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
|
||||
If WOMatRDSNo EQ '' then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'RDSNo missing from WO_MAT record. Generating index transaction.'
|
||||
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
|
||||
// Add index transaction to update RDS_NO relational index (target WO_MAT table)
|
||||
IndexTransactionRow = 'WO_MAT*RDS_NO*AR':@FM:RDSNo:@FM:"":@FM:WOMatKey:@FM
|
||||
Open "!RDS" to BangTable then
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
Lock BangTable, 0 then
|
||||
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
|
||||
PendingTrans := IndexTransactionRow
|
||||
Write PendingTrans on BangTable, 0 then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'Index transaction successfully added.'
|
||||
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
|
||||
Done = True$
|
||||
end else
|
||||
ErrorMsg = 'Unable to write index transaction to !RDS. ':RDSNo
|
||||
end
|
||||
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Unable to Lock !RDS to add index transaction. ':RDSNo
|
||||
end
|
||||
end
|
||||
Until Done or ErrorMsg
|
||||
Next AttemptNo
|
||||
end else
|
||||
ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
|
||||
end
|
||||
end else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'Index ok. RDSNo not missing from WO_MAT record.'
|
||||
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
|
||||
end
|
||||
end else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WO_MAT key for RDS ':RDSNo:' is null. Nothing to update.'
|
||||
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
|
||||
end
|
||||
@ -2309,10 +2323,12 @@ Service VerifyWOMatRDSNoIndex(RDSNo)
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = ErrorMsg
|
||||
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
|
||||
end
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'End ':Service
|
||||
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
|
||||
|
||||
@ -2329,10 +2345,9 @@ Service VerifyWOStepRDSKeyIndex(RDSNo)
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS WO_STEP{RDS_KEY} Log.csv'
|
||||
Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOStep':@FM:'Result'
|
||||
objVerifyRDSKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<2> = RDSNo
|
||||
LogData<4> = 'Begin ':Service
|
||||
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
|
||||
@ -2343,35 +2358,48 @@ Service VerifyWOStepRDSKeyIndex(RDSNo)
|
||||
WOStepKey = Xlate('RDS', RDSNo, 'WO_STEP_KEY', 'X')
|
||||
If WOStepKey NE '' then
|
||||
WOStepRDSKeys = Xlate('WO_STEP', WOStepKey, 'RDS_KEY', 'X')
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<3> = WOStepKey
|
||||
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
|
||||
Locate RDSNo in WOStepRDSKeys using @VM setting vPos then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'Index ok. RDSNo not missing from WO_STEP record.'
|
||||
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
|
||||
end else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'RDSNo missing from WO_STEP record. Generating index transaction.'
|
||||
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
|
||||
// Add index transaction to update RDS_KEY relational index (target WO_STEP table)
|
||||
IndexTransactionRow = 'WO_STEP*RDS_KEY*AR':@FM:RDSNo:@FM:"":@FM:WOStepKey:@FM
|
||||
Open "!RDS" to BangTable then
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
Lock BangTable, 0 then
|
||||
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
|
||||
PendingTrans := IndexTransactionRow
|
||||
Write PendingTrans on BangTable, 0 then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'Index transaction successfully added.'
|
||||
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
|
||||
Done = True$
|
||||
end else
|
||||
ErrorMsg = 'Unable to write index transaction to !RDS. ':RDSNo
|
||||
end
|
||||
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Unable to Lock !RDS to add index transaction. ':RDSNo
|
||||
end
|
||||
end
|
||||
Until Done or ErrorMsg
|
||||
Next AttemptNo
|
||||
end else
|
||||
ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
|
||||
end
|
||||
end
|
||||
end else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WO_STEP key for RDS ':RDSNo:' is null. Nothing to update.'
|
||||
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
|
||||
end
|
||||
@ -2379,10 +2407,12 @@ Service VerifyWOStepRDSKeyIndex(RDSNo)
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = ErrorMsg
|
||||
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
|
||||
end
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'End ':Service
|
||||
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
|
||||
|
||||
@ -2399,10 +2429,9 @@ Service VerifyWOLogRDSKeyIndex(RDSNo)
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS RDS{WO} Log.csv'
|
||||
Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOStep':@FM:'Result'
|
||||
objVerifyRDSWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<2> = RDSNo
|
||||
LogData<4> = 'Begin ':Service
|
||||
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
|
||||
@ -2417,32 +2446,44 @@ Service VerifyWOLogRDSKeyIndex(RDSNo)
|
||||
LogData<3> = WONo
|
||||
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
|
||||
Locate RDSNo in WOLogRDSKeys using @VM setting vPos then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'Index ok. RDSNo not missing from Btree index.'
|
||||
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
|
||||
end else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'RDSNo missing from Btree index. Generating index transaction.'
|
||||
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
|
||||
// Add index transaction to update RDS_KEY relational index (target WO_STEP table)
|
||||
IndexTransactionRow = 'WO':@FM:RDSNo:@FM:"":@FM:WONo:@FM
|
||||
Open "!RDS" to BangTable then
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
Lock BangTable, 0 then
|
||||
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
|
||||
PendingTrans := IndexTransactionRow
|
||||
Write PendingTrans on BangTable, 0 then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'Index transaction successfully added.'
|
||||
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
|
||||
Done = True$
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !RDS. ':RDSNo
|
||||
end
|
||||
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !RDS to add index transaction. ':RDSNo
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !RDS to add index transaction. ':RDSNo
|
||||
end
|
||||
end
|
||||
Until Done or ErrorMsg
|
||||
Next AttemptNo
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to Open !RDS to add index transaction. ':RDSNo
|
||||
end
|
||||
end
|
||||
end else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WONo for RDS ':RDSNo:' is null. Nothing to update.'
|
||||
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
|
||||
end
|
||||
@ -2452,10 +2493,12 @@ Service VerifyWOLogRDSKeyIndex(RDSNo)
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = ErrorMsg
|
||||
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
|
||||
end
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'End ':Service
|
||||
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
|
||||
|
||||
|
@ -3719,6 +3719,226 @@ Service SendRefreshMessage()
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service AdjustWorkOrderScheduleQty(WONo, ModifyQty)
|
||||
|
||||
ErrorMsg = ''
|
||||
Begin Case
|
||||
Case (WONo EQ '')
|
||||
ErrorMsg = 'Error in ':Service:' service. WONo cannot be null.'
|
||||
Case (ModifyQty EQ '')
|
||||
ErrorMsg = 'Error in ':Service:' service. ModifyQty cannot be null.'
|
||||
End Case
|
||||
|
||||
If (ErrorMsg EQ '') then
|
||||
|
||||
WOQty = Xlate('WO_LOG', WONo, 'WO_QTY', 'X')
|
||||
OrigQty = WOQty - ModifyQty
|
||||
NewQty = WOQty + ModifyQty
|
||||
|
||||
SchedDetNGKey = ''
|
||||
|
||||
Begin Case
|
||||
Case ModifyQty GT 0
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<2> = 'WO_LOG_ACTIONS'
|
||||
LogData<3> = 'Work order ':WONo:' quantity increased from ':OrigQty:' to ':NewQty:'.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Searching for a scheduled event to increase the quantity.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
// Search schedule for most recent event and increase that event quantity by the difference.
|
||||
Query = 'SELECT SCHED_DET_NG WITH WO_NO EQ ':WONo:' BY-DSND STOP_DTM'
|
||||
GoSub ClearCursors
|
||||
Set_Status(0)
|
||||
RList(Query, TARGET_ACTIVELIST$, '', '', False$)
|
||||
errCode = ''
|
||||
If Get_Status(errCode) then
|
||||
|
||||
ErrorMsg = 'Error retrieving event list in WO_LOG_Actions. RList error code ':errCode:'.'
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = ErrorMsg
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
Error_Services('Add', ErrorMsg)
|
||||
|
||||
end else
|
||||
|
||||
EOF = False$
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Query successful. Number of keys found: ':@RecCount:'.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
ReadNext SchedDetNGKey else EOF = True$
|
||||
If SchedDetNGKey NE '' then
|
||||
EventRec = Database_Services('ReadDataRow', 'SCHED_DET_NG', SchedDetNGKey)
|
||||
StopDTM = EventRec<SCHED_DET_NG.STOP_DTM$>
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Work order record ':WONo:' quantity increased from ':OrigQty:' to ':NewQty:'.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Scheduled event ':SchedDetNGKey:' found.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
// Only modify the event if it is still running or is scheduled in the future.
|
||||
If StopDTM GT Datetime() then
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' less than current DTM, so increasing event quantity.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
ReactNo = EventRec<SCHED_DET_NG.REACT_NO$>
|
||||
WONo = EventRec<SCHED_DET_NG.WO_NO$>
|
||||
StartDTM = EventRec<SCHED_DET_NG.START_DTM$>
|
||||
Desc = EventRec<SCHED_DET_NG.DESC$>
|
||||
EventQty = EventRec<SCHED_DET_NG.EVENT_TOTAL_WFRS$>
|
||||
NewEventQty = EventQty + ModifyQty
|
||||
Schedule_Services('ModifySchedEvent', SchedDetNGKey, ReactNo, WONo, StartDTM, StopDTM, Desc, NewEventQty)
|
||||
// Adjust reactor events as needed.
|
||||
Schedule_Services('AdjustScheduleEvents', ReactNo)
|
||||
|
||||
end else
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' greater than current DTM.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event quantity not increased.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
GoSub ClearCursors
|
||||
Case ModifyQty LT 0
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<2> = 'WO_LOG_ACTIONS'
|
||||
LogData<3> = 'Work order ':WONo:' quantity decreased from ':OrigQty:' to ':NewQty:'.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Searching for a scheduled event to decrease the quantity.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
// Search schedule for most recent events and decrease/delete those events as needed.
|
||||
Query = 'SELECT SCHED_DET_NG WITH WO_NO EQ ':WONo:' BY-DSND STOP_DTM'
|
||||
GoSub ClearCursors
|
||||
Set_Status(0)
|
||||
RList(Query, TARGET_ACTIVELIST$, '', '', False$)
|
||||
errCode = ''
|
||||
|
||||
If Get_Status(errCode) then
|
||||
|
||||
ErrorMsg = 'Error retrieving event list in WO_LOG_Actions. RList error code ':errCode:'.'
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = ErrorMsg
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
Error_Services('Add', ErrorMsg)
|
||||
|
||||
end else
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Query successful. Number of keys found: ':@RecCount:'.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
EOF = False$
|
||||
Done = False$
|
||||
UpdateReq = False$
|
||||
Loop
|
||||
ReadNext SchedDetNGKey else EOF = True$
|
||||
Until EOF EQ True$
|
||||
If SchedDetNGKey NE '' then
|
||||
EventRec = Database_Services('ReadDataRow', 'SCHED_DET_NG', SchedDetNGKey)
|
||||
StopDTM = EventRec<SCHED_DET_NG.STOP_DTM$>
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Work order record ':WONo:' quantity decreased from ':OrigQty:' to ':NewQty:'.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Scheduled event ':SchedDetNGKey:' found.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
// Only modify the event if it is still running or is scheduled in the future.
|
||||
If StopDTM GT Datetime() then
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' less than current DTM, so decreasing event quantity.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
UpdateReq = True$
|
||||
ReactNo = EventRec<SCHED_DET_NG.REACT_NO$>
|
||||
WONo = EventRec<SCHED_DET_NG.WO_NO$>
|
||||
StartDTM = EventRec<SCHED_DET_NG.START_DTM$>
|
||||
Desc = EventRec<SCHED_DET_NG.DESC$>
|
||||
EventQty = EventRec<SCHED_DET_NG.EVENT_TOTAL_WFRS$>
|
||||
If EventQty GT Abs(ModifyQty) then
|
||||
|
||||
// This event has enough wafers, so just reduce the quantity.
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event quantity ':EventQty:' greater than quantity reduction ':ModifyQty:', so decreasing event quantity.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
Done = True$
|
||||
NewEventQty = EventQty + ModifyQty
|
||||
Schedule_Services('ModifySchedEvent', SchedDetNGKey, ReactNo, WONo, StartDTM, StopDTM, Desc, NewEventQty)
|
||||
|
||||
end else
|
||||
|
||||
// This event has fewer wafers than are being removed. Delete this event and continue
|
||||
// onto the next event.
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event quantity ':EventQty:' less than quantity reduction ':ModifyQty:', so canceling event.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
Schedule_Services('CancelScheduleEvent', SchedDetNGKey, True$)
|
||||
ModifyQty += EventQty
|
||||
|
||||
end
|
||||
end else
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' greater than current DTM.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event quantity not decreased.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
end
|
||||
end
|
||||
Until Done EQ True$
|
||||
Repeat
|
||||
If UpdateReq then
|
||||
// Adjust reactor events as needed.
|
||||
Schedule_Services('AdjustScheduleEvents', ReactNo)
|
||||
end
|
||||
end
|
||||
GoSub ClearCursors
|
||||
|
||||
Case Otherwise$
|
||||
Null
|
||||
End Case
|
||||
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
|
||||
|
||||
end service
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -155,17 +155,23 @@ WRITE_RECORD_PRE:
|
||||
return
|
||||
|
||||
WRITE_RECORD:
|
||||
|
||||
OrigQty = OrigRecord<TW_USE_TW_QTY$>
|
||||
NewQty = Record<TW_USE_TW_QTY$>
|
||||
OrigSig = OrigRecord<TW_USE_SIGNATURE$>
|
||||
NewSig = OrigRecord<TW_USE_SIGNATURE$>
|
||||
|
||||
If OrigRecord EQ '' or OrigQty NE NewQty or OrigSig NE NewSig then
|
||||
If ( (OrigRecord EQ '') or (OrigQty NE NewQty) or (OrigSig NE NewSig) ) then
|
||||
MetrologyID = Field(Name, '*', 1)
|
||||
RDSNo = Xlate('RDS_TEST', MetrologyID, RDS_TEST_RDS_NO$, 'X')
|
||||
|
||||
Service_Services('PostProcedure', 'RDS_SERVICES', 'AllTWUseSigned':SD$:RDSNo)
|
||||
end
|
||||
|
||||
If (OrigQty NE NewQty) then
|
||||
ScrapAdj = NewQty - OrigQty
|
||||
Work_Order_Services('AdjustScrappedQty', {WO_NO}, ScrapAdj)
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
DELETE_RECORD_PRE:
|
||||
@ -180,6 +186,11 @@ DELETE_RECORD:
|
||||
LogData<3> = Name
|
||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||
|
||||
OrigQty = OrigRecord<TW_USE_TW_QTY$>
|
||||
NewQty = 0
|
||||
ScrapAdj = NewQty - OrigQty
|
||||
Work_Order_Services('AdjustScrappedQty', {WO_NO}, ScrapAdj)
|
||||
|
||||
return
|
||||
|
||||
|
||||
@ -228,3 +239,4 @@ Restore_System_Variables:
|
||||
@FILE.ERROR = OrigFileError
|
||||
return
|
||||
|
||||
|
||||
|
@ -60,6 +60,8 @@ $Insert CUST_EPI_PART_EQUATES
|
||||
$Insert QUOTE_SPEC_EQU
|
||||
$Insert WO_STEP_EQUATES
|
||||
|
||||
Equ NUM_ATTEMPTS$ to 60
|
||||
|
||||
EQU PI$LEFT TO 1
|
||||
EQU PI$TOP TO 2
|
||||
EQU PI$RIGHT TO 3
|
||||
@ -77,7 +79,7 @@ EQU PS$PATTERN TO 11
|
||||
Declare function PSN_Services, SRP_Rotate_Array, Datetime, Database_Services, Environment_Services, Logging_Services
|
||||
Declare function obj_Install, SRP_Json
|
||||
Declare subroutine Database_Services, Set_Status, obj_Wo_Mat_Log, Logging_Services, Extract_Si_Keys, Btree.Extract
|
||||
Declare subroutine SRP_Json
|
||||
Declare subroutine SRP_Json, Update_Index, Delay
|
||||
|
||||
GoToService else
|
||||
Error_Services('Set', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
|
||||
@ -218,19 +220,27 @@ Service VerifyWoStepWMIKeyIndex(WMIKey)
|
||||
// Add index transaction to update WM_IN_KEYS relational index (target WO_STEP table)
|
||||
IndexTransactionRow = 'WO_STEP*WM_IN_KEYS*AR':@FM:WMIKey:@FM:"":@FM:WOStepKey:@FM
|
||||
Open "!WM_IN" to BangTable then
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
Lock BangTable, 0 then
|
||||
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
|
||||
PendingTrans := IndexTransactionRow
|
||||
Write PendingTrans on BangTable, 0 then
|
||||
LogData<4> = 'Index transaction successfully added.'
|
||||
Logging_Services('AppendLog', objVerifyWMIKeyLog, LogData, @RM, @FM)
|
||||
Done = True$
|
||||
end else
|
||||
ErrorMsg = 'Unable to write index transaction to !WM_IN. ':WMIKey
|
||||
end
|
||||
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Unable to Lock !WM_IN to add index transaction. ':WMIKey
|
||||
end
|
||||
end
|
||||
Until Done or ErrorMsg
|
||||
Next AttemptNo
|
||||
end else
|
||||
ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
|
||||
end
|
||||
@ -263,10 +273,9 @@ Service VerifyWOLogWMIKeyIndex(WMIKey)
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_IN WM_IN{WO_NO} Log.csv'
|
||||
Headers = 'Logging DTM':@FM:'WMIKey':@FM:'WOStep':@FM:'Result'
|
||||
objVerifyWMIWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<2> = WMIKey
|
||||
LogData<4> = 'Begin ':Service
|
||||
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
|
||||
@ -278,32 +287,44 @@ Service VerifyWOLogWMIKeyIndex(WMIKey)
|
||||
If WONo NE '' then
|
||||
WOLogRDSKeys = ''
|
||||
Extract_Si_Keys('WM_IN', 'WO_NO', WONo, WOLogRDSKeys)
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<3> = WONo
|
||||
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
|
||||
Locate WMIKey in WOLogRDSKeys using @VM setting vPos else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WMIKey missing from Btree index. Generating index transaction.'
|
||||
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
|
||||
// Add index transaction to update WO_NO btree index
|
||||
IndexTransactionRow = 'WO_NO':@FM:WMIKey:@FM:"":@FM:WONo:@FM
|
||||
Open "!WM_IN" to BangTable then
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
Lock BangTable, 0 then
|
||||
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
|
||||
PendingTrans := IndexTransactionRow
|
||||
Write PendingTrans on BangTable, 0 then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'Index transaction successfully added.'
|
||||
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
|
||||
Done = True$
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !WM_IN. ':WMIKey
|
||||
end
|
||||
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_IN to add index transaction. ':WMIKey
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !WM_IN to add index transaction. ':WMIKey
|
||||
end
|
||||
end
|
||||
Until Done or ErrorMsg
|
||||
Next AttemptNo
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_IN to add index transaction. ':WMIKey
|
||||
end
|
||||
end
|
||||
end else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WONo for WM_IN ':WMIKey:' is null. Nothing to update.'
|
||||
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
|
||||
end
|
||||
@ -313,10 +334,12 @@ Service VerifyWOLogWMIKeyIndex(WMIKey)
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = ErrorMsg
|
||||
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
|
||||
end
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'End ':Service
|
||||
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
|
||||
|
||||
@ -333,10 +356,9 @@ Service VerifyWOMatWMIKeyIndex(WMIKey)
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_IN WO_MAT{WMI_KEY} Log.csv'
|
||||
Headers = 'Logging DTM':@FM:'WMIKey':@FM:'WOMatKey':@FM:'Result'
|
||||
objVerifyWoMatWmiKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<2> = WMIKey
|
||||
LogData<4> = 'Begin ':Service
|
||||
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
|
||||
@ -347,32 +369,44 @@ Service VerifyWOMatWMIKeyIndex(WMIKey)
|
||||
WOMatKey = Field(WMIKey, '*', 1, 1):'*':Field(WMIKey, '*', 3, 1)
|
||||
If WOMatKey NE '' then
|
||||
WOMatWMIKey = Xlate('WO_MAT', WOMatKey, 'WMI_KEY', 'X')
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<3> = WOMatKey
|
||||
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
|
||||
If WOMatWMIKey EQ '' then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WMIKey missing from WO_MAT record. Generating index transaction.'
|
||||
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
|
||||
// Add index transaction to update WMI_KEY relational index (target WO_MAT table)
|
||||
IndexTransactionRow = 'WO_MAT*WMI_KEY*TOP':@FM:WMIKey:@FM:"":@FM:WOMatKey:@FM
|
||||
Open "!WM_IN" to BangTable then
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
Lock BangTable, 0 then
|
||||
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
|
||||
PendingTrans := IndexTransactionRow
|
||||
Write PendingTrans on BangTable, 0 then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'Index transaction successfully added.'
|
||||
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
|
||||
Done = True$
|
||||
end else
|
||||
ErrorMsg = 'Unable to write index transaction to !WM_IN. ':WMIKey
|
||||
end
|
||||
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Unable to Lock !WM_IN to add index transaction. ':WMIKey
|
||||
end
|
||||
end
|
||||
Until Done or ErrorMsg
|
||||
Next AttemptNo
|
||||
end else
|
||||
ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
|
||||
end
|
||||
end
|
||||
end else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WO_MAT key for WM_IN ':WMIKey:' is null. Nothing to update.'
|
||||
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
|
||||
end
|
||||
@ -380,10 +414,12 @@ Service VerifyWOMatWMIKeyIndex(WMIKey)
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = ErrorMsg
|
||||
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
|
||||
end
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'End ':Service
|
||||
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
|
||||
|
||||
|
@ -57,18 +57,20 @@ $Insert WO_MAT_EQUATES
|
||||
$Insert WO_LOG_EQUATES
|
||||
$Insert COMPANY_EQUATES
|
||||
$Insert RETURN_TO_FAB_LOTS_EQUATES
|
||||
$INSERT PROD_SPEC_EQUATES
|
||||
$INSERT WO_STEP_EQUATES
|
||||
$INSERT EPI_PART_EQUATES
|
||||
$INSERT CUST_EPI_PART_EQUATES
|
||||
$INSERT PRS_STAGE_EQUATES
|
||||
$insert UNIT_EQUATES
|
||||
$Insert PROD_SPEC_EQUATES
|
||||
$Insert WO_STEP_EQUATES
|
||||
$Insert EPI_PART_EQUATES
|
||||
$Insert CUST_EPI_PART_EQUATES
|
||||
$Insert PRS_STAGE_EQUATES
|
||||
$Insert UNIT_EQUATES
|
||||
|
||||
Equ NUM_ATTEMPTS$ to 60
|
||||
|
||||
Declare function Database_Services, SRP_JSON, Error_Services, Clean_Insp_Services, WO_Mat_QA_Services
|
||||
Declare function PSN_Services, SRP_Rotate_Array, Datetime, Return_To_Fab_Services, Environment_Services
|
||||
Declare function Logging_Services
|
||||
Declare subroutine Database_Services, SRP_JSON, Error_Services, Extract_Si_Keys, Set_Status, obj_wo_mat_log
|
||||
Declare subroutine Logging_Services, Btree.Extract
|
||||
Declare subroutine Logging_Services, Btree.Extract, Update_Index, Delay
|
||||
|
||||
GoToService else
|
||||
Error_Services('Set', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
|
||||
@ -458,10 +460,9 @@ Service VerifyWoStepWMOKeyIndex(WMOKey)
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WO_STEP{WM_OUT_KEYS} Log.csv'
|
||||
Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOStep':@FM:'Result'
|
||||
objVerifyWMOKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<2> = WMOKey
|
||||
LogData<4> = 'Begin ':Service
|
||||
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
|
||||
@ -472,32 +473,44 @@ Service VerifyWoStepWMOKeyIndex(WMOKey)
|
||||
WOStepKey = Field(WMOKey, '*', 1, 2)
|
||||
If WOStepKey NE '' then
|
||||
WOStepWMOKeys = Xlate('WO_STEP', WOStepKey, 'WM_OUT_KEYS', 'X')
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<3> = WOStepKey
|
||||
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
|
||||
Locate WMOKey in WOStepWMOKeys using @VM setting vPos else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WMOKey missing from WO_STEP record. Generating index transaction.'
|
||||
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
|
||||
// Add index transaction to update WM_OUT_KEYS relational index (target WO_STEP table)
|
||||
IndexTransactionRow = 'WO_STEP*WM_OUT_KEYS*AR':@FM:WMOKey:@FM:"":@FM:WOStepKey:@FM
|
||||
Open "!WM_OUT" to BangTable then
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
Lock BangTable, 0 then
|
||||
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
|
||||
PendingTrans := IndexTransactionRow
|
||||
Write PendingTrans on BangTable, 0 then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'Index transaction successfully added.'
|
||||
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
|
||||
Done = True$
|
||||
end else
|
||||
ErrorMsg = 'Unable to write index transaction to !WM_OUT. ':WMOKey
|
||||
end
|
||||
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Unable to Lock !WM_OUT to add index transaction. ':WMOKey
|
||||
end
|
||||
end
|
||||
Until Done or ErrorMsg
|
||||
Next AttemptNo
|
||||
end else
|
||||
ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
|
||||
end
|
||||
end
|
||||
end else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WO_STEP key for WM_OUT ':WMOKey:' is null. Nothing to update.'
|
||||
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
|
||||
end
|
||||
@ -505,10 +518,12 @@ Service VerifyWoStepWMOKeyIndex(WMOKey)
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = ErrorMsg
|
||||
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
|
||||
end
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'End ':Service
|
||||
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
|
||||
|
||||
@ -525,10 +540,9 @@ Service VerifyWOLogWMOKeyIndex(WMOKey)
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WM_OUT{WO_NO} Log.csv'
|
||||
Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOStep':@FM:'Result'
|
||||
objVerifyWMOWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<2> = WMOKey
|
||||
LogData<4> = 'Begin ':Service
|
||||
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
|
||||
@ -540,6 +554,7 @@ Service VerifyWOLogWMOKeyIndex(WMOKey)
|
||||
If WONo NE '' then
|
||||
WOLogRDSKeys = ''
|
||||
Extract_Si_Keys('WM_OUT', 'WO_NO', WONo, WOLogRDSKeys)
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<3> = WONo
|
||||
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
|
||||
Locate WMOKey in WOLogRDSKeys using @VM setting vPos else
|
||||
@ -548,24 +563,34 @@ Service VerifyWOLogWMOKeyIndex(WMOKey)
|
||||
// Add index transaction to update WO_NO btree index
|
||||
IndexTransactionRow = 'WO_NO':@FM:WMOKey:@FM:"":@FM:WONo:@FM
|
||||
Open "!WM_OUT" to BangTable then
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
Lock BangTable, 0 then
|
||||
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
|
||||
PendingTrans := IndexTransactionRow
|
||||
Write PendingTrans on BangTable, 0 then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'Index transaction successfully added.'
|
||||
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
|
||||
Done = True$
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !WM_OUT. ':WMOKey
|
||||
end
|
||||
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_OUT to add index transaction. ':WMOKey
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !WM_OUT to add index transaction. ':WMOKey
|
||||
end
|
||||
end
|
||||
Until Done or ErrorMsg
|
||||
Next AttemptNo
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_OUT to add index transaction. ':WMOKey
|
||||
end
|
||||
end
|
||||
end else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WONo for WM_OUT ':WMOKey:' is null. Nothing to update.'
|
||||
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
|
||||
end
|
||||
@ -575,10 +600,12 @@ Service VerifyWOLogWMOKeyIndex(WMOKey)
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = ErrorMsg
|
||||
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
|
||||
end
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'End ':Service
|
||||
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
|
||||
|
||||
@ -595,10 +622,9 @@ Service VerifyWOMatWMOKeyIndex(WMOKey)
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WO_MAT{WMO_KEY} Log.csv'
|
||||
Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOMatKey':@FM:'Result'
|
||||
objVerifyWOMatWmoKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<2> = WMOKey
|
||||
LogData<4> = 'Begin ':Service
|
||||
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
|
||||
@ -609,32 +635,44 @@ Service VerifyWOMatWMOKeyIndex(WMOKey)
|
||||
WOMatKey = Field(WMOKey, '*', 1, 1):'*':Field(WMOKey, '*', 3, 1)
|
||||
If WOMatKey NE '' then
|
||||
WOMatWMOKey = Xlate('WO_MAT', WOMatKey, 'WMO_KEY', 'X')
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<3> = WOMatKey
|
||||
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
|
||||
If WOMatWMOKey EQ '' then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WMOKey missing from WO_MAT record. Generating index transaction.'
|
||||
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
|
||||
// Add index transaction to update WMO_KEY relational index (target WO_MAT table)
|
||||
IndexTransactionRow = 'WO_MAT*WMO_KEY*TOP':@FM:WMOKey:@FM:"":@FM:WOMatKey:@FM
|
||||
Open "!WM_OUT" to BangTable then
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
Lock BangTable, 0 then
|
||||
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
|
||||
PendingTrans := IndexTransactionRow
|
||||
Write PendingTrans on BangTable, 0 then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'Index transaction successfully added.'
|
||||
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
|
||||
Done = True$
|
||||
end else
|
||||
ErrorMsg = 'Unable to write index transaction to !WM_OUT. ':WMOKey
|
||||
end
|
||||
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Unable to Lock !WM_OUT to add index transaction. ':WMOKey
|
||||
end
|
||||
end
|
||||
Until Done or ErrorMsg
|
||||
Next AttemptNo
|
||||
end else
|
||||
ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
|
||||
end
|
||||
end
|
||||
end else
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'WO_MAT key for WM_OUT ':WMOKey:' is null. Nothing to update.'
|
||||
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
|
||||
end
|
||||
@ -642,10 +680,12 @@ Service VerifyWOMatWMOKeyIndex(WMOKey)
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = ErrorMsg
|
||||
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
|
||||
end
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||
LogData<4> = 'End ':Service
|
||||
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
|
||||
|
||||
@ -653,6 +693,7 @@ Service VerifyWOMatWMOKeyIndex(WMOKey)
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service GetWMOutKeys(WOLogId)
|
||||
|
||||
ErrorMsg = ''
|
||||
|
@ -697,11 +697,21 @@ Service ReceiveCassette(WONo, ReceiveUser, LotNo, CassQty, SubPartNo, SubVendorC
|
||||
WOMatKey = WONo:'*':CassNo
|
||||
|
||||
Locate WOMatKey in WOMatKeys by 'AR' using @VM setting NewPos else
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$)
|
||||
If HaveLock then
|
||||
WOMatKeys = Database_Services('ReadDataColumn', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$)
|
||||
WOMatKeys<0, CassNo> = WOMatKey
|
||||
Database_Services('WriteDataColumn', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, WOMatKeys, True$, False$, False$)
|
||||
If Error_Services('NoError') then Done = True$
|
||||
end
|
||||
Until Done
|
||||
Next AttemptNo
|
||||
If Not(Done) then
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
Transaction_Services('PostWriteFieldTransaction', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, WOMatKey, CassNo)
|
||||
ErrCode = ''
|
||||
If Get_Status(ErrCode) then
|
||||
ErrorMsg = 'Error in ':Service:' service. Error message: ':ErrCode
|
||||
If Error_Services('HasError') then ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
|
||||
@ -795,7 +805,7 @@ Service ReleaseCassette(WOMatKey, ReleaseUser, RelDtm)
|
||||
RelWONo = Field(WOMatKey, '*', 1, 1)
|
||||
RelCassNo = Field(WOMatKey, '*', 2, 1)
|
||||
Set_Status(0)
|
||||
obj_WO_Log('ReleaseCassettes',RelWONo:@RM:RelCassNo:@RM:ReleaseUser:@RM:RelDtm)
|
||||
obj_WO_Log('ReleaseCassette',RelWONo:@RM:RelCassNo:@RM:ReleaseUser:@RM:RelDtm)
|
||||
errCode = ''
|
||||
If Get_Status(errCode) then
|
||||
ErrorMsg = 'Error in ':Service:' service. Error code ':errCode:'.'
|
||||
@ -1080,13 +1090,13 @@ Service UpdateReleasedQty(WONo)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
RelQty = ''
|
||||
UnRelQty = ''
|
||||
OrigRelQty = ''
|
||||
OrigUnRelQty = ''
|
||||
ErrorMsg = ''
|
||||
If WONo NE '' then
|
||||
If RowExists('WO_LOG', WONo) then
|
||||
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
|
||||
If Error_Services('NoError') then
|
||||
OrigRelQty = WORec<WO_LOG_REL_QTY_STATIC$>
|
||||
OrigUnRelQty = WORec<WO_LOG_UNREL_QTY_STATIC$>
|
||||
RelQty = obj_WO_Log('RelQty', WONo:@RM:WORec)
|
||||
WOQty = WORec<WO_LOG_QTY$>
|
||||
If RelQty GT WOQty then
|
||||
@ -1094,22 +1104,31 @@ Service UpdateReleasedQty(WONo)
|
||||
end else
|
||||
UnRelQty = WOQty - RelQty
|
||||
end
|
||||
Open 'WO_LOG' to hTable then
|
||||
Read WORec from hTable, WONo then
|
||||
OrigRelQty = WORec<WO_LOG_REL_QTY_STATIC$>
|
||||
OrigUnRelQty = WORec<WO_LOG_UNREL_QTY_STATIC$>
|
||||
If ( (OrigRelQty NE RelQty) or (OrigUnRelQty NE UnRelQty) ) then
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo)
|
||||
If HaveLock then
|
||||
WORec<WO_LOG_REL_QTY_STATIC$> = RelQty
|
||||
WORec<WO_LOG_UNREL_QTY_STATIC$> = UnRelQty
|
||||
Write WORec on hTable, WONo else
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to write unreleased quantity ':UnRelQty
|
||||
ErrorMsg := ' and/or UNREL_QTY_STATIC field of WO_LOG record ':WONo:'.'
|
||||
ErrorMsg := '@FILE_ERROR: ':@FILE_ERROR
|
||||
end
|
||||
end
|
||||
end
|
||||
Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec, True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
// Note: WriteDataRow will have unlocked the record
|
||||
Done = True$
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to open the WO_LOG table.'
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to write released quantity ':RelQty
|
||||
ErrorMsg := ' to the REL_QTY_STATIC field of WO_LOG record ':WONo:'. '
|
||||
ErrorMsg := 'Failed to write unreleased quantity ':UnRelQty:' to the UNREL_QTY_STATIC '
|
||||
ErrorMsg := 'field of the WO_LOG record ':WONo:'. '
|
||||
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end
|
||||
end
|
||||
Until Done
|
||||
Next AttemptNo
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
|
||||
@ -1132,7 +1151,7 @@ Service UpdateReleasedQty(WONo)
|
||||
Logging_Services('AppendLog', objUpRelLog, LogData, @RM, @FM)
|
||||
end else
|
||||
LogResult = 'Failed to update WO_LOG record ':WONo:' field REL_QTY_STATIC with released quantity ':RelQty
|
||||
LogResult := ' or field UNREL_QTY_STATIC with unreleased quantity ':UnRelQty:'. Error message: ':ErrorMsg
|
||||
LogResult := ' and field UNREL_QTY_STATIC with unreleased quantity ':UnRelQty:'. Error message: ':ErrorMsg
|
||||
LogData<3> = LogResult
|
||||
Logging_Services('AppendLog', objUpRelLog, LogData, @RM, @FM)
|
||||
Error_Services('Add', ErrorMsg)
|
||||
@ -1168,8 +1187,9 @@ Service AdjustReleasedQty(WONo, AdjustQty)
|
||||
End Case
|
||||
If (ErrorMsg EQ '' ) then
|
||||
If RowExists('WO_LOG', WONo) then
|
||||
Done = False$
|
||||
For Attempt = 1 to NUM_ATTEMPTS$
|
||||
If Attempt GT 0 then Delay(Attempt)
|
||||
If Attempt GT 1 then Delay(1)
|
||||
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$)
|
||||
If HaveLock then
|
||||
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
|
||||
@ -1182,20 +1202,28 @@ Service AdjustReleasedQty(WONo, AdjustQty)
|
||||
WORec<WO_LOG_REL_QTY_STATIC$> = RelQty
|
||||
WORec<WO_LOG_UNREL_QTY_STATIC$> = UnRelQty
|
||||
Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec, True$, False$, False$)
|
||||
If Error_Services('HasError') then
|
||||
If Error_Services('NoError') then
|
||||
Done = True$
|
||||
end else
|
||||
If Attempt GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to write ':RelQty:' on REL_QTY_STATIC '
|
||||
ErrorMsg := 'field and ':UnrelQty:' on UNREL_QTY_STATIC field of WO_LOG record ':WONo:'.'
|
||||
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end
|
||||
end else
|
||||
If Attempt GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
|
||||
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end
|
||||
end
|
||||
If ( Not(HaveLock) and (Attempt GE NUM_ATTEMPTS$) ) then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to lock WO_LOG ':WoNo:' for update after ':Attempt:' attempts.'
|
||||
end
|
||||
Until HaveLock or (ErrorMsg NE '')
|
||||
Until Done
|
||||
Next Attempt
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. ':WONo:' does not exist in the WO_LOG table.'
|
||||
@ -1230,43 +1258,43 @@ Service UpdateReceivedQty(WONo)
|
||||
Headers = 'Logging DTM' : @FM : 'WONo' : @FM : 'Notes'
|
||||
objUpRecLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
RXQty = ''
|
||||
OrigRXQty = ''
|
||||
RxQty = ''
|
||||
OpenQty = ''
|
||||
ErrorMsg = ''
|
||||
If WONo NE '' then
|
||||
If RowExists('WO_LOG', WONo) then
|
||||
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
|
||||
If Error_Services('NoError') then
|
||||
WOQty = WORec<WO_LOG_WO_QTY$>
|
||||
RXQty = obj_WO_Log('RxQty', WONo:@RM:WORec)
|
||||
OpenQty = WOQty - RXQty
|
||||
Open 'WO_LOG' to hTable then
|
||||
ReadV OrigRXQty from hTable, WONo, WO_LOG_RX_QTY_STATIC$ then
|
||||
If OrigRXQty NE RXQty then
|
||||
WriteV RXQty on hTable, WONo, WO_LOG_RX_QTY_STATIC$ else
|
||||
OrigRxQty = WORec<WO_LOG_RX_QTY_STATIC$>
|
||||
OrigOpenQty = WORec<WO_LOG_OPEN_QTY_STATIC$>
|
||||
RxQty = obj_WO_Log('RxQty', WONo:@RM:WORec)
|
||||
OpenQty = WOQty - RxQty
|
||||
If ( (OrigRxQty NE RxQty) or (OrigOpenQty NE OpenQty) ) then
|
||||
WORec<WO_LOG_RX_QTY_STATIC$> = RxQty
|
||||
WORec<WO_LOG_OPEN_QTY_STATIC$> = OpenQty
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo)
|
||||
If HaveLock then
|
||||
Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec, True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
// Note: WriteDataRow will have unlocked the record
|
||||
Done = True$
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to write received quantity ':RXQty
|
||||
ErrorMsg := ' to the RX_QTY_STATIC field of WO_LOG record ':WONo:'.'
|
||||
ErrorMsg := '@FILE_ERROR: ':@FILE_ERROR
|
||||
ErrorMsg := ' to the RX_QTY_STATIC field of WO_LOG record ':WONo:'. '
|
||||
ErrorMsg := 'Failed to write open quantity ':OpenQty
|
||||
ErrorMsg := ' to the OPEN_QTY_STATIC field of WO_LOG record ':WONo:'. '
|
||||
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Error reading RX_QTY_STATIC column from WO_LOG ':WONo:'.'
|
||||
end
|
||||
If ErrorMsg EQ '' then
|
||||
ReadV OrigOpenQty from hTable, WONo, WO_LOG_OPEN_QTY_STATIC$ then
|
||||
If OrigOpenQty NE OpenQty then
|
||||
WriteV OpenQty on hTable, WONo, WO_LOG_OPEN_QTY_STATIC$ else
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to write received quantity ':RXQty
|
||||
ErrorMsg := ' to the OPEN_QTY_STATIC field of WO_LOG record ':WONo:'.'
|
||||
ErrorMsg := '@FILE_ERROR: ':@FILE_ERROR
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Error reading OPEN_QTY_STATIC column from WO_LOG ':WONo:'.'
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to open the WO_LOG table.'
|
||||
Until Done
|
||||
Next AttemptNo
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
|
||||
@ -1283,12 +1311,15 @@ Service UpdateReceivedQty(WONo)
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<2> = WONo
|
||||
If ErrorMsg EQ '' then
|
||||
LogData<3> = 'Successfully updated WO_LOG record ':WONo:' field RX_QTY_STATIC with received quantity ':RXQty:'.'
|
||||
LogMsg = 'Successfully updated WO_LOG record ':WONo:' field RX_QTY_STATIC with received quantity ':RxQty:'.'
|
||||
LogMsg := 'Successfully updated WO_LOG record ':WONo:' field OPEN_QTY_STATIC with open quantity ':OpenQty:'.'
|
||||
LogData<3> = LogMsg
|
||||
Logging_Services('AppendLog', objUpRecLog, LogData, @RM, @FM)
|
||||
end else
|
||||
LogResult = 'Failed to update WO_LOG record ':WONo:' field RX_QTY_STATIC with received quantity ':RXQty
|
||||
LogResult := '. Error message: ':ErrorMsg
|
||||
LogData<3> = LogResult
|
||||
LogMsg = 'Failed to update WO_LOG record ':WONo:' field RX_QTY_STATIC with received quantity ':RxQty:'. '
|
||||
LogMsg := 'Failed to update WO_LOG record ':WONo:' field OPEN_QTY_STATIC with open quantity ':OpenQty:'. '
|
||||
LogMsg := 'Error message: ':ErrorMsg
|
||||
LogData<3> = LogMsg
|
||||
Logging_Services('AppendLog', objUpRecLog, LogData, @RM, @FM)
|
||||
Error_Services('Add', ErrorMsg)
|
||||
end
|
||||
@ -1322,8 +1353,9 @@ Service AdjustReceivedQty(WONo, AdjustQty)
|
||||
End Case
|
||||
If (ErrorMsg EQ '' ) then
|
||||
If RowExists('WO_LOG', WONo) then
|
||||
Done = False$
|
||||
For Attempt = 1 to NUM_ATTEMPTS$
|
||||
If Attempt GT 0 then Delay(Attempt)
|
||||
If Attempt GT 1 then Delay(1)
|
||||
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$)
|
||||
If HaveLock then
|
||||
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
|
||||
@ -1331,24 +1363,32 @@ Service AdjustReceivedQty(WONo, AdjustQty)
|
||||
WOQty = WORec<WO_LOG_WO_QTY$>
|
||||
OrigRxQty = WORec<WO_LOG_RX_QTY_STATIC$>
|
||||
RxQty = OrigRxQty + AdjustQty
|
||||
OpenQty = WOQty - RXQty
|
||||
OpenQty = WOQty - RxQty
|
||||
WORec<WO_LOG_RX_QTY_STATIC$> = RxQty
|
||||
WORec<WO_LOG_OPEN_QTY_STATIC$> = OpenQty
|
||||
Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec, True$, False$, False$)
|
||||
If Error_Services('HasError') then
|
||||
If Error_Services('NoError') then
|
||||
Done = True$
|
||||
end else
|
||||
If Attempt GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to write ':RxQty:' on RX_QTY_STATIC field '
|
||||
ErrorMsg := 'and ':OpenQty:' on OPEN_QTY_STATIC to WO_LOG ':WONo:'. Error message: '
|
||||
ErrorMsg := Error_Services('GetMessage')
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end
|
||||
end else
|
||||
If Attempt GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
|
||||
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end
|
||||
end
|
||||
If ( Not(HaveLock) and (Attempt GE NUM_ATTEMPTS$) ) then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to lock WO_LOG ':WoNo:' for update after ':Attempt:' attempts.'
|
||||
end
|
||||
Until HaveLock or (ErrorMsg NE '')
|
||||
Until Done
|
||||
Next Attempt
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. ':WONo:' does not exist in the WO_LOG table.'
|
||||
@ -1374,6 +1414,170 @@ Service AdjustReceivedQty(WONo, AdjustQty)
|
||||
end service
|
||||
|
||||
|
||||
Service AdjustScrappedQty(WONo, AdjustQty)
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Adjust Scrapped Qty Log.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'WONo' : @FM : 'Notes'
|
||||
objAdjScrapLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
RXQty = ''
|
||||
OrigRXQty = ''
|
||||
ErrorMsg = ''
|
||||
Begin Case
|
||||
Case (WONo EQ '')
|
||||
ErrorMsg = 'Error in ':Service:' service. Null WONo passed into service'
|
||||
Case (AdjustQty EQ '')
|
||||
ErrorMsg = 'Error in ':Service:' service. Null AdjustQty passed into service'
|
||||
Case Not(Num(AdjustQty))
|
||||
ErrorMsg = 'Error in ':Service:' service. AdjustQty is not a number'
|
||||
Case Index(AdjustQty, '.', 1)
|
||||
ErrorMsg = 'Error in ':Service:' service. AdjustQty cannot be a decimal value'
|
||||
Case Otherwise$
|
||||
Null
|
||||
End Case
|
||||
If (ErrorMsg EQ '' ) then
|
||||
If RowExists('WO_LOG', WONo) then
|
||||
Done = False$
|
||||
For Attempt = 1 to NUM_ATTEMPTS$
|
||||
If Attempt GT 1 then Delay(1)
|
||||
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$)
|
||||
If HaveLock then
|
||||
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
|
||||
If Error_Services('NoError') then
|
||||
OrigScrapQty = WORec<WO_LOG_SCRAP_QTY_STATIC$>
|
||||
ScrapQty = OrigScrapQty + AdjustQty
|
||||
Database_Services('WriteDataColumn', 'WO_LOG', WONo, WO_LOG_SCRAP_QTY_STATIC$, ScrapQty, True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
// Note: WriteDataColumn will release the lock
|
||||
Done = True$
|
||||
end else
|
||||
If Attempt GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to write ':ScrapQty:' on SCRAP_QTY_STATIC field. '
|
||||
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end
|
||||
end else
|
||||
If Attempt GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
|
||||
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end
|
||||
end
|
||||
If ( Not(HaveLock) and (Attempt GE NUM_ATTEMPTS$) ) then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to lock WO_LOG ':WoNo:' for update after ':Attempt:' attempts.'
|
||||
end
|
||||
Until Done
|
||||
Next Attempt
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. ':WONo:' does not exist in the WO_LOG table.'
|
||||
end
|
||||
end
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<2> = WONo
|
||||
If ErrorMsg EQ '' then
|
||||
LogResult = 'Successfully adjusted WO_LOG ':WONo:' scrapped quantity by ':AdjustQty
|
||||
LogResult := '. Updated WO_LOG record ':WONo:' field SCRAP_QTY_STATIC with scrap quantity ':ScrapQty:'.'
|
||||
LogData<3> = LogResult
|
||||
Logging_Services('AppendLog', objAdjScrapLog, LogData, @RM, @FM)
|
||||
end else
|
||||
LogResult = 'Failed to adjust WO_LOG ':WONo:' scrapped quantity by ':AdjustQty
|
||||
LogData<3> = LogResult
|
||||
Logging_Services('AppendLog', objAdjScrapLog, LogData, @RM, @FM)
|
||||
Error_Services('Add', ErrorMsg)
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service AdjustShippedQty(WONo, AdjustQty)
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Adjust Shipped Qty Log.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'WONo' : @FM : 'Notes'
|
||||
objAdjShipLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
RXQty = ''
|
||||
OrigRXQty = ''
|
||||
ErrorMsg = ''
|
||||
Begin Case
|
||||
Case (WONo EQ '')
|
||||
ErrorMsg = 'Error in ':Service:' service. Null WONo passed into service'
|
||||
Case (AdjustQty EQ '')
|
||||
ErrorMsg = 'Error in ':Service:' service. Null AdjustQty passed into service'
|
||||
Case Not(Num(AdjustQty))
|
||||
ErrorMsg = 'Error in ':Service:' service. AdjustQty is not a number'
|
||||
Case Index(AdjustQty, '.', 1)
|
||||
ErrorMsg = 'Error in ':Service:' service. AdjustQty cannot be a decimal value'
|
||||
Case Otherwise$
|
||||
Null
|
||||
End Case
|
||||
If (ErrorMsg EQ '' ) then
|
||||
If RowExists('WO_LOG', WONo) then
|
||||
Done = False$
|
||||
For Attempt = 1 to NUM_ATTEMPTS$
|
||||
If Attempt GT 1 then Delay(1)
|
||||
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$)
|
||||
If HaveLock then
|
||||
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
|
||||
If Error_Services('NoError') then
|
||||
OrigShipQty = WORec<WO_LOG_SHIP_QTY_STATIC$>
|
||||
ShipQty = OrigShipQty + AdjustQty
|
||||
Database_Services('WriteDataColumn', 'WO_LOG', WONo, WO_LOG_SHIP_QTY_STATIC$, ShipQty, True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
// Note: WriteDataColumn will release the lock
|
||||
Done = True$
|
||||
end else
|
||||
If Attempt GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to write ':ShipQty:' on SHIP_QTY_STATIC field. '
|
||||
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end
|
||||
end else
|
||||
If Attempt GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
|
||||
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end
|
||||
end
|
||||
If ( Not(HaveLock) and (Attempt GE NUM_ATTEMPTS$) ) then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to lock WO_LOG ':WoNo:' for update after ':Attempt:' attempts.'
|
||||
end
|
||||
Until Done
|
||||
Next Attempt
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. ':WONo:' does not exist in the WO_LOG table.'
|
||||
end
|
||||
end
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<2> = WONo
|
||||
If ErrorMsg EQ '' then
|
||||
LogResult = 'Successfully adjusted WO_LOG ':WONo:' shipped quantity by ':AdjustQty
|
||||
LogResult := '. Updated WO_LOG record ':WONo:' field SHIP_QTY_STATIC with scrap quantity ':ShipQty:'.'
|
||||
LogData<3> = LogResult
|
||||
Logging_Services('AppendLog', objAdjShipLog, LogData, @RM, @FM)
|
||||
end else
|
||||
LogResult = 'Failed to adjust WO_LOG ':WONo:' shipped quantity by ':AdjustQty
|
||||
LogData<3> = LogResult
|
||||
Logging_Services('AppendLog', objAdjShipLog, LogData, @RM, @FM)
|
||||
Error_Services('Add', ErrorMsg)
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service UpdateShippedQty(WONo)
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
|
||||
@ -1384,27 +1588,33 @@ Service UpdateShippedQty(WONo)
|
||||
objUpShipLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
ShipQty = ''
|
||||
OrigShipQty = ''
|
||||
ErrorMsg = ''
|
||||
If WONo NE '' then
|
||||
If RowExists('WO_LOG', WONo) then
|
||||
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
|
||||
If Error_Services('NoError') then
|
||||
OrigShipQty = WORec<WO_LOG_SHIP_QTY_STATIC$>
|
||||
ShipQty = obj_WO_Log('ShipQty', WONo:@RM:WORec)
|
||||
Open 'WO_LOG' to hTable then
|
||||
ReadV OrigShipQty from hTable, WONo, WO_LOG_SHIP_QTY_STATIC$ then
|
||||
If OrigShipQty NE ShipQty then
|
||||
WriteV ShipQty on hTable, WONo, WO_LOG_SHIP_QTY_STATIC$ else
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo)
|
||||
If HaveLock then
|
||||
Database_Services('WriteDataColumn', 'WO_LOG', WONo, WO_LOG_SHIP_QTY_STATIC$, ShipQty, True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
Done = True$
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to write ':ShipQty
|
||||
ErrorMsg := ' to the SHIP_QTY_STATIC field of WO_LOG record ':WONo:'.'
|
||||
ErrorMsg := '@FILE_ERROR: ':@FILE_ERROR
|
||||
ErrorMsg := ' to the SHIP_QTY_STATIC field of WO_LOG record ':WONo:'. '
|
||||
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Error reading SHIP_QTY_STATIC column from WO_LOG ':WONo:'.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to open the WO_LOG table.'
|
||||
Until Done
|
||||
Next AttemptNo
|
||||
If Database_Services('IsKeyIDSelfLocked', 'WO_LOG', WONo) then Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
|
||||
@ -1446,7 +1656,6 @@ Service UpdateScrappedQty(WONo)
|
||||
objUpScrapLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime
|
||||
ScrapQty = ''
|
||||
OrigScrapQty = ''
|
||||
ErrorMsg = ''
|
||||
If WONo NE '' then
|
||||
If RowExists('WO_LOG', WONo) then
|
||||
@ -1458,20 +1667,28 @@ Service UpdateScrappedQty(WONo)
|
||||
end else
|
||||
ScrapQty = Sum(Xlate('WO_LOG', WONo, 'WO_MAT_SAP_CONFIRM_SCRAP', 'X'))
|
||||
end
|
||||
Open 'WO_LOG' to hTable then
|
||||
ReadV OrigScrapQty from hTable, WONo, WO_LOG_SCRAP_QTY_STATIC$ then
|
||||
OrigScrapQty = WORec<WO_LOG_SCRAP_QTY_STATIC$>
|
||||
If OrigScrapQty NE ScrapQty then
|
||||
WriteV ScrapQty on hTable, WONo, WO_LOG_SCRAP_QTY_STATIC$ else
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo)
|
||||
If HaveLock then
|
||||
Database_Services('WriteDataColumn', 'WO_LOG', WONo, WO_LOG_SCRAP_QTY_STATIC$, ScrapQty, True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
// Note: WriteDataColumn will have unlocked the record
|
||||
Done = True$
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to write ':ScrapQty
|
||||
ErrorMsg := ' to the SCRAP_QTY_STATIC field of WO_LOG record ':WONo:'.'
|
||||
ErrorMsg := '@FILE_ERROR: ':@FILE_ERROR
|
||||
ErrorMsg := ' to the SCRAP_QTY_STATIC field of WO_LOG record ':WONo:'. '
|
||||
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
|
||||
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Error reading SCRAP_QTY_STATIC column from WO_LOG ':WONo:'.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to open the WO_LOG table.'
|
||||
Until Done
|
||||
Next AttemptNo
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
|
||||
@ -1569,6 +1786,8 @@ Service ConvertRecordToJSON(WONo, Record, ItemURL)
|
||||
SRP_JSON(objChildCassette, 'SetValue', 'RelDtm', Date_Services('ConvertDateTimeToISO8601', WOMatRec<WO_MAT_REL_DTM$>))
|
||||
SRP_JSON(objChildCassette, 'SetValue', 'RecUser', OConv(WOMatRec<WO_MAT_RX_BY$>, '[XLATE_CONV,LSL_USERS*FIRST_LAST]'))
|
||||
SRP_JSON(objChildCassette, 'SetValue', 'RelUser', OConv(WOMatRec<WO_MAT_REL_BY$>, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' ))
|
||||
SRP_JSON(objChildCassette, 'SetValue', 'WMInKey', WOMatRec<WO_MAT_WMI_KEY$>)
|
||||
SRP_JSON(objChildCassette, 'SetValue', 'WMOutKey', WOMatRec<WO_MAT_WMO_KEY$>)
|
||||
SRP_JSON(objChildCassettes, 'Add', objChildCassette)
|
||||
SRP_JSON(objChildCassette, 'Release')
|
||||
end
|
||||
|
@ -42,14 +42,15 @@ Function WO_LOG_Actions(Action, CalcColName, FSList, Handle, Name, FMC, Record,
|
||||
|
||||
***********************************************************************************************************************/
|
||||
#pragma precomp SRP_PreCompiler
|
||||
$insert APP_INSERTS
|
||||
$insert FILE.SYSTEM.EQUATES
|
||||
$insert ACTION_SETUP
|
||||
$insert WO_MAT_EQUATES
|
||||
$insert WO_LOG_EQUATES
|
||||
$insert WO_STEP_EQUATES
|
||||
$insert RLIST_EQUATES
|
||||
$insert SCHED_DET_NG_EQUATES
|
||||
$Insert APP_INSERTS
|
||||
$Insert FILE.SYSTEM.EQUATES
|
||||
$Insert ACTION_SETUP
|
||||
$Insert WO_MAT_EQUATES
|
||||
$Insert WO_LOG_EQUATES
|
||||
$Insert WO_STEP_EQUATES
|
||||
$Insert RLIST_EQUATES
|
||||
$Insert SCHED_DET_NG_EQUATES
|
||||
$Insert IFX_EQUATES
|
||||
|
||||
Equ Comma$ to ','
|
||||
|
||||
@ -57,7 +58,7 @@ Declare function Error_Services, Database_Services, Environment_Services, Logg
|
||||
Declare function GaN_Services, obj_WO_Log, SRP_Date
|
||||
Declare subroutine Error_Services, Database_Services, Environment_Services, Logging_Services, Obj_SAP
|
||||
Declare subroutine Logging_Services, Set_Status, Schedule_Services, Work_Order_Services, obj_Notes
|
||||
Declare subroutine Schedule_Services
|
||||
Declare subroutine Schedule_Services, Service_Services
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
@ -205,12 +206,12 @@ WRITE_RECORD_PRE:
|
||||
|
||||
OrigQty = OrigRecord<WO_LOG_QTY$>
|
||||
NewQty = Record<WO_LOG_QTY$>
|
||||
ModifyQty = NewQty - OrigQty
|
||||
OrigCassList = OrigRecord<WO_LOG_WO_MAT_KEY$>
|
||||
NewCassList = Record<WO_LOG_WO_MAT_KEY$>
|
||||
If ( (OrigQty NE NewQty) or (OrigCassList NE NewCassList) ) then
|
||||
// Update released, unreleased, and received quantities
|
||||
RelQty = obj_WO_Log('RelQty', Name:@RM:Record)
|
||||
Record<WO_LOG_REL_QTY_STATIC$> = RelQty
|
||||
// Update unreleased, open (i.e., not received) quantities
|
||||
RelQty = OrigRecord<WO_LOG_REL_QTY_STATIC$>
|
||||
If RelQty GT NewQty then
|
||||
UnRelQty = 0
|
||||
end else
|
||||
@ -218,8 +219,13 @@ WRITE_RECORD_PRE:
|
||||
end
|
||||
Record<WO_LOG_UNREL_QTY_STATIC$> = UnRelQty
|
||||
|
||||
RXQty = obj_WO_Log('RxQty', Name:@RM:Record)
|
||||
Record<WO_LOG_RX_QTY_STATIC$> = RXQty
|
||||
RxQty = OrigRecord<WO_LOG_RX_QTY_STATIC$>
|
||||
If RxQty GT NewQty then
|
||||
OpenQty = 0
|
||||
end else
|
||||
OpenQty = NewQty - RxQty
|
||||
end
|
||||
Record<WO_LOG_OPEN_QTY_STATIC$> = OpenQty
|
||||
SaveRecord = Record
|
||||
end
|
||||
|
||||
@ -278,202 +284,7 @@ WRITE_RECORD:
|
||||
NewQty = Record<WO_LOG_QTY$>
|
||||
ModifyQty = NewQty - OrigQty
|
||||
WONo = Name
|
||||
SchedDetNGKey = ''
|
||||
|
||||
Begin Case
|
||||
Case ModifyQty GT 0
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<2> = 'WO_LOG_ACTIONS'
|
||||
LogData<3> = 'Work order ':WONo:' quantity increased from ':OrigQty:' to ':NewQty:'.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Searching for a scheduled event to increase the quantity.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
// Search schedule for most recent event and increase that event quantity by the difference.
|
||||
Query = 'SELECT SCHED_DET_NG WITH WO_NO EQ ':WONo:' BY-DSND STOP_DTM'
|
||||
GoSub ClearCursors
|
||||
Set_Status(0)
|
||||
RList(Query, TARGET_ACTIVELIST$, '', '', False$)
|
||||
errCode = ''
|
||||
If Get_Status(errCode) then
|
||||
|
||||
ErrorMsg = 'Error retrieving event list in WO_LOG_Actions. RList error code ':errCode:'.'
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = ErrorMsg
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
Error_Services('Add', ErrorMsg)
|
||||
|
||||
end else
|
||||
|
||||
EOF = False$
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Query successful. Number of keys found: ':@RecCount:'.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
ReadNext SchedDetNGKey else EOF = True$
|
||||
If SchedDetNGKey NE '' then
|
||||
EventRec = Database_Services('ReadDataRow', 'SCHED_DET_NG', SchedDetNGKey)
|
||||
StopDTM = EventRec<SCHED_DET_NG.STOP_DTM$>
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Work order record ':WONo:' quantity increased from ':OrigQty:' to ':NewQty:'.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Scheduled event ':SchedDetNGKey:' found.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
// Only modify the event if it is still running or is scheduled in the future.
|
||||
If StopDTM GT Datetime() then
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' less than current DTM, so increasing event quantity.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
ReactNo = EventRec<SCHED_DET_NG.REACT_NO$>
|
||||
WONo = EventRec<SCHED_DET_NG.WO_NO$>
|
||||
StartDTM = EventRec<SCHED_DET_NG.START_DTM$>
|
||||
Desc = EventRec<SCHED_DET_NG.DESC$>
|
||||
EventQty = EventRec<SCHED_DET_NG.EVENT_TOTAL_WFRS$>
|
||||
NewEventQty = EventQty + ModifyQty
|
||||
Schedule_Services('ModifySchedEvent', SchedDetNGKey, ReactNo, WONo, StartDTM, StopDTM, Desc, NewEventQty)
|
||||
// Adjust reactor events as needed.
|
||||
Schedule_Services('AdjustScheduleEvents', ReactNo)
|
||||
|
||||
end else
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' greater than current DTM.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event quantity not increased.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
GoSub ClearCursors
|
||||
Case ModifyQty LT 0
|
||||
|
||||
LogData = ''
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<2> = 'WO_LOG_ACTIONS'
|
||||
LogData<3> = 'Work order ':WONo:' quantity decreased from ':OrigQty:' to ':NewQty:'.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Searching for a scheduled event to decrease the quantity.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
// Search schedule for most recent events and decrease/delete those events as needed.
|
||||
Query = 'SELECT SCHED_DET_NG WITH WO_NO EQ ':WONo:' BY-DSND STOP_DTM'
|
||||
GoSub ClearCursors
|
||||
Set_Status(0)
|
||||
RList(Query, TARGET_ACTIVELIST$, '', '', False$)
|
||||
errCode = ''
|
||||
|
||||
If Get_Status(errCode) then
|
||||
|
||||
ErrorMsg = 'Error retrieving event list in WO_LOG_Actions. RList error code ':errCode:'.'
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = ErrorMsg
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
Error_Services('Add', ErrorMsg)
|
||||
|
||||
end else
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Query successful. Number of keys found: ':@RecCount:'.'
|
||||
Schedule_Services('LogActivity', '', LogData, False$)
|
||||
|
||||
EOF = False$
|
||||
Done = False$
|
||||
UpdateReq = False$
|
||||
Loop
|
||||
ReadNext SchedDetNGKey else EOF = True$
|
||||
Until EOF EQ True$
|
||||
If SchedDetNGKey NE '' then
|
||||
EventRec = Database_Services('ReadDataRow', 'SCHED_DET_NG', SchedDetNGKey)
|
||||
StopDTM = EventRec<SCHED_DET_NG.STOP_DTM$>
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Work order record ':WONo:' quantity decreased from ':OrigQty:' to ':NewQty:'.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Scheduled event ':SchedDetNGKey:' found.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
// Only modify the event if it is still running or is scheduled in the future.
|
||||
If StopDTM GT Datetime() then
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' less than current DTM, so decreasing event quantity.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
UpdateReq = True$
|
||||
ReactNo = EventRec<SCHED_DET_NG.REACT_NO$>
|
||||
WONo = EventRec<SCHED_DET_NG.WO_NO$>
|
||||
StartDTM = EventRec<SCHED_DET_NG.START_DTM$>
|
||||
Desc = EventRec<SCHED_DET_NG.DESC$>
|
||||
EventQty = EventRec<SCHED_DET_NG.EVENT_TOTAL_WFRS$>
|
||||
If EventQty GT Abs(ModifyQty) then
|
||||
|
||||
// This event has enough wafers, so just reduce the quantity.
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event quantity ':EventQty:' greater than quantity reduction ':ModifyQty:', so decreasing event quantity.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
Done = True$
|
||||
NewEventQty = EventQty + ModifyQty
|
||||
Schedule_Services('ModifySchedEvent', SchedDetNGKey, ReactNo, WONo, StartDTM, StopDTM, Desc, NewEventQty)
|
||||
|
||||
end else
|
||||
|
||||
// This event has fewer wafers than are being removed. Delete this event and continue
|
||||
// onto the next event.
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event quantity ':EventQty:' less than quantity reduction ':ModifyQty:', so canceling event.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
Schedule_Services('CancelScheduleEvent', SchedDetNGKey, True$)
|
||||
ModifyQty += EventQty
|
||||
|
||||
end
|
||||
end else
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' greater than current DTM.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<3> = 'Event quantity not decreased.'
|
||||
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
|
||||
|
||||
end
|
||||
end
|
||||
Until Done EQ True$
|
||||
Repeat
|
||||
If UpdateReq then
|
||||
// Adjust reactor events as needed.
|
||||
Schedule_Services('AdjustScheduleEvents', ReactNo)
|
||||
end
|
||||
end
|
||||
GoSub ClearCursors
|
||||
|
||||
Case Otherwise$
|
||||
Null
|
||||
End Case
|
||||
If ModifyQty NE 0 then Service_Services('PostProcedure', 'SCHEDULE_SERVICES', 'AdjustWorkOrderScheduleQty':SD$:WONo:SD$:ModifyQty)
|
||||
|
||||
return
|
||||
|
||||
|
@ -44,16 +44,17 @@ Function WO_MAT_Actions(Action, CalcColName, FSList, Handle, Name, FMC, Record,
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
$insert APP_INSERTS
|
||||
$insert FILE.SYSTEM.EQUATES
|
||||
$insert DICT_EQUATES
|
||||
$insert ACTION_SETUP
|
||||
$insert WO_MAT_EQUATES
|
||||
$insert WO_LOG_EQUATES
|
||||
$insert WO_STEP_EQUATES
|
||||
$insert MAKEUP_WAFERS_EQUATES
|
||||
$insert RLIST_EQUATES
|
||||
$insert IFX_EQUATES
|
||||
$Insert APP_INSERTS
|
||||
$Insert FILE.SYSTEM.EQUATES
|
||||
$Insert DICT_EQUATES
|
||||
$Insert ACTION_SETUP
|
||||
$Insert WO_MAT_EQUATES
|
||||
$Insert WO_LOG_EQUATES
|
||||
$Insert WO_STEP_EQUATES
|
||||
$Insert MAKEUP_WAFERS_EQUATES
|
||||
$Insert WM_OUT_EQUATES
|
||||
$Insert RLIST_EQUATES
|
||||
$Insert IFX_EQUATES
|
||||
|
||||
Equ Comma$ to ','
|
||||
|
||||
@ -616,6 +617,10 @@ WRITE_RECORD:
|
||||
NewRelDtm = Record<WO_MAT_REL_DTM$>
|
||||
OrigRecDtm = OrigRecord<WO_MAT_RX_DTM$>
|
||||
NewRecDtm = Record<WO_MAT_RX_DTM$>
|
||||
OrigVoidFlag = OrigRecord<WO_MAT_VOID$>
|
||||
NewVoidFlag = Record<WO_MAT_VOID$>
|
||||
OrigShipNo = OrigRecord<WO_MAT_SHIP_NO$>
|
||||
NewShipNo = Record<WO_MAT_SHIP_NO$>
|
||||
AdjustQty = NewWfrQty - OrigWfrQty
|
||||
|
||||
If ( (OrigWfrQty NE '' ) and (OrigWfrQty NE NewWfrQty) and (OrigRecDtm NE '' and NewRecDtm NE '') ) then
|
||||
@ -624,7 +629,7 @@ WRITE_RECORD:
|
||||
end
|
||||
If ( (OrigRecDtm EQ '') and (NewRecDtm NE '') ) then
|
||||
// Cassette was just received. Increment received quantity of work order by the entire cassette wafer count.
|
||||
Work_Order_Services('AdjustReceivedQty', WONo, NewWfrQty)
|
||||
If NewWfrQty NE 0 then Work_Order_Services('AdjustReceivedQty', WONo, NewWfrQty)
|
||||
end
|
||||
|
||||
If ( (OrigWfrQty NE '') and (OrigWfrQty NE NewWfrQty) and ( (OrigRelDtm NE '') and (NewRelDtm NE '') ) ) then
|
||||
@ -633,7 +638,47 @@ WRITE_RECORD:
|
||||
end
|
||||
If ( (OrigRelDtm EQ '') and (NewRelDtm NE '') ) then
|
||||
// Cassette was just released. Increment released quantity of work order by the entire cassette wafer count.
|
||||
Work_Order_Services('AdjustReleasedQty', WONo, NewWfrQty)
|
||||
If NewWfrQty NE 0 then Work_Order_Services('AdjustReleasedQty', WONo, NewWfrQty)
|
||||
end
|
||||
|
||||
If ( (OrigVoidFlag NE True$) and (NewVoidFlag EQ True$) ) then
|
||||
If (NewWfrQty NE 0) then
|
||||
If (NewRecDtm NE '') then Work_Order_Services('AdjustReceivedQty', WONo, Neg(NewWfrQty))
|
||||
If (NewRelDtm NE '') then Work_Order_Services('AdjustReleasedQty', WONo, Neg(NewWfrQty))
|
||||
end
|
||||
end
|
||||
|
||||
If ( (NewVoidFlag NE True$) and (OrigVoidFlag EQ True$) ) then
|
||||
If (NewWfrQty NE 0) then
|
||||
If (NewRecDtm NE '') then Work_Order_Services('AdjustReceivedQty', WONo, NewWfrQty)
|
||||
If (NewRelDtm NE '') then Work_Order_Services('AdjustReleasedQty', WONo, NewWfrQty)
|
||||
end
|
||||
end
|
||||
|
||||
If ( (OrigShipNo EQ '') and (NewShipNo NE '') ) then
|
||||
ShipQty = 0
|
||||
WMOKey = Record<WO_MAT_WMO_KEY$>
|
||||
If (WMOKey NE '') then
|
||||
CurrWfrCnt = Xlate('WM_OUT', WMOKey, 'WAFER_CNT', 'X')
|
||||
ShipQty += CurrWfrCnt
|
||||
end else
|
||||
CurrWfrCnt = obj_WO_Mat('CurrWaferCnt',WOMatKeyID:@RM:Record)
|
||||
ShipQty += CurrWfrCnt
|
||||
end
|
||||
If ShipQty NE 0 then Work_Order_Services('AdjustShippedQty', WONo, ShipQty)
|
||||
end
|
||||
|
||||
If ( (NewShipNo EQ '') and (OrigShipNo NE '') ) then
|
||||
ShipQty = 0
|
||||
WMOKey = Record<WO_MAT_WMO_KEY$>
|
||||
If (WMOKey NE '') then
|
||||
CurrWfrCnt = Xlate('WM_OUT', WMOKey, 'WAFER_CNT', 'X')
|
||||
ShipQty += CurrWfrCnt
|
||||
end else
|
||||
CurrWfrCnt = obj_WO_Mat('CurrWaferCnt',WOMatKeyID:@RM:Record)
|
||||
ShipQty += CurrWfrCnt
|
||||
end
|
||||
If (ShipQty NE 0) then Work_Order_Services('AdjustShippedQty', WONo, Neg(ShipQty))
|
||||
end
|
||||
|
||||
If {REACTOR_TYPE} NE 'EPP' then
|
||||
@ -889,6 +934,35 @@ return
|
||||
|
||||
|
||||
DELETE_RECORD:
|
||||
debug
|
||||
WOMatKeyID = Name
|
||||
WONo = Field(WOMatKeyID, '*', 1, 1)
|
||||
OrigWfrQty = OrigRecord<WO_MAT_WAFER_QTY$>
|
||||
OrigVoidFlag = OrigRecord<WO_MAT_VOID$>
|
||||
OrigShipNo = OrigRecord<WO_MAT_SHIP_NO$>
|
||||
OrigRelDtm = OrigRecord<WO_MAT_REL_DTM$>
|
||||
OrigRecDtm = OrigRecord<WO_MAT_RX_DTM$>
|
||||
|
||||
If (OrigVoidFlag NE True$) then
|
||||
If (OrigWfrQty NE 0) then
|
||||
If (OrigRecDtm NE '') then Work_Order_Services('AdjustReceivedQty', WONo, Neg(OrigWfrQty))
|
||||
If (OrigRelDtm NE '') then Work_Order_Services('AdjustReleasedQty', WONo, Neg(OrigWfrQty))
|
||||
end
|
||||
end
|
||||
|
||||
If (OrigShipNo NE '') then
|
||||
ShipQty = 0
|
||||
WMOKey = OrigRecord<WO_MAT_WMO_KEY$>
|
||||
If (WMOKey NE '') then
|
||||
CurrWfrCnt = Xlate('WM_OUT', WMOKey, 'WAFER_CNT', 'X')
|
||||
ShipQty += CurrWfrCnt
|
||||
end else
|
||||
CurrWfrCnt = obj_WO_Mat('CurrWaferCnt',WOMatKeyID:@RM:OrigRecord)
|
||||
ShipQty += CurrWfrCnt
|
||||
end
|
||||
If (ShipQty NE 0) then Work_Order_Services('AdjustShippedQty', WONo, Neg(ShipQty))
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user