Skip to main content

Receipt statuses and transitions

This page lists the statuses of a receipt, what moves it from one to the next, and the values of Completion. The rules live in crates/libs/wms-inbound/src/service/receipt/state_machine.rs.

Statuses​

StatusLabel in the listMeaning
OpenOpenThe receipt exists. Nothing is received yet.
InProgressIn progressAt least one receive was made.
OnHoldOn holdWork is stopped.
ClosedClosedReceiving is finished. Final.
CancelledCancelledThe receipt was dropped. Final.

Lines use the same five statuses (the Status field of the line card).

Transitions​

FromActionToPage
OpenFirst receiveInProgressReceiving a line
Open, InProgressPut on HoldOnHoldPutting a receipt on hold
OnHoldRelease HoldOpen if Completion is Pending, else InProgressReleasing a receipt from hold
Open, InProgress, OnHoldClose ReceiptClosedClosing a receipt
Open, InProgress, OnHoldCancel ReceiptCancelledCancelling a receipt
Closed, CancelledNothingNothing

Closing a closed receipt, cancelling a cancelled receipt and holding a held one are handled as follows: close and cancel repeat with no change and no error; hold is refused (aggregate.rs:144-145,206-207).

Source of the table: state_machine.rs:134-138 and crates/libs/wms-inbound/src/domain/receipt/aggregate.rs:281-299. The state machine table says InProgress for a release. The aggregate decides, and sends an untouched receipt back to Open. The table in the code records this in its comment (state_machine.rs:107-118).

What each status allows​

OperationOpenInProgressOnHoldClosedCancelled
Receive, blind receive, returnYesYesNoNoNo
Adjust received quantityYesYesNoNoNo
Report damageYesYesNoNoNo
Put on holdYesYesNoNoNo
Release from holdNoNoYesNoNo
CloseYesYesYesNo changeNo
CancelYesYesYesNoNo change
Add or delete a lineYesYesNoNoNo
Edit header and line dataYesYesYesNoNo

Source: state_machine.rs:63-86 for the operations; planning/contracts.rs:60,327-342 for the line and header edits. Blind receive is allowed only in Open (state_machine.rs, list for Open). Cancel also needs every line Pending.

Not confirmed by code: that the edit of header and line data is open in OnHold. The code refuses only Closed and Cancelled for header edits (page Header tab). To verify: hold a receipt and change Door.

Completion values​

Completion says how much of the plan has arrived. The system calculates it. Nobody types it.

Value in codeLabelMeaning
PendingNothing receivedNothing arrived.
PartialPartially receivedSome arrived, less than expected.
FullFully receivedArrived equals expected.
OverOver receiptMore arrived than expected.

How a line is classified (crates/libs/wms-inbound/src/repo/completion_compute.rs:39-49): arrived quantity (received, rejected and damaged together) of 0 or less is Pending; equal to expected is Full; less is Partial; more is Over. How the header is derived (completion_compute.rs:56-83): all lines Pending gives Pending; else any Over gives Over; else all Full gives Full; else Partial. A receipt with no lines is Pending.

Completion changes what you can do:

  • Cancel Receipt needs Pending on the receipt and on every line.
  • Close Receipt needs a supervisor when there is a discrepancy. See Closing a receipt.