Skip to content

PRD: Materials

ModuleInventoryPRD IDPRD-MAT-001
StatusSupersededFEATMAT
EpicPlane
Date2026-07-13Versionv1.0
Packages@nx/inventoryURDMAT
SurfaceClient · Owner/Mgr
OwnerPhát Nguyễn

What a material is

A material (Material) is something used to make something else and never sold directly: milk, tea, pearls, plastic cups. The owner declares it on the Materials screen of the Client app and marks it as a raw material, a semi-finished item, or a consumable.

Materials are the second catalog of Inventory, a peer of the product variant. A material has stock at each inventory location (InventoryLocation) of a merchant (Merchant), is received through purchase orders, and is drawn down either by a bill of materials or by an inventory ticket.

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

Why materials need a catalog of their own

An F&B merchant does not sell milk, it sells milk tea. But what runs out in the back is the milk, the pearls, the plastic cups. A system that only knows about the products being sold cannot answer "how many glasses can we still make tonight", and does not know which carton of milk is about to expire.

What separates materials from products is that they are not managed uniformly. Milk needs stock tracking, lot splitting and expiry dates. Ice cubes can never be counted accurately. Plastic cups only need a heads-up before they run out. That is why the stock configuration flags hang off each material, rather than the whole location running one shared policy.

The second difference is vendors. A merchant buys milk from three places, each with its own price, minimum order quantity and lead time. So the vendor name does not live on the material. It lives on the vendor price list, where every vendor-material pair is its own row.

One material from start to finish

Fresh milk, base unit the litre, low-stock threshold 5 litres, shelf life 7 days. The milk tea recipe calls for 50ml of milk per glass.

What happensOn handReservedAvailableInventory valuation
Declare the material, opening stock 20 litres at the Kitchen2002025,000 VND/litre, entered by hand
Receive 10 litres through a purchase order at 30,000 VND/litre30030recomputed from the real receipt price
The cashier taps 1 glass of milk tea into the order300.0529.95unchanged
The customer pays, the order completes29.95029.95unchanged
The end-of-day stock count reads 29.5 litres29.5029.5unchanged
  • The hand-entered purchase price only lives until the first receipt. From then on the valuation follows the real receipt price.
  • Tapping the item into the order reserves the milk, it does not deduct it. The milk leaves the location for real when the order completes.
  • At 4 litres on hand the milk row is flagged low stock, because its threshold is 5 litres.

The easiest thing to get wrong

Stock quantities are never typed in on the material screen

The material edit screen lets you change the name, the category, the units, the stock configuration flags and the vendor list. It has no field for typing a stock quantity back in.

Quantities only change through four doors: a receipt, a sale, a stock transfer, a stock count. Every stock number therefore traces back to a document. The one allowed exception is the opening stock entered when the material is first created.

Consequence: when the book is wrong, raise a stock count and count it again. Do not overwrite the old number.

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