refactored auto hold service and toggle hold service
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user