Skip to main content

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​

Figure 1 — A DRAFT order. Planned ingredients are visible and changeable.

Everything about a DRAFT can change:

ChangeEffect
Planned quantityThe ingredient list is rebuilt from the BOM and rescaled
Ingredient overridesThe ingredient list is replaced entirely by what you supply
Changing the planned quantity discards your ingredient edits

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.

Overrides replace the whole list, so they can remove lines too

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​

Figure 2 — A completed run. The footer states why nothing can be changed.

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 columnActual consumption per ingredient, beside planned
Completed timestampThe one date on this screen you can trust

The footer is explicit: "Order is locked — ledger has been posted."

The Created timestamp is still wrong here

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 fromDRAFT
Refused fromCOMPLETED — completed orders cannot be cancelled — ledger already posted
RepeatableYes. Cancelling a cancelled order is a silent no-op
Ledger effectNone. 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​

Figure 3 — The status filter.

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​

StatusLedger rowscurrent_stock
DRAFTnoneunchanged
CANCELLEDnoneunchanged
COMPLETED1 × PRODUCTION_IN + 1 × CONSUMPTION_OUT per ingredientunchanged
Even completion does not touch current_stock

A 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​

SymptomCause
Ingredient edits vanishedThe planned quantity was changed after them — see §1
only DRAFT orders can be editedThe order is COMPLETED or CANCELLED
completed orders cannot be cancelledBy design. Post a compensating adjustment
Cancel appears to do nothingIt was already cancelled; the operation is idempotent
Yield is over 100%More was produced than planned — legitimate, and worth investigating
Created dates are all identicalThe known created_at defect