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 -