Hi Thunderbolt, thanks for joining the Community.
In QuickBooks Online, the discount is applied to the overall invoice and the VAT is then calculated (and rounded to 2 d.p.) on each line item separately, then added together. If you'd like, you can reply below with an attachment of the invoice (covering any sensitive info) so we can provide a further breakdown on the calculation for you.