The production lifecycle
Four statuses, two of them terminal. What you can do depends entirely on which one an order is in.
1. DRAFT — the only editable state
Everything about a DRAFT can change:
| Change | Effect |
|---|---|
| Planned quantity | The ingredient list is rebuilt from the BOM and rescaled |
| Ingredient overrides | The ingredient list is replaced entirely by what you supply |
The two operations happen in order. Setting a new quantity deletes the ingredient rows and regenerates them from the current BOM; overrides are then applied on top.
So: edit the quantity first, then adjust ingredients. Doing it the other way round silently throws the adjustments away.
Supplying overrides deletes every ingredient row and inserts exactly what you sent. Omitting a
material is how you drop it from this run. A negative planned quantity is rejected —
ingredient planned_quantity cannot be negative.
Editing anything else is refused with
only DRAFT orders can be edited (current: COMPLETED).
2. COMPLETED — locked, and for a reason
The drawer adds three things a DRAFT does not have:
| Yield % | produced ÷ planned — 100.0% here, 90.0% on the 18-of-20 run |
| Used column | Actual consumption per ingredient, beside planned |
| Completed timestamp | The one date on this screen you can trust |
The footer is explicit: "Order is locked — ledger has been posted."
Created 01 Jan 0001, 00:53 appears in the drawer as well as the list. Only Completed is real.
See Production orders §4.
3. CANCELLED — a soft stop
Cancelling sets the status and stamps the time. The row stays for audit; nothing is deleted.
| Allowed from | DRAFT |
| Refused from | COMPLETED — completed orders cannot be cancelled — ledger already posted |
| Repeatable | Yes. Cancelling a cancelled order is a silent no-op |
| Ledger effect | None. A cancelled order never posted anything |
completed_at doubles as "ended at"A cancelled order carries a timestamp in the same field a completed one uses. Read it as when this order stopped, not when it was completed.
4. Filtering by status
The filter is applied server-side — it is a parameter on the list query, not a client-side hide. The counts you see are real.
5. What each status means for stock
| Status | Ledger rows | current_stock |
|---|---|---|
| DRAFT | none | unchanged |
| CANCELLED | none | unchanged |
| COMPLETED | 1 × PRODUCTION_IN + 1 × CONSUMPTION_OUT per ingredient | unchanged |
current_stockA completed run posts every movement to the ledger and leaves the Stock column on Products and the Stock Status on Raw materials exactly as they were.
This is the module-wide split, not a production quirk. See How stock is counted.
6. Troubleshooting
| Symptom | Cause |
|---|---|
| Ingredient edits vanished | The planned quantity was changed after them — see §1 |
only DRAFT orders can be edited | The order is COMPLETED or CANCELLED |
completed orders cannot be cancelled | By design. Post a compensating adjustment |
| Cancel appears to do nothing | It was already cancelled; the operation is idempotent |
| Yield is over 100% | More was produced than planned — legitimate, and worth investigating |
| Created dates are all identical | The known created_at defect |