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

@ -2,7 +2,9 @@ Compile function WO_MAT_Services(@Service, @Params)
#pragma precomp SRP_PreCompiler
Declare function Database_Services, Error_Services, SRP_Json, SRP_Com, Environment_Services, Logging_Services
Declare function Datetime
Declare subroutine Error_Services, SRP_Json, SRP_Com, Wo_Mat_Services, Database_Services, Logging_Services
Declare subroutine obj_wo_mat_log, Set_Status
$insert LOGICAL
$Insert APP_INSERTS
@ -424,3 +426,50 @@ Service CassetteIsLastInWo(WoMatKey)
Response = IsLastInWo
end service
Service SetWoMatVoidFlag(WoMatKey, Username)
ErrorMessage = ''
If RowExists('WO_MAT', WoMatKey) then
WoMatRec = Database_Services('ReadDataRow', 'WO_MAT', WoMatKey, True$, 0, False$)
If Error_Services('NoError') then
WoMatRec<WO_MAT_VOID$> = True$
HaveLock = Database_Services('GetKeyIDLock', 'WO_MAT', WoMatKey, True$)
If HaveLock then
Database_Services('WriteDataRow', 'WO_MAT', WoMatKey, WoMatRec, True$, False, False$)
If Error_Services('NoError') then
Set_Status(0)
WONo = Field(WoMatKey, '*', 1)
CassNo = Field(WoMatKey, '*', 2)
WOMLParms = ''
LogFile = 'WO_MAT' ; WOMLParms = LogFile:@RM
LogDTM = OConv(Datetime(), 'DT') ; WOMLParms := LogDTM:@RM
Action = '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 WO_MAT record ' : WoMatKey : ' while attempting to set void status.'
end
end else
ErrorMessage = 'Failed to get lock on WO_MAT record ' : WoMatKey : ' while attempting to set void status.'
end
end else
ErrorMessage = 'Failed to read WO_MAT record ' : WoMatKey : ' while attempting to set void status.'
end
end else
ErrorMessage = 'Invalid WoMat Key ' : WoMatKey : ' passed to SetWoMatVoidFlag routine.'
end
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
end service