Materials Inventory
Materials inventory is the running record of raw-material stock, kept as a ledger. Nothing overwrites a stock number; every movement is appended as an entry, and the current position is derived by summing those entries per material and location.
How the ledger works
Each entry records one movement: a material, a location, an event type, a positive
quantity, an optional unit cost, and a ref linking it back to whatever caused it. Entries
are never edited or deleted in normal operation — a movement that needs undoing is offset
by a reversing entry. This makes the ledger a complete, auditable history rather than a
single mutable balance.
Two timestamps matter: event date is the business date the movement happened (you can set it), while created-at is when the row was written. Positions and ordering use the event date.
Event types
| Event | Meaning |
|---|---|
| ORDER | Placed on a purchase order; expected in but not yet received |
| RECEIVE | Arrived into a location |
| DEMAND | Required by a work or production order |
| ALLOCATE | Set aside for a specific job once it's in production |
| CONSUME | Used up by a job |
| TRANSFER | Moved out of a location toward another (see transfers) |
| ADJUST | Manual upward correction |
| DISPOSE | Manual reduction (loss, scrap, write-off) |
Every reconcilable event has a matching REVERSE_ form that backs it out — that's how a
cancelled order or a corrected mistake is undone. ADJUST and DISPOSE are the manual
events and aren't reversible; to undo one, post its opposite.
Deriving the position
The summary is computed, not stored:
- On hand — what's physically in a location: adds RECEIVE and ADJUST, subtracts CONSUME, DISPOSE, and TRANSFER (and applies the reversals).
- On order — placed but not yet received: adds ORDER, subtracts RECEIVE.
Positions are grouped by material and location.
Where the entries come from
| Source | Events |
|---|---|
| Purchase orders (materials) | ORDER, RECEIVE |
| Work orders (inputs) | DEMAND, ALLOCATE, CONSUME |
| Production orders (inputs) | DEMAND, ALLOCATE, CONSUME |
| Transfers | TRANSFER, RECEIVE |
| Manual operations | ADJUST, DISPOSE |
See also
Read summaries and post manual events through the REST API or the MCP server.