On the customer ledger the two disagreed by ₹32.9 crore on a single customer. They are the same figure counted two ways, and four separate faults were pulling them apart.
The Customer Ledger Reconciles With Itself
Opening balance plus open receivables less unapplied credits is opening balance plus debits less credits. Four things were breaking that identity:
- The outstanding list was filtered to the fiscal year while the balance counted every open invoice ever raised.
- An unapplied receipt is a term of the identity that can appear in no list of invoices, and was being left out of the reconciliation entirely.
- Allocating a receipt wrote back only the invoice half, so every receipt reported its whole value as still unapplied.
- The cached allocated figure was nudged by a difference rather than rebuilt, which left 38 invoices allocated past their own debit amount.
The allocation rows are the record and those cached columns are a summary of them, so they are now recomputed, never adjusted by a delta. The customer’s balance is the net balance rather than the aging total — which ignored every on-account receipt, in the balance and in the credit check alike.
Administrators: reconcile_customer_ledger_allocations repairs existing data. It reports before it writes.
A Sales Order Budget Reads the Whole BOM Tree
Converting a sales order BOM into a budget now counts the multi-level explosion correctly — top-level structures only, so a garment is not charged again under its own panel and fabric — and the budget delta reads the same way.