Overview
When one client's expense is paid from an account holding another client's money, the ledger records the obligation here rather than quietly letting the pools drift. Settling one posts the transfer it promised.
Open obligations
0 records across 0 client pairs
Unfunded
The owing client holds no liquidity anywhere
Closed
Settled or voided, kept for audit
Each row is one automatic balancing entry the engine posted, and the movement that will close it.
Every pool is square
No client has spent from another client's account, so there is nothing to clear. This is the state you want to be in.
The worked example from the specification, exactly as the engine executes it.
Starting state
An expense of 10,000 is paid out of Cash for Client B.
What the engine posts
Clearing is for both parties: it never changes what a client is worth, only where that value sits. That is the arithmetic proof the engine neither creates nor destroys value — and it is why the closing balance on a client statement is unaffected by any automatic entry.
Re-derive every invariant from the underlying entries. Also available from the command line as `npm run db:verify`, which is what a cron job should call.
The clearing register is reconciled against the ledger itself: each client's balance in the memorandum account must equal their outstanding position in this register. That is invariant INV-6, checked by the integrity panel above.