Skip to main content

Order closure

What this shows. What shipment_order_close checks and writes, and why today it closes only an order whose lines were all cancelled.

There is no Close button. Closing is an API method for Admin and Manager.

Why only cancelled orders close today​

A line is Cancelled when ordered minus cancelled minus shipped is zero. In practice that comes from cancelling quantity with Cancel Qty. Nothing in the code writes qty_shipped: the shipping area is a placeholder. So the way to a closed order is to cancel every line, not to ship it. After the close, every line reads Closed.

close_summary holds the number of lines, the ordered, cancelled and shipped quantities, and the user who closed.

Packing does not change this. A packed job does not change the order status, and Picked stays Picked after packing.

Where it comes from​

ClaimSource
Close is a stateful command for Admin and Managercrates/services/app-server/src/web/rpcs/shipment_order_commands_rpc.rs:52
Versioned on the ordercrates/services/app-server/src/web/rpcs/shipment_order_commands_rpc.rs:158
The command locks, closes and savescrates/libs/wms-outbound/src/service/order/close.rs:81
Rule: not final, released, every line terminalcrates/libs/wms-outbound/src/domain/shipment_order/aggregate.rs:246
Lines still open refuse the closecrates/libs/wms-outbound/src/domain/shipment_order/aggregate.rs:256
Every line reads Closed after the closecrates/libs/wms-outbound/src/domain/shipment_order/status_derive.rs:51
Cancelled when nothing is left to shipcrates/libs/wms-outbound/src/domain/shipment_order/status_derive.rs:54
Nothing writes qty_shippedcrates/libs/wms-lib-core/src/model/outbound/shipment_order_line.rs:154
Event namecrates/libs/wms-lib-core/src/model/integration/event_payloads/order.rs:107
Shipping area is a placeholdercrates/libs/wms-outbound/src/shipping/README.md:3