FAILURE MAP
← Case archive

FA-58147 / Double-entry ledger accounting / Member archive

Aging-based allowance adjustment: net receivable base · case 02

Net receivables use the pre-adjustment allowance.

Member previewVariant 2 · 3 implementations · 7 checks per implementation

Case contract

x = {'as_of': day, 'invoices': [[id, due_day, open cents]], 'rates': [[max_days_past_due or None, basis points]] ascending, 'allowance': existing credit balance (negative = debit balance), 'writeoffs': ids}. Written-off invoices leave receivables and reduce the allowance by their amount. Days past due = max(0, as_of - due); an invoice goes in the first bucket whose limit is None or >= days. Required allowance = sum over buckets of bucket total * bp / 10000 rounded half-up per bucket. Return {'buckets', 'required', 'adjustment': required - allowance after write-offs, 'net_ar'}.

Why this case matters

Ledger software must keep debits equal to credits and apply normal-balance, period and cutoff rules exactly; small sign or boundary slips silently misstate financial statements.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: net receivable base{"adjustment": 5708, "buckets": [0, 2500, 333, 1000, 0], "net_ar": 8966, "required": 575}{"adjustment": 5708, "buckets": [0, 2500, 333, 1000, 0], "net_ar": 3258, "required": 575}Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗