Skip to main content
Version: v1.0.0

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

EventMeaning
ORDERPlaced on a purchase order; expected in but not yet received
RECEIVEArrived into a location
DEMANDRequired by a work or production order
ALLOCATESet aside for a specific job once it's in production
CONSUMEUsed up by a job
TRANSFERMoved out of a location toward another (see transfers)
ADJUSTManual upward correction
DISPOSEManual 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

SourceEvents
Purchase orders (materials)ORDER, RECEIVE
Work orders (inputs)DEMAND, ALLOCATE, CONSUME
Production orders (inputs)DEMAND, ALLOCATE, CONSUME
TransfersTRANSFER, RECEIVE
Manual operationsADJUST, DISPOSE

See also

Read summaries and post manual events through the REST API or the MCP server.