Merged PR 11767: NCR hold removal prompt

This commit is contained in:
Mitchem Dakota (CSC FI SPS MESLEO External)
2025-02-27 20:50:52 +01:00
committed by Stieber Daniel (CSC FI SPS MESLEO)
parent 87d79edef8
commit 779ed0ba29
7 changed files with 3615 additions and 139 deletions

View File

@ -10,6 +10,7 @@ COMPILE FUNCTION Comm_WO_Mat_Wfr(Instruction, Parm1,Parm2)
01/04/2019 - djs - Fixed an issue within the "Refresh" subroutine, which was preventing the "SLOT_NO" edit table
from being colored correctly. The coloring code was moved to be executed after the section of
code responsible for coloring edit tables with symbolic fields.
02/27/2025 - DJM - Added prompt to remove hold when creating NCR in 'RejMat'
*/
DECLARE SUBROUTINE Set_Property, Set_Status, ErrMsg, Set_Property, obj_AppWindow, Send_Message, Logging_Services
@ -379,15 +380,39 @@ RejMat:
CassNo = Get_Property(@Window:'.CASS_NO', 'TEXT')
WOMatKey = WONo:'*':CassNo
OnHold = Xlate('WO_MAT', WOMatKey, 'HOLD', 'X')
If OnHold NE True$ then
Result = ''
SlotList = Get_Property('WO_MAT_WFR.SLOT_NO','LIST')
SlotSelection = Get_Property('WO_MAT_WFR.SLOT_NO','SELPOS')
SelectedRows = SlotSelection<2>
CONVERT @VM TO @FM in SelectedRows
SelCnt = DCount(SelectedRows, @FM)
IF SelCnt = 0 THEN
ErrMsg('You must select at least one row in order to create an NCR.')
RETURN
END
GoSub FQAVerify
If Not(Authorized) then Return 0
If OnHold EQ True$ then
Result = Dialog_Box('NDW_HOLD_REMOVAL_PROMPT',@WINDOW,'WO_MAT':@VM:WOMatKey:@VM:WOMatKey)
If Result NE True$ then
Return 0
end else
Send_Event(@Window, 'READ')
end
end
If (OnHold NE True$) OR (Result = True$) then
OffHoldDTMs = Xlate('WO_MAT', WOMatKey, 'HOLD_STOP_DTM', 'X')
SAPBatchNo = Xlate('WO_MAT', WOMatKey, WO_MAT_SAP_BATCH_NO$, 'X')
If OffHoldDTMs NE '' then
// Ensure at least a minute has elapsed since the cassette was last taken off hold.
LastDTM = OffHoldDTMs[-1, 'B':@VM]
TimeElapsed = Datetime() - LastDTM
// .000694 is the equivalent to 60 seconds in datetime format
If TimeElapsed LT '.000694' then
If (TimeElapsed LT '.000694') AND (SAPBatchNo NE '') then
Def = ""
Def<MTEXT$> = "Please wait for SAP to process off hold transaction..."
Def<MTYPE$> = "U"
@ -400,19 +425,9 @@ RejMat:
end
end
GoSub FQAVerify
If Not(Authorized) then Return 0
SlotList = Get_Property('WO_MAT_WFR.SLOT_NO','LIST')
SlotSelection = Get_Property('WO_MAT_WFR.SLOT_NO','SELPOS')
SelectedRows = SlotSelection<2>
CONVERT @VM TO @FM in SelectedRows
SelCnt = DCount(SelectedRows, @FM)
IF SelCnt = 0 THEN
ErrMsg('You must select at least one row in order to create an NCR.')
RETURN
END
IneligibleSlots = ''
AllSlotsPermitted = True$ ; // Assume that all slots are permitted to be NCR'd for now.
@ -555,11 +570,7 @@ RejMat:
rv = Dialog_Box('NCR', @WINDOW, NCRNo)
Send_Event(@WINDOW, 'READ')
end
end else
// Cassette is on hold so material cannot be rejected.
ErrorMessage = 'Create NCR denied!. The cassette must be taken off hold before rejecting material.'
Msg(@Window, '', 'OK', '', 'Error':@FM:ErrorMessage)
end
end
RETURN
@ -1204,3 +1215,4 @@ LogRecord:
return