Rekall

In the text · ↑↓ to choose, Enter to open

  • StepReproduce the one-cent drift with a failing testproject:ledger task:fix-vat-rounding…with 12 lines of 33 cents at 22% that expects the sum of rounded lines.
  • WrapupFix the VAT roundingproject:ledger task:fix-vat-rounding…in `crates/billing/src/vat.rs` sums the VAT of each rounded line, so an invoice never drifts by a cent. The failing test…
  • Noterounding-rules.mdproject:ledger task:fix-vat-rounding…not rounded Two finance reviews disagreed with the sum of rounded lines, so the rule is written down here once. - A line with a…

Saved

Skip to the editor
Fix the VAT roundingproject:ledger task:fix-vat-rounding2
Time
6h 42m

3 sessions · stopped 1 min ago

Notes2
On 1 task
Rounding rules

VAT is rounded per line, in cents, half away from zero.

Why the invoice total is not rounded

Two finance reviews disagreed with the sum of rounded lines, so the rule is written down here once.

A line with a zero rate has no VAT.
A credit note rounds the same way as the invoice it reverses.