Eliminating conflicting dealer balances and resolving the bulk collection puzzle
Business pain point
A dealer pays one amount against several invoices. If each screen allocates that money differently, the business cannot reliably answer what is still owed—or who owns the account after a territory change.
How I engineered the solution
- Deterministic FIFO payment replay absorbs OpeningDue first, honors pinned invoices, settles oldest-first, and carries excess as an advance.
- One CustomerDueCalculator is reused across dashboards, ledgers, and PDF statements.
- Effective-dated ZSM > RSM > ASM > TSM > TO geography governs access. Mid-period transfers change live access immediately while preserving period targets with the previous manager through month-end; managers may hold dual roles.
- An audited cash commission engine uses configurable age windows, with statutory VAT withholding and a transactional double-claim lock.
Defensible business impact
A single explainable balance is available across views, bulk payments follow one repeatable allocation rule, and manager transfers preserve both immediate access boundaries and month-end performance ownership.
