Cancelling a receipt
Use this page when the goods will not come and nothing was received. Cancelling is final.
Before you start
- Select one receipt. The status is
Open,InProgressorOnHold, and the completion isPending(nothing received). - Every line of the receipt has completion
Pending. One received line stops the cancel (code 72). - You have the web action
receipt_canceland the API rightreceipt_cancel. By default onlyADMINandMANAGERhave them. See Who can do what.
Steps
- Open
Inbound > Receipts. - Tick one receipt.
- Click
Cancel Receipt. The windowCancel Receiptopens. It saysCancelling a receipt is final and cascades to every line that is not already closed. - Type a
Reason. The hint saysRecorded in the cancel summary and sent to the ERP. Required. - Click
Cancel Receiptin the window. ClickKeep Receiptto leave without cancelling.
The screen sends the version of the receipt that you saw. The button is a generic command (generic_rpc_command, method receipt_cancel; crates/libs/wms-lib-sql/sql/wms-meta-ui/migrations/062_receipt_and_task_use_rpc_command.sql:70-100).
What the screen says
| Result | Message |
|---|---|
| Cancelled | Receipt cancelled |
Reason is empty | Say why the receipt is being cancelled |
| The list changed | The receipt list has moved on — reselect the receipt and try again |
| Refused | Receipt {receipt number} could not be cancelled: {error} |
After success the window closes and the list is read again.
What changes
| What | Change |
|---|---|
| Receipt | status becomes Cancelled. cancel_summary is written. The version goes up. |
| Lines | Every line that is not Closed becomes Cancelled. |
cancel_summary | cancelled_at, cancel_reason, user_id, details_count. See Summary tab. |
| Events | process.receipt.cancelled, with the reason and the summary. |
| Stock | Nothing changes. |
Cancelling a receipt that is already Cancelled does nothing and gives no error (crates/libs/wms-inbound/src/domain/receipt/aggregate.rs:145).
What can go wrong
| Code | Message in {error} | Meaning | Fix |
|---|---|---|---|
| 72 | cannot cancel receipt {id}: detail line {n} has completion={completion} | Goods were received on line n. | Close the receipt instead. Code 72 cannot be overridden. |
| 70 | cannot cancel receipt id={id} in terminal state {status} or the state-machine refusal | The receipt is Closed. | None possible. |
| 40 | version conflict | The receipt changed after you ticked it. | Refresh the list and try again. |
In the message cannot cancel receipt {id} the id is the internal id.
Source: crates/libs/wms-inbound/src/service/receipt/lifecycle/cancel_receipt.rs:161-200.
Not confirmed by code: the exact wording of
{error}as the window shows it. To verify: receive one unit on a receipt, set it toCancelledthrough the API or tryCancel Receiptafter anAdjust Qtyon a test receipt, and read the message.
Related pages
- Closing a receipt
- Receipt statuses and transitions
- Return codes
- API:
receipt_cancel. It is a stateful command. - RF terminal: none.