VAT, Sales Tax and Discounts: How Invoice Totals Are Calculated
Two invoices with the same prices can end up with different totals if the steps happen in a different order. This is the order the Lumara invoice generator uses, every time.
The order of calculation
- Multiply each line's quantity by its unit price.
- Take off any item discount (a percentage or a fixed amount, never more than the line itself).
- Add the discounted lines together to get the subtotal.
- Take off the invoice discount, again never more than the subtotal.
- Work out tax on the discounted amounts. Discounts are applied before tax.
- Add shipping or other charges.
- Subtract any advance payment and amount already paid to get the balance due.
Amounts are rounded to the currency's usual number of decimals at each step, for example two for most currencies and none for the Japanese yen.
A worked example
| Step | Amount |
|---|---|
| Design: 2 × 100.00, less 10% item discount | 180.00 |
| Hosting: 1 × 50.00, less 5.00 fixed discount | 45.00 |
| Support: 3 × 20.00 | 60.00 |
| Subtotal | 285.00 |
| Invoice discount, 10% | -28.50 |
| Taxable amount | 256.50 |
| Tax, 10% | 25.65 |
| Shipping | 12.35 |
| Total | 294.50 |
| Amount paid | -100.00 |
| Balance due | 194.50 |
What to check for your own situation
Whether a discount reduces the taxable amount, and which items are taxed at which rate, depends on the rules where you operate. You enter the tax rates yourself, and the tool does not know your local law. Changing the currency only changes how amounts are displayed: nothing is converted. When in doubt, ask an accountant.