Added calls to verify indexes and update indexes right after receiving and releasing material. Refactored codebase to adjust work order quantities instead of recalculate quantities.

Removing reliance on transaction queue for receive and releaase

Added unlock call in case write fails
This commit is contained in:
Infineon\StieberD
2025-09-30 13:45:55 -07:00
parent a2f61d11c9
commit beaac0d38a
17 changed files with 1272 additions and 778 deletions

View File

@ -44,16 +44,17 @@ Function WO_MAT_Actions(Action, CalcColName, FSList, Handle, Name, FMC, Record,
***********************************************************************************************************************/
$insert APP_INSERTS
$insert FILE.SYSTEM.EQUATES
$insert DICT_EQUATES
$insert ACTION_SETUP
$insert WO_MAT_EQUATES
$insert WO_LOG_EQUATES
$insert WO_STEP_EQUATES
$insert MAKEUP_WAFERS_EQUATES
$insert RLIST_EQUATES
$insert IFX_EQUATES
$Insert APP_INSERTS
$Insert FILE.SYSTEM.EQUATES
$Insert DICT_EQUATES
$Insert ACTION_SETUP
$Insert WO_MAT_EQUATES
$Insert WO_LOG_EQUATES
$Insert WO_STEP_EQUATES
$Insert MAKEUP_WAFERS_EQUATES
$Insert WM_OUT_EQUATES
$Insert RLIST_EQUATES
$Insert IFX_EQUATES
Equ Comma$ to ','
@ -610,13 +611,17 @@ WRITE_RECORD:
CassNo = Field(Name, '*', 2)
WOMatKeyID = Name
OrigWfrQty = OrigRecord<WO_MAT_WAFER_QTY$>
NewWfrQty = Record<WO_MAT_WAFER_QTY$>
OrigRelDtm = OrigRecord<WO_MAT_REL_DTM$>
NewRelDtm = Record<WO_MAT_REL_DTM$>
OrigRecDtm = OrigRecord<WO_MAT_RX_DTM$>
NewRecDtm = Record<WO_MAT_RX_DTM$>
AdjustQty = NewWfrQty - OrigWfrQty
OrigWfrQty = OrigRecord<WO_MAT_WAFER_QTY$>
NewWfrQty = Record<WO_MAT_WAFER_QTY$>
OrigRelDtm = OrigRecord<WO_MAT_REL_DTM$>
NewRelDtm = Record<WO_MAT_REL_DTM$>
OrigRecDtm = OrigRecord<WO_MAT_RX_DTM$>
NewRecDtm = Record<WO_MAT_RX_DTM$>
OrigVoidFlag = OrigRecord<WO_MAT_VOID$>
NewVoidFlag = Record<WO_MAT_VOID$>
OrigShipNo = OrigRecord<WO_MAT_SHIP_NO$>
NewShipNo = Record<WO_MAT_SHIP_NO$>
AdjustQty = NewWfrQty - OrigWfrQty
If ( (OrigWfrQty NE '' ) and (OrigWfrQty NE NewWfrQty) and (OrigRecDtm NE '' and NewRecDtm NE '') ) then
// Cassette already received, but casssette quantity has changed.
@ -624,7 +629,7 @@ WRITE_RECORD:
end
If ( (OrigRecDtm EQ '') and (NewRecDtm NE '') ) then
// Cassette was just received. Increment received quantity of work order by the entire cassette wafer count.
Work_Order_Services('AdjustReceivedQty', WONo, NewWfrQty)
If NewWfrQty NE 0 then Work_Order_Services('AdjustReceivedQty', WONo, NewWfrQty)
end
If ( (OrigWfrQty NE '') and (OrigWfrQty NE NewWfrQty) and ( (OrigRelDtm NE '') and (NewRelDtm NE '') ) ) then
@ -633,7 +638,47 @@ WRITE_RECORD:
end
If ( (OrigRelDtm EQ '') and (NewRelDtm NE '') ) then
// Cassette was just released. Increment released quantity of work order by the entire cassette wafer count.
Work_Order_Services('AdjustReleasedQty', WONo, NewWfrQty)
If NewWfrQty NE 0 then Work_Order_Services('AdjustReleasedQty', WONo, NewWfrQty)
end
If ( (OrigVoidFlag NE True$) and (NewVoidFlag EQ True$) ) then
If (NewWfrQty NE 0) then
If (NewRecDtm NE '') then Work_Order_Services('AdjustReceivedQty', WONo, Neg(NewWfrQty))
If (NewRelDtm NE '') then Work_Order_Services('AdjustReleasedQty', WONo, Neg(NewWfrQty))
end
end
If ( (NewVoidFlag NE True$) and (OrigVoidFlag EQ True$) ) then
If (NewWfrQty NE 0) then
If (NewRecDtm NE '') then Work_Order_Services('AdjustReceivedQty', WONo, NewWfrQty)
If (NewRelDtm NE '') then Work_Order_Services('AdjustReleasedQty', WONo, NewWfrQty)
end
end
If ( (OrigShipNo EQ '') and (NewShipNo NE '') ) then
ShipQty = 0
WMOKey = Record<WO_MAT_WMO_KEY$>
If (WMOKey NE '') then
CurrWfrCnt = Xlate('WM_OUT', WMOKey, 'WAFER_CNT', 'X')
ShipQty += CurrWfrCnt
end else
CurrWfrCnt = obj_WO_Mat('CurrWaferCnt',WOMatKeyID:@RM:Record)
ShipQty += CurrWfrCnt
end
If ShipQty NE 0 then Work_Order_Services('AdjustShippedQty', WONo, ShipQty)
end
If ( (NewShipNo EQ '') and (OrigShipNo NE '') ) then
ShipQty = 0
WMOKey = Record<WO_MAT_WMO_KEY$>
If (WMOKey NE '') then
CurrWfrCnt = Xlate('WM_OUT', WMOKey, 'WAFER_CNT', 'X')
ShipQty += CurrWfrCnt
end else
CurrWfrCnt = obj_WO_Mat('CurrWaferCnt',WOMatKeyID:@RM:Record)
ShipQty += CurrWfrCnt
end
If (ShipQty NE 0) then Work_Order_Services('AdjustShippedQty', WONo, Neg(ShipQty))
end
If {REACTOR_TYPE} NE 'EPP' then
@ -889,6 +934,35 @@ return
DELETE_RECORD:
debug
WOMatKeyID = Name
WONo = Field(WOMatKeyID, '*', 1, 1)
OrigWfrQty = OrigRecord<WO_MAT_WAFER_QTY$>
OrigVoidFlag = OrigRecord<WO_MAT_VOID$>
OrigShipNo = OrigRecord<WO_MAT_SHIP_NO$>
OrigRelDtm = OrigRecord<WO_MAT_REL_DTM$>
OrigRecDtm = OrigRecord<WO_MAT_RX_DTM$>
If (OrigVoidFlag NE True$) then
If (OrigWfrQty NE 0) then
If (OrigRecDtm NE '') then Work_Order_Services('AdjustReceivedQty', WONo, Neg(OrigWfrQty))
If (OrigRelDtm NE '') then Work_Order_Services('AdjustReleasedQty', WONo, Neg(OrigWfrQty))
end
end
If (OrigShipNo NE '') then
ShipQty = 0
WMOKey = OrigRecord<WO_MAT_WMO_KEY$>
If (WMOKey NE '') then
CurrWfrCnt = Xlate('WM_OUT', WMOKey, 'WAFER_CNT', 'X')
ShipQty += CurrWfrCnt
end else
CurrWfrCnt = obj_WO_Mat('CurrWaferCnt',WOMatKeyID:@RM:OrigRecord)
ShipQty += CurrWfrCnt
end
If (ShipQty NE 0) then Work_Order_Services('AdjustShippedQty', WONo, Neg(ShipQty))
end
return