A stock ledger you can audit: every change with a cause
Why on-hand quantities should never be edited directly, how a ledger of movements makes every number explainable, and the fields a useful ledger line needs.
Stokrio Team · · 6 min read
"We had 120, now we have 95, and nobody knows why." Every inventory team has had that conversation. The fix is not better memory; it is a system where a quantity can only change by recording a movement with a reason.
Key takeaways
- Treat on-hand as the sum of movements, not as a number people overwrite.
- Every movement needs a cause, a reference, who did it and a running balance.
- Write the ledger where it cannot be bypassed by application bugs or imports.
- Reconcile on a schedule: the ledger should explain the difference between two counts.
What a ledger line holds
| Field | Why it matters |
|---|---|
| Type | Receipt, sale, adjustment, transfer, production, return or sync |
| Quantity | Signed, so you can sum it |
| Reference | The PO number, order number or count sheet |
| Who | A person, an API key or the system |
| Where | Warehouse and, where used, the bin and lot |
| Balance | The on-hand after this line, so a gap is visible |
Why it must be in the database
If stock changes are made only by application code, a script, a bulk import or a bug can bypass the rule. Stokrio writes each change as a ledger line in the database itself, so no code path can change on-hand without leaving a line. Even sales from Shopify, supplier receipts, production runs and corrections from a count go through the same door.
Reconciling
When a stock count disagrees with the system, the question is not "what is the right number" but "which movements are missing or wrong". With a ledger you can filter to the SKU and period, read the lines in order and see where the balance first diverges from reality. Corrections are then recorded as an adjustment with a reason such as damaged, found or recount, instead of silently overwriting the number.
A rule of thumb for adjustments
Require a reason on every adjustment, review the largest ones weekly, and report on the count and adjustment differences by reason. If "found" and "damaged" dominate, the issue is receiving and handling, not the system.
See the stock ledger feature.