Practical tools / Data integrity · Stockroom Inventory
Local application
Every stock change needs a reason.
A Python and SQLite workspace for stock movements, sales, returns, and explainable reorder planning. Built for one user on one machine.
How do you keep an inventory balance, sales history, and returns consistent when an action fails or is submitted twice?
I built the Python/SQLite workflow, pairing balance changes with movement records, preserving sale-time prices, and adding duplicate-request checks and a transparent forecasting baseline.
Inspect the implementation ↗One local application connects stock movements, completed sales, returns, and reorder planning. Insufficient history is shown explicitly instead of generating a prediction.
Read the results ↗SCOPESingle-user local application. No production adoption or forecast accuracy claim; accounts, multi-user access, and automated purchasing are outside the current scope.
Follow a stock change.
Choose a stage to inspect the decision behind it.
Record what arrived.
Validate a whole-unit quantity, update the product balance, and retain the movement reason and resulting balance.
Keep the count and its explanation in the same transaction.
SECTION 01
Keep stock and sales in agreement
A stock count alone cannot explain what changed. Receiving goods, issuing supplies, making a sale, and accepting a return need a consistent history. Stockroom keeps balances and their movements together rather than treating them as separate edits.
SECTION 02
Make each stock change one transaction
I built a Python backend and browser UI around SQLite. Inventory changes use BEGIN IMMEDIATE, validate the available balance, and record the movement in the same transaction. Sales preserve the product name, unit cost, and selling price at the time of purchase.