Changed VOID and PACKAGING LOT_EVENTS to COMMENT type events. Modified code to only add them if lot is in new LOT table.

This commit is contained in:
Infineon\StieberD
2025-08-20 16:27:11 -07:00
parent 1f2777cd18
commit 722bc63bdb
2 changed files with 62 additions and 66 deletions

View File

@ -712,7 +712,7 @@ Service CreatePackagingRecord(LotId, UserId, EqpId)
NewPackagingRec<PACKAGING_COMPLETE_DTM$> = TransDtm NewPackagingRec<PACKAGING_COMPLETE_DTM$> = TransDtm
Database_Services('WriteDataRow', 'PACKAGING', NewRecId, NewPackagingRec, True$, 0, False$) Database_Services('WriteDataRow', 'PACKAGING', NewRecId, NewPackagingRec, True$, 0, False$)
If Error_Services('NoError') then If Error_Services('NoError') then
Lot_Event_Services('CreateLotEvent', LotId, TransDtm, 'PACKAGING', 'Lot Packaged.', EqpId, UserId) Lot_Event_Services('CreateLotEvent', LotId, TransDtm, 'COMMENT', 'Lot Packaged.', EqpId, UserId)
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
@ -765,5 +765,3 @@ Service AddPackToLotOperation(LotOperationId, PackagingId, UserId)
end service end service

View File

@ -1456,15 +1456,7 @@ Service CreateVoidedLotRecord(LotId, LegacyLotId, LegacyLotType, WoMatKey, UserI
if LegacyLotType NE '' then if LegacyLotType NE '' then
if LegacyLotType EQ 'RDS' OR LegacyLotType EQ 'WM_IN' OR LegacyLotType EQ 'WM_OUT' then if LegacyLotType EQ 'RDS' OR LegacyLotType EQ 'WM_IN' OR LegacyLotType EQ 'WM_OUT' then
LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', LegacyLotId, LegacyLotType) LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', LegacyLotId, LegacyLotType)
If Error_Services('NoError') then If Error_Services('HasError') then
If LotID EQ '' then
//No Lot ID was found, lets create one.
LotId = Lot_Services('CreateNewLot', 'RDS', '', '', '', '', '', UserId, '', LegacyLotId)
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
end
end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
end else end else
@ -1475,23 +1467,19 @@ Service CreateVoidedLotRecord(LotId, LegacyLotId, LegacyLotType, WoMatKey, UserI
end end
end end
If ErrorMessage NE '' then If (ErrorMessage EQ '') then
If RowExists('LOT', LotId) then NewVoidedLotId = RTI_CreateGUID()
NewVoidedLotId = RTI_CreateGUID() NewVoidedLotRec = ''
NewVoidedLotRec = '' NewVoidedLotRec<VOIDED_LOT_WORK_ORDER_LOG_ID$> = Field(WoMatKey, '*', 1)
NewVoidedLotRec<VOIDED_LOT_WORK_ORDER_LOG_ID$> = Field(WoMatKey, '*', 1) NewVoidedLotRec<VOIDED_LOT_VOID_BY$> = UserId
NewVoidedLotRec<VOIDED_LOT_VOID_BY$> = UserId NewVoidedLotRec<VOIDED_LOT_VOID_DTM$> = Datetime()
NewVoidedLotRec<VOIDED_LOT_VOID_DTM$> = Datetime() NewVoidedLotRec<VOIDED_LOT_ENTITY_TYPE$> = LegacyLotType
NewVoidedLotRec<VOIDED_LOT_ENTITY_TYPE$> = LegacyLotType NewVoidedLotRec<VOIDED_LOT_LOT_ID$> = LotId
NewVoidedLotRec<VOIDED_LOT_LOT_ID$> = LotId NewVoidedLotRec<VOIDED_LOT_LEGACY_LOT_ID$> = LegacyLotId
NewVoidedLotRec<VOIDED_LOT_LEGACY_LOT_ID$> = LegacyLotId NewVoidedLotRec<VOIDED_LOT_WO_MAT_KEY$> = WoMatKey
NewVoidedLotRec<VOIDED_LOT_WO_MAT_KEY$> = WoMatKey Database_Services('WriteDataRow', 'VOIDED_LOT', NewVoidedLotId, NewVoidedLotRec)
Database_Services('WriteDataRow', 'VOIDED_LOT', NewVoidedLotId, NewVoidedLotRec) If Error_Services('HasError') then
If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage')
ErrorMessage = Error_Services('GetMessage')
end
end else
ErrorMessage = 'Unable to find lot record.'
end end
end end
end else end else
@ -1504,6 +1492,7 @@ Service CreateVoidedLotRecord(LotId, LegacyLotId, LegacyLotType, WoMatKey, UserI
end service end service
Service IsLotVoided(LotId) Service IsLotVoided(LotId)
//Todo: Move to Lot_Services //Todo: Move to Lot_Services
@ -1525,6 +1514,7 @@ Service IsLotVoided(LotId)
end service end service
Service SignVoidNonEpp(WOMatKeys, WONo, Username) Service SignVoidNonEpp(WOMatKeys, WONo, Username)
ErrorMessage = '' ErrorMessage = ''
@ -1545,9 +1535,14 @@ Service SignVoidNonEpp(WOMatKeys, WONo, Username)
if Error_Services('NoError') then if Error_Services('NoError') then
RDS_Services('DetachRDSFromWO', RDSNo) RDS_Services('DetachRDSFromWO', RDSNo)
If Error_Services('NoError') then If Error_Services('NoError') then
//Create a voided LOT record then record an event. // Create a voided LOT record.
Work_Order_Services('CreateVoidedLotRecord', '', RDSNo, 'RDS', WoMatKey, Username) Work_Order_Services('CreateVoidedLotRecord', '', RDSNo, 'RDS', WoMatKey, Username)
Lot_Event_Services('CreateLotEvent', RDSNo, Datetime(), 'VOID', 'Lot voided by ' : Username, '', Username, True$, 'RDS') LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', RDSNo, 'RDS')
// Create a LOT_EVENT record if this lot is in the new LOT system.
If LotId NE '' then
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'COMMENT', 'Lot voided by ' : Username, '', Username, True$, 'RDS')
If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage')
end
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
@ -1610,20 +1605,27 @@ Service SignVoidWMI(WMInKeys, WONo, Username)
If Not(IsOnHold) then If Not(IsOnHold) then
WM_In_Services('SetVoidFlag', WmInKey, Username) WM_In_Services('SetVoidFlag', WmInKey, Username)
If Error_Services('NoError') then If Error_Services('NoError') then
Lot_Event_Services('CreateLotEvent', WmInKey, DateTime(), 'VOID', 'Lot voided by ' : Username, '', Username, True$, 'WM_IN')
Work_Order_Services('CreateVoidedLotRecord', '', WmInKey, 'WM_IN', WoMatKey, Username) Work_Order_Services('CreateVoidedLotRecord', '', WmInKey, 'WM_IN', WoMatKey, Username)
if Error_Services('NoError') then If Error_Services('NoError') then
//Check if WMO is also voided. If it is, remove it from the WO_MAT_KEY field in WO_LOG, and void the WO_MAT record LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', WmInKey, 'WM_IN')
WMOKey = WMInKey; //the paired WMO key is the same as the WMIKey // Create a LOT_EVENT record if this lot is in the new LOT system.
IsWMOVoided = Database_Services('ReadDataColumn', 'WM_OUT', WMOKey, WM_OUT_VOID$) If LotId NE '' then
If IsWMOVoided then Lot_Event_Services('CreateLotEvent', WmInKey, DateTime(), 'COMMENT', 'Lot voided by ' : Username, '', Username, True$, 'WM_IN')
Locate WoMatKey in WoLogRecord<WO_LOG_WO_MAT_KEY$> using @VM setting CassPos then If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage')
WoLogRecord<WO_LOG_WO_MAT_KEY$> = Delete(WOLogRecord<WO_LOG_WO_MAT_KEY$>, 1, CassPos, 0) end
WO_Mat_Services('SetWoMatVoidFlag', WoMatKey, Username) If ErrorMessage EQ '' then
end else //Check if WMO is also voided. If it is, remove it from the WO_MAT_KEY field in WO_LOG, and void the WO_MAT record
ErrorMessage = 'Unable to locate WO_MAT key in WO_LOG record.' WMOKey = WMInKey; //the paired WMO key is the same as the WMIKey
IsWMOVoided = Database_Services('ReadDataColumn', 'WM_OUT', WMOKey, WM_OUT_VOID$)
If IsWMOVoided then
Locate WoMatKey in WoLogRecord<WO_LOG_WO_MAT_KEY$> using @VM setting CassPos then
WoLogRecord<WO_LOG_WO_MAT_KEY$> = Delete(WOLogRecord<WO_LOG_WO_MAT_KEY$>, 1, CassPos, 0)
WO_Mat_Services('SetWoMatVoidFlag', WoMatKey, Username)
end else
ErrorMessage = 'Unable to locate WO_MAT key in WO_LOG record.'
end
end end
end end
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
@ -1683,7 +1685,7 @@ Service SignVoidWMO(WMOutKeys, WONo, Username)
ErrorMessage = '' ErrorMessage = ''
WOLogRecord = Database_Services('ReadDataRow', 'WO_LOG', WONo, True$, 0, False$) WOLogRecord = Database_Services('ReadDataRow', 'WO_LOG', WONo, True$, 0, False$)
if Error_Services('NoError') then If Error_Services('NoError') then
for each WmOutKey in WMOutKeys using @VM for each WmOutKey in WMOutKeys using @VM
if WmOutKey NE '' then if WmOutKey NE '' then
WONo = Field(WmOutKey, '*', 1) WONo = Field(WmOutKey, '*', 1)
@ -1698,34 +1700,31 @@ Service SignVoidWMO(WMOutKeys, WONo, Username)
IsOnHold = Hold_Services('CheckForHold', WoMatKey) IsOnHold = Hold_Services('CheckForHold', WoMatKey)
If Not(IsOnHold) then If Not(IsOnHold) then
WM_Out_Services('SetVoidFlag', WmOutKey, Username) WM_Out_Services('SetVoidFlag', WmOutKey, Username)
If Error_Services('NoError') then If Error_Services('NoError') then
Work_Order_Services('CreateVoidedLotRecord', '', WmOutKey, 'WM_OUT', WoMatKey, Username)
If Error_Services('NoError') then If Error_Services('NoError') then
If Error_Services('NoError') then LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', WmOutKey, 'WM_OUT')
Lot_Event_Services('CreateLotEvent', WmOutKey, DateTime(), 'VOID', 'Lot voided by ' : Username, '', Username, True$, 'WM_OUT') // Create a LOT_EVENT record if this lot is in the new LOT system.
Work_Order_Services('CreateVoidedLotRecord', '', WmOutKey, 'WM_OUT', WoMatKey, Username) If LotId NE '' then
if Error_Services('NoError') then Lot_Event_Services('CreateLotEvent', WmOutKey, DateTime(), 'COMMENT', 'Lot voided by ' : Username, '', Username, True$, 'WM_OUT')
//Check if WMI is also voided. If it is, remove it from the WO_MAT_KEY field in WO_LOG, and void the WO_MAT record If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage')
WMIKey = WmOutKey; //the paired WMO key is the same as the WMIKey end
IsWMIVoided = Database_Services('ReadDataColumn', 'WM_IN', WMOKey, WM_IN_VOID$) If ErrorMessage EQ '' then
If IsWMIVoided then //Check if WMI is also voided. If it is, remove it from the WO_MAT_KEY field in WO_LOG, and void the WO_MAT record
Locate WoMatKey in WoLogRecord<WO_LOG_WO_MAT_KEY$> using @VM setting CassPos then WMIKey = WmOutKey; //the paired WMO key is the same as the WMIKey
WoLogRecord<WO_LOG_WO_MAT_KEY$> = Delete(WOLogRecord<WO_LOG_WO_MAT_KEY$>, 1, CassPos, 0) IsWMIVoided = Database_Services('ReadDataColumn', 'WM_IN', WMOKey, WM_IN_VOID$)
WO_Mat_Services('SetWoMatVoidFlag', WoMatKey, Username) If IsWMIVoided then
end else Locate WoMatKey in WoLogRecord<WO_LOG_WO_MAT_KEY$> using @VM setting CassPos then
ErrorMessage = 'Unable to locate WO_MAT key in WO_LOG record.' WoLogRecord<WO_LOG_WO_MAT_KEY$> = Delete(WOLogRecord<WO_LOG_WO_MAT_KEY$>, 1, CassPos, 0)
end WO_Mat_Services('SetWoMatVoidFlag', WoMatKey, Username)
end end else
end else ErrorMessage = 'Unable to locate WO_MAT key in WO_LOG record.'
ErrorMessage = Error_Services('GetMessage') end
end end
end else
ErrorMessage = Error_Services('GetMessage')
end end
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
@ -2326,4 +2325,3 @@ ClearCursors:
return return