refactored auto hold service and toggle hold service

This commit is contained in:
Infineon\StieberD
2025-01-22 15:42:27 -07:00
parent 2332b04103
commit 9d86fd5fba
2 changed files with 199 additions and 90 deletions

View File

@ -78,7 +78,7 @@ Return Response or ""
// WOMatKey - [Required]
// HoldEntity - [Required]
// HoldEntityID - [Required]
// CtrlEntID - [Required]
// CtrlEntID - [Optional] *Required for ship hold checks
// OriginFlag - [Optional]
// HoldData - [Optional]
// OperatorID - [Optional]
@ -87,15 +87,15 @@ Return Response or ""
//----------------------------------------------------------------------------------------------------------------------
Service ToggleHold(WOMatKey, HoldEntity, HoldEntityID, CtrlEntID, OriginFlag, HoldData, OperatorID)
IF WOMatKey = '' or HoldEntity = '' or HoldEntityID = '' or CtrlEntID = '' THEN
Error_Services('Add', 'Null parameter WOMatKey, HoldEntity, HoldEntityID, CtrlEntID passed to service.')
If ( (WOMatKey EQ '') or (HoldEntity EQ '') or (HoldEntityID EQ '') ) then
Error_Services('Add', 'Null parameter WOMatKey, HoldEntity, or HoldEntityID passed to service.')
end else
HoldCheck = Hold_Services("CheckForHold", WOMatKey, CtrlEntID)
If Unassigned(OperatorID) then OperatorID = ''
BEGIN CASE
CASE INDEX(CtrlEntID,'SHIP_HOLD',1) ; HoldType = 'SHOLD' ; * Ship Hold
CASE 1 ; HoldType = 'HOLD' ; * Production or Engineering Hold
END CASE
Begin Case
Case Index(CtrlEntID,'SHIP_HOLD',1) ; HoldType = 'SHOLD' ; * Ship Hold
Case Otherwise$ ; HoldType = 'HOLD' ; * Production or Engineering Hold
End Case
If Error_Services("NoError") then
If HoldCheck = False$ then
Hold_Services("OnHold", WOMatKey, HoldEntity, HoldEntityID, HoldType, HoldData, OperatorID, OriginFlag)
@ -502,8 +502,8 @@ Service CheckForHold(WOMatKey, CtrlEntID)
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey, '', '', '')
BEGIN CASE
CASE INDEX(CtrlEntID,'SHIP_HOLD',1) ; HoldType = 'SHOLD' ; * Ship Hold
CASE 1 ; HoldType = 'HOLD' ; * Production or Engineering Hold
CASE Index(CtrlEntID,'SHIP_HOLD',1) ; HoldType = 'SHOLD' ; * Ship Hold
CASE Otherwise$ ; HoldType = 'HOLD' ; * Production or Engineering Hold
END CASE
IF HoldType = 'SHOLD' THEN
@ -765,3 +765,4 @@ Service CreateComment(HoldEntity, HoldEntityID, Reason, Transition, HoldType, Op
end service