Error VAT Calculation ?

Hello everybody,

Before anything. just say, i m new around here and using “dolibarr” aswell.
The little contact i had with the software amazed me a lot.

I m not sure if what is happening with my dolibarr could be a error and if i m posting in the wrong forum-cathegory.

Also, sorry if this topic has been disscused here already. I havent seen anything like it.

My sistem:

1and1 hosting
dolibarr 2.7.1
decimal max for Unit Price:4
decimal max for total price:2
decimal max for the amounts displayed:8

As you can see at the attachted invoice i m sending, with 16% VAT and 10% discount, at the end the total calculation comes with 3 cents less.

for instance:
342.33 + (16%)54.74 = 397.07 —> invoice dolibarr calculation
342.33 + (16%)54.77 = 397.10 —> invoice my onw calculator

i ´ve noticed the more lines i have in the invoice, the biger is the mistake.

Sorry once again, but i coudnt find out whats going on.

Thanks everybody for the help.

Best regards
IP2000

1 Like

Hi,

Nobady has the same problem?
Yesterday I was watching this:

"…Rounding of VAT lines is done by the rule “the nearest”.

Example:

for 0,0000 to 0,0049 --> 0,00

for 0,0050 to 0,0099 --> 0,01 …"

It seems all right

I made also a simulation of the same invoice in excel, and the result of the VAT is not the same as Dolibarr.
Dolibarr: 54.74
Excel: 54.77

For everything else, I am impressed by the power and ease of use of applications. INCREDIBLE!

Please someone give me some idea??

Best regards and sorry for my google english :wink:
IP2000

When you use excel you ask to round the sum of each invoice line.
When you use dolibarr, you ask to sum the rounding of each invoice line.

2 different way of rounding and two different results. Both solution can be user to make accounting but solution used by dolibarr is easy to use when you need to dispatch vat when vat rate differs.

Yes I have the same issue I think.
All of my suppliers invoices are miscalculated by a penny (UK 1p) when I enter them into Dolibarr. I have been either reducing the amount before tax or adding an extra invoice item with the correction.

Is there a way to solve this by changing the decimal places calculated maybe?

I have a similar problem when Dolibarr is calculating sales tax in US Dollars. I have 39 line items with a quantity of 400 products.

Here are the calculations from Dolibarr:
Amount (net of tax): $2,097.60
Amount Sales Tax: $173.11
Amount (inc. tax): $2,270.71

The correct calculation using 8.25% Texas sales tax: (2097.6 * .0825)
Amount (net of tax): $2,097.60
Amount Sales Tax: $173.05
Amount (inc. tax): $2,270.65

Dolibarr is charging $0.06 more than it should in this case. Is this a rounding error or a desired feature? Can I fix this via a setting or programmatically?

Difference on rounding between excel and dolibarr are not on the mathematic function to round but there difference because you dont use the same method to make clauclation.

Dolibarr calculate amount of vat or sales tax by summing rounded lines.
When you make calculation manually, you calculate amount of vat or sales tax by rounding summed lines.

summ of rounded lines is not round of summed lines.

Can Dolibarr be changed to sum all line items that use the same VAT rate and then round? This would solve the rounding issue that I am seeing and still maintain the same ability to work with various VAT rates in a single order for your needs.

Is this possible? How can I help to correct this?

Here is my patch to Dolibarr v3.0 (4-11-2011) that will fix the tax rounding errors:

https://github.com/pdt256/dolibarr/commit/00df658e1a8b37273132a39aca60e482907e696c

I have not fully tested this yet. This is a possible solution to the VAT rounding errors. Someone who knows the system better will need to verify this will actually work.

I forgot to re-calculate the total amount (inc. tax) after changing the tax method. This seems to correct that:
https://github.com/pdt256/dolibarr/commit/98f058a9ba4b81f98af9de69b2acb1724f83de9b

If anybody would like to track the progress of this fix, I have an issue here with all the changes:
https://github.com/pdt256/dolibarr/issues/1

I will be adding this to my production install to see how it goes. I am not using localtax1 or localtax2 rates so I did not account for those in the total amount (inc. tax). Let me know if you will be using this patch and need me to fix the localtax1 or localtax2 totals for you. Otherwise, I hope this gets merged into Dolibarr trunk.

Hi!
Version 3.1.0-beta

What can I do?

I have set up:
Home - Setup - Limits and accuracy
Max decimals for unit prices 5
Max decimals for total prices 5
Max decimals for prices shown on screen 2

And have result.

But if I edit the row, nothing changes and I save, the amount changed.

Please, add:
Max decimals for unit prices shown on screen 5
Max decimals for total prices shown on screen 2

Thanks.

Vat Calculation seems to remain an issue in v 3.2. Can any suggest a fix?

Can someone share the final fix? I have vat calculation issue in v3.2.

ok, what I am realizing is that there is no error in vat calculation. I want to round Rs 30,514.16 to 30,514.00. This is not working well. Any manipulation in limits and accuracy messes the number words. I start seeing cents in along with Indian Rupee.

Any solution?

One solution could be to use rounded numbers, but if you work with cents then it is not a solution.