PRD: Replenishment
| Module | Inventory | PRD ID | PRD-RPL-001 |
| Status | No item | FEAT | RPL |
| Epic | — | Plane | — |
| Date | 2026-07-13 | Version | v1.0 |
| Packages | @nx/inventory | URD | RPL |
| Surface | Client · Owner/Mgr | ||
| Owner | Phát Nguyễn | ||
What replenishment is
Replenishment is the order-suggestion screen on the Client app: the list of items that need reordering, with a suggested order quantity next to each one.
It runs on the stock of the inventory locations (InventoryLocation) of one merchant (Merchant), and answers two questions: what needs ordering today, and which class of goods the merchant's capital is sitting in. This is a suggestion tool. It does not raise purchase orders by itself, and it blocks nothing the owner wants to do.
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:
| Number | What the system calls it | Meaning |
|---|---|---|
| On hand | on-hand | Goods physically sitting at the location |
| Reserved | reserved | Already promised to another document, no longer sellable to anyone else |
| Available | available | The part still on offer |
| Incoming | incoming | Already left the source location, not yet arrived at the destination |
The invariant, true at every moment:
Available = On hand - ReservedThe number this whole feature compares against is available.
Why a hand-typed threshold is not enough
A low-stock threshold typed in by hand on each stock item is the crudest tool for knowing when to buy more, because it is a static number. It has no idea whether the item is selling fast or slow, or whether the vendor delivers in two days or two weeks. A merchant selling 20 glasses a day and one selling 200 glasses a day both get the same alert at 10 cans of milk, even though one of them has half a day of cover left and the other has a full week.
Replenishment replaces that static number with a moving one: reorder when stock is only just enough to last until the next delivery arrives, plus a cushion for the days you sell more than usual or the vendor runs late. The inputs are already in the system. Sales velocity comes from sales history, lead time comes from the vendor-item record.
Alongside it comes the second question every merchant owner asks: out of hundreds of items, which ones are worth the attention. ABC classification answers that by consumption value, quantity sold times inventory valuation. The point here is controlling the capital tied up in stock, not spotting which item posts pretty revenue.
One item from start to finish
Canned milk. History window 30 days. The preferred vendor delivers in 3 days on average, 5 days at worst. Pack size 24 cans per case, minimum order quantity 2 cases.
| Number | Where it comes from | Value |
|---|---|---|
| Average daily sales | 30 days of sales history | 20 |
| Peak daily sales | the same window | 35 |
| Average lead time | real goods-receipt history | 3 days |
| Longest lead time | real goods-receipt history | 5 days |
| Safety stock | (35 x 5) - (20 x 3) | 115 |
| Reorder point | (20 x 3) + 115 | 175 |
- Available at 200: the item does not show up in the To-order list.
- Available drops to 170: the item does show up, because 170 is already below 175.
- The gap is 30 cans, but the suggested order quantity reads 2 cases (48 cans), because it always rounds up to the pack size and the minimum order quantity.
- The inventory manager types safety stock of 50 by hand: the reorder point is recomputed to 110. The hand-typed number always beats the formula result.
The easiest thing to get wrong
Missing data means an empty cell, never an invented number
An item with fewer than 14 days of actual sales, or with no vendor declaring a lead time, prints no number at all. It prints exactly what is missing instead: "Not enough sales history", "No lead time declared".
Treating an undeclared lead time as 0, or reading sales velocity out of three days of data, both produce a figure that looks scientific and that nobody can check. The merchant believes it and orders wrong.
Consequence: a row missing its lead time carries a shortcut straight into that item's vendor screen, so the merchant can declare it on the spot and come back.