FA-58185 / Double-entry ledger accounting / Member archive
VAT invoice journal: half-cent tie · case 05
Tax on exact half-cent amounts is rounded down.
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: half-cent tie | {"net": 14064, "receivable": 16449, "tax": {"2000": 2224, "2100": 18, "500": 143}} | {"net": 14063, "receivable": 16449, "tax": {"2000": 2225, "2100": 18, "500": 143}} | 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 ↗