Receiving: four ways a receipt comes to exist
A receipt is the document that holds the goods that arrive. This page shows how the document is made, by which API method, and in which status it starts.
Diagram 1. How a receipt is created
What this shows: the four ways to create a receipt, the API method of each, and the status the receipt has afterwards.
Reading notes:
- A planned receipt (the first two branches) is made before the goods arrive. It stays
Openuntil the first receive. - A blind receipt and a return are made by the first receive itself. The code creates the header with status
Open, then the first receive moves it toInProgressin the same transaction. - The receipt number of a blind receipt is the next value of the
ReceiptNumbercounter, as a 10-digit number with leading zeros, unless the caller gives a number. The receipt number of a return isRMA-plus the RMA text. receipt.receipt_numberis a text of at most 10 characters. So an RMA text of more than 6 characters cannot be received: the database refuses the number (see the findings file).- Events: blind and return publish
process.receipt.opened.create_receiptpublishes nothing. The case-level ASN publishesprocess.receipt.case_level_loaded. - A planned line carries only the plan. The command refuses a line that already has received, adjusted, rejected or damaged quantity, a completion other than
Pending, an actual container, or a status other thanOpen. - A planned line may name the LPN the supplier announced (
expected_lpn). The server then plans that container (or reuses this receipt's planned one) and binds the line to it.
Where it comes from
| Item | Source |
|---|---|
create_receipt is a generated create; create_receipt_detail adds a planned line | crates/services/app-server/src/web/rpcs/receipt_rpc.rs:64-71, crates/services/app-server/src/web/rpcs/receipt_detail_rpc.rs:37-60 |
A planned line may not carry execution facts; expected_lpn plans a container | crates/libs/wms-inbound/src/service/receipt/planning/add_receipt_line_plan.rs:66-222 |
| Expected lot attributes of a line | crates/services/app-server/src/web/rpcs/receipt_expected_lot_attributes_rpc.rs:13-22 |
Default status Open, receipt_number is a varchar(10) | crates/libs/wms-lib-sql/sql/wms-app/migrations/001_baseline.sql:4270-4290 |
| Case-level ASN, steps | crates/libs/wms-inbound/src/service/receipt/case_level/commands/create_case_level_asn.rs:230-317 |
| Blind: validation, header insert, first line, first receive | crates/libs/wms-inbound/src/service/receipt/receive/receive_blind.rs:100-340 |
| Blind receipt number | crates/libs/wms-inbound/src/service/receipt/receive/receive_blind.rs:452-458 |
Return: header RMA-<rma>, first line | crates/libs/wms-inbound/src/service/receipt/receive/receive_return.rs:148-215 |
| Open to InProgress at the first receive | crates/libs/wms-inbound/src/domain/receipt/aggregate.rs:364-385 |
process.receipt.opened | crates/libs/wms-inbound/src/service/receipt/receive/receive_blind.rs:292, crates/libs/wms-inbound/src/service/receipt/receive/receive_return.rs:200 |
What the operator does on the RF
| Way | Screens | Source |
|---|---|---|
| Planned ASN | RCM (menu) then RCASN01: scan the receipt number. Page 11. | crates/libs/wms-lib-sql/sql/rf-screens/010_uc_rcv_01.sql:63-105, crates/libs/wms-lib-sql/sql/rf-screens/020_uc_asn_declarative.sql:33 |
| Case-level ASN | RCCASE01: scan the document number (the document itself is made through the API). Page 17. | crates/libs/wms-lib-sql/sql/rf-screens/080_uc_case_level_declarative.sql:41 |
| Blind | RCBLIND01: owner code and SKU, then RCBLIND01LINE. Page 12. | crates/libs/wms-lib-sql/sql/rf-screens/040_uc_blind_declarative.sql:44, :147 |
| Return | RCRTN01: owner code, RMA, SKU, then RCRTN01LINE. Page 12. | crates/libs/wms-lib-sql/sql/rf-screens/050_uc_rtn_declarative.sql:41, :122 |
| Damaged goods received straight in | RCDMG_RECV01: a blind receive with damage information. Page 15. | crates/libs/wms-lib-sql/sql/rf-screens/060_uc_dmg_receive.sql:40, :117 |
The RF menu RCM has these entries: Receive Against ASN, Receive Case-Level, Receive Blind, Receive Return, Close Receipt, Receive Damaged and Resume Serial Capture. Admin, Manager and Supervisor also see Force-Close Episode. It has no entry for hold, release or cancel. Those are buttons of the web receipt list.
Not confirmed by code
- Who writes
receipt_numberforcreate_receiptin the web screen. The API method takesreceipt_numberas a required text. To verify: open the "Create receipt" form and check where the number comes from. - That the web form uses
create_receiptandcreate_receipt_detail. The methods exist and are routed. The form metadata is not read here.