A wrong stock number is a slow poison: one small discrepancy today, and within a month nobody trusts the stock report or the sales report. When building the inventory module wired into Dexova's POS, the guiding principle was that stock is never 'set' — it only changes through recorded events.
Stock is the result of events, not an edited number
The biggest temptation is to store one 'stock quantity' column and update it directly. The moment two developers update it at once, or one process fails midway, the number is wrong and there is no way to know why.
The more honest approach: every sale, purchase, return, and adjustment is a recorded stock movement. The current quantity is the accumulation of movements — so there is always an answer to 'why is the stock this number'.
Returns and voids must close the loop
This is where it leaks most often: a voided POS transaction or a returned item must restore stock automatically. If a sale decrements stock but a return doesn't add it back, the sales system and the stock system slowly drift apart.
Because POS and inventory share the same truth, a void at the register and the stock restoration are one flow that cannot go halfway — both succeed or both roll back.
Multi-warehouse: traceable movements
Once there is more than one location, 'stock' is no longer one number but a number per warehouse. Moving goods between warehouses is a transfer: out of one, into another, recorded as a balanced pair.
What separates a serious system from a spreadsheet: every piece of stock has a full story of where it is and how it got there.
Summary
Accurate inventory comes from one principle: never edit the stock number, record the event that changes it. Close the return/void loop, and make inter-warehouse transfers traceable. The result is a report you can actually trust.