FAILURE MAP
← Case archive

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

VAT invoice journal: inclusive line divisor · case 05

Tax extracted from tax-inclusive prices is too high.

Member previewVariant 5 · 3 implementations · 7 checks per implementation

Case contract

x = {'mode': 'inclusive'|'exclusive', 'rounding': 'line'|'invoice', 'lines': [[amount, rate_bp, account]]}. Exclusive: tax = amount*bp/10000. Inclusive: tax = amount*bp/(10000+bp). Rounding is half-up to the cent, per line ('line', summed per rate) or once per rate on the summed amounts ('invoice'). Tax is keyed by str(rate_bp). Inclusive: receivable = sum amounts, net = receivable - total tax. Exclusive: net = sum amounts, receivable = net + total tax. Return {'receivable', 'net', 'tax'}.

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: inclusive line divisor{"net": 3746, "receivable": 4027, "tax": {"0": 0, "2100": 210, "500": 1, "700": 70}}{"net": 3788, "receivable": 4027, "tax": {"0": 0, "2100": 173, "500": 1, "700": 65}}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 ↗