From 924a20826433b0b0e0fae777da464b87be3ba4e2 Mon Sep 17 00:00:00 2001 From: Chase Tucker Date: Thu, 20 Feb 2025 08:13:44 -0700 Subject: [PATCH] Get new COC when re-shipping --- LSL2/STPROC/OBJ_RDS.txt | 8 +++++++- LSL2/STPROC/OBJ_SHIPMENT.txt | 22 ++++++++++++++++------ LSL2/STPROC/OBJ_WM_OUT.txt | 7 ++++++- LSL2/STPROC/OBJ_WO_MAT.txt | 8 +++++++- 4 files changed, 36 insertions(+), 9 deletions(-) diff --git a/LSL2/STPROC/OBJ_RDS.txt b/LSL2/STPROC/OBJ_RDS.txt index a752ea7..bb4a71e 100644 --- a/LSL2/STPROC/OBJ_RDS.txt +++ b/LSL2/STPROC/OBJ_RDS.txt @@ -1076,6 +1076,11 @@ AddShip: RdsNo = Parms[COL2()+1,@RM] ShipDt = Parms[COL2()+1,@RM] ShipTm = Parms[COL2()+1,@RM] + Reship = Parms[COL2()+1,@RM] + + If Reship EQ '' then + Reship = False$ + end IF NOT(ASSIGNED(RdsNo)) THEN ErrorMsg = 'Unassigned Parm "RdsNo" passed to routine. (':Method:')' IF NOT(ASSIGNED(ShipNo)) THEN ErrorMsg = 'Unassigned Parm "ShipNo" passed to routine. (':Method:')' @@ -1108,7 +1113,7 @@ AddShip: IF Get_Status(errCode) THEN RETURN ;* Problems getting the lock - IF RDSRec = '' OR RDSRec = ShipNo THEN + IF RDSRec = '' OR RDSRec = ShipNo or Reship EQ True$ THEN RDSRec = ShipNo RDSRec = thisShipDt RDSRec = thisShipTm @@ -1473,3 +1478,4 @@ CalcThickTarget: RETURN + diff --git a/LSL2/STPROC/OBJ_SHIPMENT.txt b/LSL2/STPROC/OBJ_SHIPMENT.txt index a031c56..acfeccc 100644 --- a/LSL2/STPROC/OBJ_SHIPMENT.txt +++ b/LSL2/STPROC/OBJ_SHIPMENT.txt @@ -316,11 +316,21 @@ SAPCreate: END Retransmit = False$ + Reship = False$ If ShipNo EQ '' then ShipNo = NextKey('COC') end else - Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : 'Prior shipment number found', @RM, @FM, '') - Retransmit = True$ + OrigShipRec = Database_Services('ReadDataRow', 'COC', ShipNo) + If OrigShipRec NE '' then + OrigSAPDeliveryNo = OrigShipRec + If OrigSAPDeliveryNo _EQC SAPDeliveryNo then + Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : 'Prior shipment number found', @RM, @FM, '') + Retransmit = True$ + end else + ShipNo = NextKey('COC') + Reship = True$ + end + end end //--------------------------------------------------------------------------------------------------- @@ -332,7 +342,6 @@ SAPCreate: ShipRec = '' If Retransmit EQ True$ then // Do not overwrite the original ship date if we are simply retransmitting the COC file. - OrigShipRec = Database_Services('ReadDataRow', 'COC', ShipNo) OrigShipDt = OrigShipRec OrigEntryDt = OrigShipRec If OrigShipDt NE '' then @@ -373,17 +382,17 @@ SAPCreate: ShipRec = ShipRDS ShipRec = ShipWOStep - obj_WO_Mat('AddShip',WONo:'*':CassNo:@RM:ShipNo) ;* Adds ShipNo to WO_MAT record + obj_WO_Mat('AddShip',WONo:'*':CassNo:@RM:ShipNo:@RM:Reship) ;* Adds ShipNo to WO_MAT record wmlWONos<1,N> = WONo wmlCassNos<1,N> = CassNo IF ReactType = 'P' OR ReactType = 'EPP' THEN WMOutKey = XLATE('WO_MAT',WONo:'*':CassNo,WO_MAT_WMO_KEY$,'X') - obj_WM_Out('AddShip',WMOutKey:@RM:ShipNo) + obj_WM_Out('AddShip',WMOutKey:@RM:ShipNo:@RM:Reship) wmlCassIDs<1,N> = 'O':WONo:'.':ShipWOStep:'.':CassNo END ELSE - obj_RDS('AddShip', ShipNo : @RM : ShipRDS : @RM : Oconv(ShipRec, 'D4/') : @RM : Oconv(Time(), 'MTH')) ; // Adds ship data to the RDS row. dmb 01/02/2018 + obj_RDS('AddShip', ShipNo : @RM : ShipRDS : @RM : Oconv(ShipRec, 'D4/') : @RM : Oconv(Time(), 'MTH'):@RM:Reship) ; // Adds ship data to the RDS row. dmb 01/02/2018 wmlCassIDs<1,N> = ShipRDS END @@ -2226,3 +2235,4 @@ RETURN + diff --git a/LSL2/STPROC/OBJ_WM_OUT.txt b/LSL2/STPROC/OBJ_WM_OUT.txt index 4d895f4..28bd7fb 100644 --- a/LSL2/STPROC/OBJ_WM_OUT.txt +++ b/LSL2/STPROC/OBJ_WM_OUT.txt @@ -958,6 +958,11 @@ AddShip: WMOutKey = Parms[1,@RM] ShipNo = Parms[COL2()+1,@RM] + Reship = Parms[COL2()+1,@RM] + + If Reship EQ '' then + Reship = False$ + end IF NOT(ASSIGNED(WMOutKey)) THEN ErrorMsg = 'Unassigned Parm "WMOutKey" passed to routine. (':Method:')' IF NOT(ASSIGNED(ShipNo)) THEN ErrorMsg = 'Unassigned Parm "ShipNo" passed to routine. (':Method:')' @@ -974,7 +979,7 @@ AddShip: IF Get_Status(errCode) THEN RETURN ;* Problems getting the lock - IF WMOutRec = '' OR WMOutRec = ShipNo THEN + IF WMOutRec = '' OR WMOutRec = ShipNo or Reship EQ True$ THEN WMOutRec = ShipNo diff --git a/LSL2/STPROC/OBJ_WO_MAT.txt b/LSL2/STPROC/OBJ_WO_MAT.txt index 772a70a..50d46ea 100644 --- a/LSL2/STPROC/OBJ_WO_MAT.txt +++ b/LSL2/STPROC/OBJ_WO_MAT.txt @@ -3973,6 +3973,11 @@ AddShip: WOMatKey = Parms[1,@RM] ShipNo = Parms[COL2()+1,@RM] + Reship = Parms[COL2()+1,@RM] + + If Reship EQ '' then + Reship = False$ + end IF NOT(ASSIGNED(WOMatKey)) THEN ErrorMsg = 'Unassigned Parm "WOMatKey" passed to routine. (':Method:')' IF NOT(ASSIGNED(ShipNo)) THEN ErrorMsg = 'Unassigned Parm "ShipNo" passed to routine. (':Method:')' @@ -3989,7 +3994,7 @@ AddShip: IF Get_Status(errCode) THEN RETURN ;* Problems getting the lock - IF WOMatRec = '' THEN + IF WOMatRec = '' or Reship EQ True$ THEN WOMatRec = ShipNo END ELSE END @@ -5598,3 +5603,4 @@ ExpCOA: RETURN +