Skip to content

Commit 301e662

Browse files
authored
Merge pull request #3530 from msupply-foundation/3525-Outbound-shipment-status-is-automatically-switching-back-to-New-in-case-of-stock-transfer-(to-desktop-store)
3525 Outbound shipment status is automatically switching back to New in case of stock-transfer (to desktop-store)
2 parents eff41f8 + af1c4c7 commit 301e662

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

server/service/src/processors/transfer/shipment/update_outbound_shipment_status.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ impl ShipmentTransferProcessor for UpdateOutboundShipmentStatusProcessor {
2626
/// 3. Linked shipment exists (the outbound shipment)
2727
/// 4. Linked outbound shipment status is not Verified (this is the last status possible)
2828
/// 5. Linked outbound shipment status is not source inbound shipment status
29+
/// 6. Source shipment is from mSupply thus the status will be `New`. Shouldn't happen for OMS since
30+
/// OMS will follow OMS status sequence
2931
///
3032
/// Can only run two times (one for Delivered and one for Verified status):
31-
/// 6. Because linked outbound shipment status will be updated to source inbound shipment status and `5.` will never be true again
33+
/// 7. Because linked outbound shipment status will be updated to source inbound shipment status and `5.` will never be true again
3234
/// and business rules guarantee that Inbound shipment can only change status to Delivered and Verified
3335
/// and status cannot be changed backwards
3436
fn try_process_record(
@@ -62,10 +64,14 @@ impl ShipmentTransferProcessor for UpdateOutboundShipmentStatusProcessor {
6264
if outbound_shipment.invoice_row.status == inbound_shipment.invoice_row.status {
6365
return Ok(None);
6466
}
67+
// 6.
68+
if inbound_shipment.invoice_row.status == InvoiceRowStatus::New {
69+
return Ok(None);
70+
}
6571

6672
// Execute
6773
let updated_outbound_shipment = InvoiceRow {
68-
// 6.
74+
// 7.
6975
status: inbound_shipment.invoice_row.status.clone(),
7076
delivered_datetime: inbound_shipment.invoice_row.delivered_datetime.clone(),
7177
verified_datetime: inbound_shipment.invoice_row.verified_datetime.clone(),

0 commit comments

Comments
 (0)