ERP for wholesale distribution
AS NEXUS 2
My role: Sole designer and developer
The problem
Small distributors run orders, stock, invoices and accounting in separate tools, so numbers disagree. I wanted one system where a shipment, an invoice, a payment and a return always leave the books balanced.
What I built
- An accounting engine in plain JavaScript: every action is a pure function on one state object, so a failed action (credit limit, wrong role) leaves the original state untouched.
- Double-entry journals that always balance, FEFO lot allocation across two warehouses, partial shipments, returns that restore original cost, and bank matching that never posts cash twice.
- 18 connected screens, Arabic and English (RTL), USD base with EUR and LBP display, data saved in the browser with JSON backup and restore.
- 22 automated transaction tests (node:test) cover balanced journals, stock and receivable reconciliation, FEFO, expiry, tax rounding, returns and permissions.
