Invoice discounts tax and cent rounding
Reproduce how fractional quantities, discounts and per-line inclusive or exclusive taxes become a document total.
A preview is easier to audit when calculation order is visible. This generator rounds extended lines to cents first, allocates document discount in cents, calculates each line’s entered tax and then sums. That convention must be checked against your applicable rules before issuing a tax document.
A complete ordinary example
Two deliverables at 150 each plus one editing pass at 100 create a 400 subtotal. A 10% document discount is 40. With entered tax 0, net and total are 360. A recorded 100 payment leaves 260 due. Recording 500 instead leaves zero due and 140 overpayment; the tool does not silently produce a negative balance due.
Fractional quantities and half cents
Quantity 0.125 at unit price 0.04 extends to 0.005 before rounding. The line becomes 0.01 under half-up rounding. Two such lines create a 0.02 subtotal. A 50% document discount is 0.01. Proportional allocation gives one line the leftover cent, with the earlier line breaking the equal-remainder tie. The sum of allocated discount still equals the document discount exactly.
Inclusive and exclusive are different inputs
For an exclusive-tax line of 100 with an entered 20% rate and no discount, tax is 20 and total 120. For an inclusive-price line of 120 with the same entered 20% rate, extracted tax is 120×20/120=20 and net is 100. The same numeric unit price in those two modes does not mean the same customer total.
Mixed tax rates
Set the rate for every line rather than applying one guessed rate to the entire invoice. Discount allocation precedes tax. Per-line rounding can differ from rounding a whole invoice once; the model explicitly uses per-line tax and sums the resulting cents. A line for shipping has its own user-entered rate and no hidden special treatment.
Keep the reproducible input
Export JSON to retain the input and CSV to retain its rounded breakdown. CSV numbers are currency amounts, not raw minor-unit integers. If you reorder equal lines in a discount tie, the one-cent allocation can move between them while the document discount remains unchanged.
What the number does not establish
Arithmetic does not decide whether tax should be charged, establish registration status, satisfy an e-invoicing mandate or prove payment. The linked GOV.UK guidance illustrates that jurisdictional requirements exist. Read your own applicable requirements and keep supporting records.