Merged PR 13813: Lot void routines enhancement

Lot void routines enhancement

Related work items: #110807
This commit is contained in:
Ouellette Jonathan (CSC FI SPS MESLEO)
2025-03-27 18:51:25 +01:00
parent 507c6bffba
commit b76db6bc72
22 changed files with 3950 additions and 2447 deletions

View File

@ -55,7 +55,7 @@ $Insert WM_IN_EQUATES
Declare function Database_Services
Declare function PSN_Services, SRP_Rotate_Array, Datetime
Declare subroutine Database_Services,
Declare subroutine Database_Services, Set_Status, OBJ_WO_MAT_LOG
GoToService
@ -121,3 +121,46 @@ Service AddComment(WMInNo, Comment)
End Service
Service SetVoidFlag(WMInKey, Username)
ErrorMessage = ''
If RowExists('WM_IN', WMInKey) then
WMInRec = Database_Services('ReadDataRow', 'WM_IN', WMInKey, True$, 0, False$)
If Error_Services('NoError') then
WMInRec<WM_IN_VOID$> = True$
Database_Services('WriteDataRow', 'WM_IN', WMInKey, WMInRec, True$, False, False$)
If Error_Services('NoError') then
Set_Status(0)
WONo = Field(WMInKey, '*', 1)
CassNo = Field(WMInKey, '*', 3)
WOMLParms = ''
LogFile = 'WO_MAT' ; WOMLParms = LogFile:@RM
LogDTM = OConv(Datetime(), 'DT') ; WOMLParms := LogDTM:@RM
Action = 'WM_IN_VOID' ; WOMLParms := Action:@RM
WhCd = 'CR' ; WOMLParms := WhCd:@RM
LocCd = 'VOID' ; WOMLParms := LocCd:@RM
WONos = WONo ; WOMLParms := WONos:@RM
CassNos = CassNo ; WOMLParms := CassNos:@RM
UserID = Username ; WOMLParms := UserID:@RM
Tags = '' ; WOMLParms := Tags:@RM
ToolID = '' ; WOMLParms := ToolID:@RM
WOMLParms := ''
obj_WO_Mat_Log('Create',WOMLParms)
IF Get_Status(errCode) THEN
ErrorMessage = 'Error writing inventory transactions'
end
end else
ErrorMessage = 'Failed to write to the WM_IN record ' : WMInKey : ' while attempting to set void status.'
end
end else
ErrorMessage = 'Failed to read WM_IN record ' : WMInKey : ' while attempting to set void status.'
end
end else
ErrorMessage = 'Invalid WM_IN Key ' : WMInKey : ' passed to SetVoidFlag routine.'
end
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
end service