Tax-inclusive pricing: tax amount is wrong due to double rounding

I opened this issue on GitHub regarding this issue:

But it was closed because apparently is working as expected (last image in the issue).

But I’m still seeing this issue on my end. Basically the tax is increased by 1 due to double rounding somewhere.

Please take a look at this image. the total in the sales tax template is 50,001 instead of 50,000.

I tried different approaches, moving from banker’s rounding to commercial rounding. Using 0 precision in the currency precision field. Nothing changes this result.

I can’t reopen the issue, and before opening another one. Is anyone having this issue or is able to replicate it?

This is a clean install with US region and USD currency. The tax template “US ST 6%” was modified to have 10% tax rate and “Is this Tax included in Basic Rate?” is checked for tax inclusive pricing.

The issue even happens to me with 2 decimal places

@mendozal

You can disable rounding off globally by visiting Global Defaults. On the other hand, invoice doctype itself offer Disable Rounded Totals checkbox within grand total section.

You also need to set precision for all currency fields in system setting as well.

Sadly toggling those options don’t affect the tax totals. The issue still persists.

@mendozal

I tried it on my site and I got the same result as your 2 decimal picture which is I think to me perfectly fine
45,454.55 X 1.1 = 50,000.01 (after rounding up)
Is your issue that a client will have a problem with $0.01 in tax?
If so then I think you can set the default rounding off account to the tax account so that it becomes super accurate.
Have I understood your problem properly?

Yes, that’s exactly my problem. Though my issue is that my currency doesn’t use cents but rounded numbers. And the difference is a whole unit.

I can live with that too, but ERPNext doesn’t allow me to submit that invoice.

The rounding solution you propose would work I suppose. But there are a couple of tax accounts and apparently te round off account only has space for 1.