2. The Purchase Order Status Workflow

Purchase Orders move through a defined, multi-stage status workflow rather than existing in a single editable state. The sequence is: Draft, Submitted, Approved, Sent, Partial Received, Received, and finally Closed.

A PO starts in Draft while the buyer builds and edits it. Submitting the PO moves it to Submitted, which routes it into approval. Once an authoriser approves it, the PO becomes Approved, and marking it as sent to the vendor moves it to Sent. As goods arrive, the status reflects how much has been received: Partial Received when some but not all ordered quantity is in, and Received when the order is complete. A finished PO can be Closed.

The backend exposes dedicated transition endpoints for these steps, including submit-for-approval, approve, mark-as-sent, cancel, and close actions on a purchase order. Cancellation is supported at appropriate points with reason tracking, so a cancelled order records why it was stopped.

Importantly, the Partial Received and Received statuses are not set manually in isolation; they are driven by the receiving process. As receipts are posted against the PO, the system automatically updates the PO status based on cumulative received quantities, keeping the order state in sync with physical reality.