Skip to content

PRD: Production Orders

ModuleInventoryPRD IDPRD-MFG-001
StatusNo itemFEATMFG
EpicPlane
Date2026-07-13Versionv1.0
Packages@nx/inventoryURDMFG
SurfaceClient · Owner/Mgr
OwnerPhát Nguyễn

What a production order is

A production order (Production Order) is the document of one batch. The merchant owner opens it on the Client app: pick the finished good to make, the bill of materials to follow, the inventory location (InventoryLocation) that does the work, and the planned quantity.

An order only ever runs inside one merchant (Merchant). It ties the two ends together: the materials going out of stock and the finished goods coming into stock, one document, one batch.

The four stock numbers

Lifted from Stock Items & Levels so you do not have to open another PRD. Every item at every location carries four numbers:

NumberWhat the system calls itMeaning
On handon-handGoods physically sitting at the location
ReservedreservedAlready promised to another document, no longer sellable to anyone else
AvailableavailableThe part still on offer
IncomingincomingAlready left the source location, not yet arrived at the destination

The invariant, true at every moment:

Available = On hand - Reserved

Starting a run pushes materials from available into reserved. On hand only drops at completion.

Why a batch needs a document of its own

Some things a merchant does not buy to resell as is, it has to make them: a tray of bread, a pot of broth, a run of bottled sauce. This is nothing like a drink assembled at the counter. A counter drink explodes its recipe the moment the customer orders, gets handed straight over, and the finished item never sits in stock. A tray of bread is made ahead, a hundred at a time, and those hundred loaves live in stock as an item with stock of its own, with a lot number and an expiry date.

Without a production order the merchant is left keying it in by hand: write off the materials with one inventory ticket, add the finished goods with another, and remember on their own that the two tickets belong to the same batch. The books come apart. Nobody can trace how much flour those 100 loaves ate, how many loaves a batch came up short, or which batch the bread in the case came from and how long it is still good for.

A tray of bread from start to finish

Order "Bread batch 001": 100 loaves at the Central Kitchen. The recipe calls for 5kg of flour and 2kg of sugar per 100 loaves. The location holds 6kg of flour. Bread declares a 3-day shelf life. The kitchen gets 98 loaves out of the oven.

What happensFlour on handFlour reservedFlour availableBread on hand
Open the order for 100 loaves, the order sits in Draft6060
Start6510
Complete, declaring 98 loaves produced10198
  • Start only reserves the flour. On hand does not change, and the ledger has no line yet.
  • Complete is when the flour leaves the location for real, and when the new bread lot enters stock with an expiry of today plus 3 days.
  • Planned 100, actual 98, so a shortfall of 2 is recorded on the order.
  • When the recipe nests a semi-finished item that has stock of its own, the order reserves that item itself and never drills down to the materials that made it.

The easiest thing to get wrong

Start RESERVES, it does not DEDUCT

Hit Start: 5kg of flour moves to reserved for the order, available drops immediately, and no sale order and no other production order can touch that slice again. But on hand does not drop by a single gram, and the inventory ledger gets no line at all.

Writing the ledger is the job of Complete, when the operator declares what the batch actually consumed. Deducting early at Start means cancelling an in-progress order has to add the goods back into stock, and the ledger ends up with an out-then-in pair of entries for a batch that never ran.

Consequence: cancelling an in-progress order only releases what was reserved, available goes straight back up, and the ledger stays clean, with no line for that order.

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.