VAT calculation wrong?

Hi, I just ran into a weird behavior I can’t explain. I’m on 22.0.5. I created a quote, net sum is 781,00, VAT 19% should be 148,39, but dolibarr is giving me 148,40

Screenshot 2026-06-11 155941

Screenshot 2026-06-11 155907

And it doesnt matter if the system first calculates the vat of every line and just sum it at the end, or is doing the vat calculation just on the net sum. Both should be 148,39

12,46 | 2,3674 |
218,24 | 41,4656 |
216,32 | 41,1008 |
269,72 | 51,2468 |
64,26 | 12,2094 |
781 | 148,39000

Next quote, net sum is 2572,26, VAT should be 488,73, but dolibarr is calculating 488,72. WTH

Screenshot 2026-06-11 160642

Screenshot 2026-06-11 160612

on which page do you see this?

That’s 2 Screenshots. One is directly from the quote, the other is a database screenshot.

I guess I found the reason. When I round every line, I get the wrong calculation as well. How to tell dolibarr not to calculate every line but do the vat calculation at the end just on the total net sum?

It seems MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 1 is the trick.

1 Like