Skip to content

Inventory Model

Knowing how the system stores inventory helps you read stock reports, counts, and adjustments.

A quant is a single record that says: “there are X units of item Y in bin Z (optionally under lot L)”.

One or more quants represent every piece of on-hand stock. The system creates, updates, and removes quants automatically as stock moves. You never create a quant directly.

A quant is identified by the combination of:

  • Warehouse item: the specific item in a specific warehouse
  • Bin: where the stock physically sits
  • Lot: for LOT-tracked items, which batch it belongs to (BULK and SERIAL/RFID items have no lot)

If an item is stored in more than one bin, there will be one quant per bin. If it is a LOT-tracked item received in two different batches into the same bin, there will be one quant per lot.

Example:

Item Bin Lot Quantity
Widget A A-01-01 (none) 120
Widget A A-01-02 (none) 80
Capsule B B-01-01 LOT-240101 500
Capsule B B-01-01 LOT-240315 300

Total on hand for Widget A is 200. Total for Capsule B is 800.


For SERIAL and RFID-tracked items, each physical unit has a serialized unit record alongside the quant. The serialized unit holds the serial number or RFID tag and links to the quant that currently holds it.

  • When stock is received, one serialized unit record is created per unit
  • When stock is dispatched, the serialized unit record is deleted
  • When stock is transferred, the serialized unit record is updated to point to the new quant

The quant’s quantity for serial/RFID items always equals the number of serialized unit records linked to it.


Inventory transactions: the permanent ledger

Section titled “Inventory transactions: the permanent ledger”

Many stock changes are recorded as an inventory transaction. These records are never modified or deleted, so they form an auditable ledger.

The standard workflows write a transaction in three cases: receiving an inbound line (goods_receipt), completing an internal transfer (bin_transfer), and applying a stock adjustment or stock-count reconciliation (system_correction). Outbound dispatch does not currently write a transaction, so the ledger is not yet a complete record of every movement. Keep that in mind when you reconcile outbound activity.

Each transaction records:

  • What changed (item, bin, quantity before and after)
  • Why it changed (receipt, issue, transfer, adjustment, etc.)
  • Which order or document caused it
  • Which user triggered it
  • Lot number, serial number, or RFID tag if applicable

You can view the transaction history for any item or bin at any time to see how its quantity reached its current level.


Term Meaning
On hand Physical stock in the warehouse right now (the sum of quant onHandQuantity values)
Available The quantity free to be ordered
Allocated The quantity committed to a RESERVED outbound order

available and allocated are computed at read time, not stored. The current implementation has no separate reservation accounting: available always equals on hand, and allocated is always 0.

Reservation does not subtract from an available figure. Instead, reserving an outbound order physically moves the stock out of its source bins and into the staging/dispatch bin. The stock is still on hand, just in a different location. So an item’s reported available number does not drop when stock is reserved; the stock simply relocates. Plan around the physical location of stock rather than an available/allocated split.