FA-58195 / Double-entry ledger accounting / Member archive
VAT invoice journal: inclusive net derivation · case 05
Inclusive sales book the full gross as revenue while also booking tax.
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 fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: inclusive net derivation | {"net": 4027, "receivable": 4027, "tax": {"0": 0, "2100": 173, "500": 1, "700": 65}} | {"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 ↗