Start with exact line totals
Multiply each quantity by unit price and sum them to obtain the pre-discount subtotal.
Apply the documented discount
A percentage discount reduces its chosen base. Record whether it applies to every item or only selected lines.
Choose the taxable base explicitly
Many workflows tax the discounted subtotal, while other charges or jurisdictions use different rules.
Round consistently
Currency commonly displays two decimals, but per-line versus invoice-level rounding can differ. Follow the accounting and tax rule that governs the invoice.
Audit each intermediate amount
This builder multiplies quantity by unit price and rounds each line to the currency's browser-reported fraction digits before summing the subtotal. It then calculates the percentage discount, identifies either the discounted or original subtotal as the selected tax base, rounds the tax, and adds tax to the discounted subtotal. The audit cards show those intermediate values so a reviewer can reproduce the total. If your accounting system rounds at a different stage, use its result instead and document that method consistently.
Treat the order setting as a choice, not advice
Turning on tax after discount calculates tax from subtotal minus the percentage discount. Turning it off calculates tax from the original subtotal while still subtracting the discount from the amount due. Neither option is universally correct: taxable discounts, shipping, exemptions, inclusive pricing, compound taxes, and per-item tax rules vary. Compare the preview with a worked example from the governing tax authority or your accounting system. This tool supports one invoice-level discount and one tax rate, so split or calculate more complex cases elsewhere.