updated service to remove keys if lot is voided
This commit is contained in:
@ -2175,25 +2175,66 @@ Service UpdateWorkOrderData(WONo)
|
|||||||
For CassNo = 1 to MAX_NUM_CASS$
|
For CassNo = 1 to MAX_NUM_CASS$
|
||||||
WOMatKey = WONo:'*':CassNo
|
WOMatKey = WONo:'*':CassNo
|
||||||
If RowExists('WO_MAT', WOMatKey) then
|
If RowExists('WO_MAT', WOMatKey) then
|
||||||
Locate WOMatKey in OrigWOLogWOMatKeys using @VM setting vPos then
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
LogData<4> = 'WOMatKey ':WOMatKey:' exists...'
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' found in WO_LOG record. Nothing to update.'
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
Voided = Xlate('WO_MAT', WOMatKey, 'VOID', 'X')
|
||||||
end else
|
If Not(Voided) then
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' not found in WO_LOG record. Adding WOMatKey to column.'
|
LogData<4> = 'WOMatKey ':WOMatKey:' not voided. Checking if it needs to be added to column...'
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
NewWOLogWOMatKeys<0, -1> = WOMatKey
|
Locate WOMatKey in OrigWOLogWOMatKeys using @VM setting vPos then
|
||||||
end
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
|
LogData<4> = 'WOMatKey ':WOMatKey:' found in WO_LOG record. Nothing to update.'
|
||||||
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
|
end else
|
||||||
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
|
LogData<4> = 'WOMatKey ':WOMatKey:' not found in WO_LOG record. Adding WOMatKey to column.'
|
||||||
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
|
NewWOLogWOMatKeys<0, -1> = WOMatKey
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
|
LogData<4> = 'WOMatKey ':WOMatKey:' has been voided...'
|
||||||
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
|
Locate WOMatKey in NewWOLogWOMatKeys using @VM setting vPos then
|
||||||
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
|
LogData<4> = 'WOMatKey ':WOMatKey:' found in WO_LOG record. Removing from column.'
|
||||||
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
|
NewWOLogWOMatKeys = Delete(NewWOLogWOMatKeys, 0, vPos, 0)
|
||||||
|
end else
|
||||||
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
|
LogData<4> = 'WOMatKey ':WOMatKey:' not found in WO_LOG record. Nothing to update.'
|
||||||
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
|
LogData<4> = 'WOMatKey ':WOMatKey:' does not exist. Checking if WOMatKey ':WOMatKey:' needs to be removed from column...'
|
||||||
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
|
Locate WOMatKey in NewWOLogWOMatKeys using @VM setting vPos then
|
||||||
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
|
LogData<4> = 'WOMatKey ':WOMatKey:' found in WO_LOG record. Removing from column.'
|
||||||
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
|
NewWOLogWOMatKeys = Delete(NewWOLogWOMatKeys, 0, vPos, 0)
|
||||||
|
end else
|
||||||
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
|
LogData<4> = 'WOMatKey ':WOMatKey:' not found in WO_LOG record. Nothing to update.'
|
||||||
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
Next CassNo
|
Next CassNo
|
||||||
If OrigWOLogWOMatKeys NE NewWOLogWOMatKeys then
|
If OrigWOLogWOMatKeys NE NewWOLogWOMatKeys then
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
LogData<4> = 'WOMatKeys missing from work order. Posting transaction to update WO_MAT_KEY column.'
|
LogData<4> = 'WOMatKeys column out of date. Posting transaction to update WO_MAT_KEY column.'
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
NewWOLogWOMatKeys = SRP_Array('SortRows', NewWOLogWOMatKeys, 'AR2', 'LIST', @VM, '*')
|
NewWOLogWOMatKeys = SRP_Array('SortRows', NewWOLogWOMatKeys, 'AR2', 'LIST', @VM, '*')
|
||||||
Transaction_Services('PostWriteFieldTransaction', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, NewWOLogWOMatKeys)
|
Transaction_Services('PostWriteFieldTransaction', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, NewWOLogWOMatKeys)
|
||||||
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
|
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
|
||||||
|
end else
|
||||||
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
|
LogData<4> = 'WOMatKeys column accurate. Nothing to update.'
|
||||||
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMsg = 'Error in ':Service:' service. ':Error_Services('GetMessage')
|
ErrorMsg = 'Error in ':Service:' service. ':Error_Services('GetMessage')
|
||||||
|
Reference in New Issue
Block a user