Purchase Orders
Workflows for purchase orders, their line items, and receipts. POs target either materials (raw inputs) or finished goods (resale), set on creation and immutable thereafter. Receipt workflows touch two domains at once: they write the PO-side receipt and the matching inventory ledger entries in the same transaction, and, for materials POs, propagate cost changes downstream through work orders and finished-goods inventory.
Components composed across this domain: PurchaseOrders, MaterialsInventory, FinishedGoodsInventory, Vendors, Materials, Products, Locations, BOM, WorkOrders, OrganizationSettings.
Status values are the L1 ENUM org.po_status — Planning, Placed, In Transit, Partial, Received, Paid, Cancelled — not user-editable. Header updates (W114) patch status directly; a validated manual-transition map is a v1 gap. The receipt workflow (W122) computes Partial vs Received from cumulative receipts against expected quantities and rejects receipts against terminal POs (Paid, Cancelled) with a 409.
Ledger side-effects: every create (W111) and status update (W114) runs the status → ledger reconciliation projector, which seeds an ORDER entry per line item — on the materials or FG ledger per target_type — once status leaves Planning, and reverses on Cancelled. RECEIVE stays receipt-driven (W122).
Writes
- W111 Create purchase order
- W114 Update purchase order
- W115 Delete purchase order
- W128 Bulk-import purchase orders
- W117 Add item to purchase order
- W120 Update purchase order item
- W121 Remove item from purchase order
- W122 Create receipt against purchase order
- W125 Update receipt
- W126 Delete receipt