diff --git a/pkg/handlers/ghcapi/mto_shipment.go b/pkg/handlers/ghcapi/mto_shipment.go index ce6329def35..1e08e2027b2 100644 --- a/pkg/handlers/ghcapi/mto_shipment.go +++ b/pkg/handlers/ghcapi/mto_shipment.go @@ -215,6 +215,11 @@ func (h CreateMTOShipmentHandler) Handle(params mtoshipmentops.CreateMTOShipment mtoShipment := payloads.MTOShipmentModelFromCreate(payload) + if mtoShipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTSDom && mtoShipment.NTSRecordedWeight != nil { + previouslyRecordedWeight := *mtoShipment.NTSRecordedWeight + mtoShipment.PrimeEstimatedWeight = &previouslyRecordedWeight + } + var err error mtoShipment, err = h.shipmentCreator.CreateShipment(appCtx, mtoShipment) @@ -338,6 +343,12 @@ func (h UpdateShipmentHandler) Handle(params mtoshipmentops.UpdateMTOShipmentPar ), err } } + + if mtoShipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTSDom && mtoShipment.NTSRecordedWeight != nil { + previouslyRecordedWeight := *mtoShipment.NTSRecordedWeight + mtoShipment.PrimeEstimatedWeight = &previouslyRecordedWeight + } + updatedMtoShipment, err := h.ShipmentUpdater.UpdateShipment(appCtx, mtoShipment, params.IfMatch, "ghc") if err != nil { return handleError(err) diff --git a/pkg/services/mto_shipment/shipment_billable_weight.go b/pkg/services/mto_shipment/shipment_billable_weight.go index 4466ab38cc4..1b6046ed967 100644 --- a/pkg/services/mto_shipment/shipment_billable_weight.go +++ b/pkg/services/mto_shipment/shipment_billable_weight.go @@ -65,7 +65,7 @@ func (f *shipmentBillableWeightCalculator) CalculateShipmentBillableWeight(shipm if shipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTSDom && shipment.NTSRecordedWeight != nil { adjustedRecordedWeight := unit.Pound(shipment.NTSRecordedWeight.Float64() * float64(1.1)) if adjustedRecordedWeight < *shipment.PrimeActualWeight { - calculatedWeight = shipment.NTSRecordedWeight + calculatedWeight = &adjustedRecordedWeight } } }