Skip to content

PRD: Stock Transfer

ModuleInventoryPRD IDPRD-TRF-001
StatusNo itemFEATTRF
EpicPlane
Date2026-07-14Versionv1.0
Packages@nx/inventoryURDTRF
SurfaceClient · Owner/Mgr
OwnerPhát Nguyễn

What a stock transfer is

A merchant can hold several inventory locations: a main store, a bar counter, a kitchen. Several merchants sit inside one organizer.

A transfer ticket is the document recording one move of goods from one location to another: which location they leave, which location they arrive at, who issues them, who receives them, and how much goes missing on the way.

The four numbers in stock

Lifted from Stock locations & levels so there is no need to open another PRD. Every item at every location carries four numbers:

NumberWhat the system calls itMeaning
On-handon-handGoods physically sitting in the location
ReservedreservedAlready promised to another document, no longer sellable to anyone else
AvailableavailableThe part still sellable
IncomingincomingLeft the source location, not yet arrived at the destination

The invariant, true at every moment:

Available = On-hand - Reserved

Why a transfer is not a simple addition and subtraction

Goods do not arrive instantly. They leave the source this morning and reach the destination tomorrow afternoon. In between, they are at neither location.

  • Deduct the source and credit the destination at the same instant: the destination sells goods that are not on its shelf.
  • Deduct the source and credit nothing: the goods disappear from the books for the whole time they are on the road.

A transfer is therefore a process in several legs, and each leg has its own document.

One shipment, end to end

Move 100 cans from location A to location B. Issue them in two trips. The second trip loses 2 cans.

What happensOn-hand AReserved AIncoming BOn-hand B
Raise the ticket, not yet approved100000
Approve10010000
Issue trip 1: 60 cans4040600
Location B receives all 604040060
Issue trip 2: 40 cans004060
Location B counts only 3800098
  • Reserved at the source is the approved quantity minus what has been issued. Issue everything and it is back to 0.
  • Incoming at the destination is the total issued minus the total received. Receive everything and it is back to 0.
  • The destination cannot sell what is incoming. Goods have to arrive and be counted for real before they become available.

The easiest thing to get wrong

Goods that left the source location cannot silently disappear

Issue 40, location B counts 38. Those 2 cans have left location A and cannot be pulled back.

The raiser has to close the ticket. Closing raises an adjustment ticket recording the 2 cans lost, with a reason. Goods that go missing need a document recording that they went missing.

The consequence: a completed ticket is never edited and never deleted. A wrong figure is corrected by raising a new ticket. The stock book is append-only.

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