Hello Aurelie,
Actually, if you’re from France, I would advise you to keep the option “apply before tax”. If you don’t do that, the taxes won’t match. Let’s say you have an order of €10 ex. VAT, the totals would look like this with apply before tax:
Subtotal: €10,00
Discount 10%: €1,00
Total: €10,80 (including €1,80 tax 20%)
that’s correct because €1,80 is 20% of €9 (€10,80 – €1,80)
Then without apply before tax:
Subtotal: €10,00
{+ tax: €2,00 – this won’t show here)
Discount 10%: €1,20
Total: €10,80 (including €2,00 tax 20%)
This is not correct because €2,00 is 23% of €9,80 (€10,80 – €2,00)
Rereading your initial question, I’m starting to think that the sum in the PDF was correct in the first place, but you made the mistake of trying to subtract the discount from the total including tax, whereas you applied it before tax.
Either way, I’ll close this topic because it’s indeed a WooCommerce issue and not an issue with the PDF Invoice!
I hope the above helps you to understand it better though.
Have a great day!
Ewout