From ce252bf885253e5a2a83366c479ce1c487d5a966 Mon Sep 17 00:00:00 2001 From: "Infineon\\StieberD" Date: Tue, 8 Jul 2025 11:08:54 -0700 Subject: [PATCH] added additional checks in WO_LOG WRITE_PRE action to only set the closes date and closed status if the work order is not already closed --- LSL2/STPROC/WO_LOG_ACTIONS.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/LSL2/STPROC/WO_LOG_ACTIONS.txt b/LSL2/STPROC/WO_LOG_ACTIONS.txt index 40cf0c3..79f3056 100644 --- a/LSL2/STPROC/WO_LOG_ACTIONS.txt +++ b/LSL2/STPROC/WO_LOG_ACTIONS.txt @@ -222,14 +222,17 @@ WRITE_RECORD_PRE: Record = RXQty SaveRecord = Record end - - EntryDate = Record - Today = Date() - YearsOpen = SRP_Date('YearSpan', EntryDate, Today, True$) - ScrapQty = Record - ShipQty = Record - If ( ( (ScrapQty + ShipQty) GE NewQty ) or (YearsOpen GE 3) ) then + + EntryDate = Record + Today = Date() + YearsOpen = SRP_Date('YearSpan', EntryDate, Today, True$) + ScrapQty = Record + ShipQty = Record + CurrStatus = Record + CloseDate = Record + If ( ( (CurrStatus NE 'CL') or (CloseDate EQ '') ) and ( ( (ScrapQty + ShipQty) GE NewQty ) or (YearsOpen GE 3) ) ) then // Auto-close the work order + Record = Date() Record = 'CL' SaveRecord = Record end @@ -545,4 +548,3 @@ ClearCursors: Next counter return -