Sales tax calculations incorrect.
I am using ZenCart 1.3.7 and am not seeing any error messages. This is an issue with calculations of sales tax.
ZenCart's method of calculating tax appears to be to this (based on my experiments):
- Take each line item in an order
- Calculate the tax on that line, truncating to 2 significant figures
- Add all the calculated subtaxes together to produce the total tax on the order
On my web site, it's possible to order up to 10 different items, all of which cost $6. The sales tax rate I use (for California) is 8.75%. 8.75% of $6 is $0.5250, which should produce a tax of $5.25 on this $60 order. However, because ZenCart truncates the individual tax figures instead of rounding them, or instead of calculating the tax once on the full order amount, when it adds up 10 instances of $0.52, it produces a tax of $5.20. On orders with a large number of small items, this process will unpredictably underestimate the sales tax. I can submit spreadsheets demonstrating the calculations if desired. When I order 3 copies of a $20 item, the sales tax is correctly calculated.
I respectfully request a fix in which more than 2 significant figures are used to calculate sales tax, and rounding rather than truncation is used for display. Undercollecting the sales tax could subject our site to penalties from the CA State Board of Equalization.
Re: Sales tax calculations incorrect.
Just adding a link to related discussion: http://www.zen-cart.com/forum/showth...200#post549200
By way of comment, the problem is worse when tax rates are of a .5 or .75 percentage instead of just a plain integer value.
Re: Sales tax calculations incorrect.
Yes, the related discussion was my original thread on the subject, detailing how I've worked this out.
Unfortunately, a .75 tax rate is what I have to deal with. I don't want to encourage the state of California to raise it to 9% just to make the calculations easier!
Re: Sales tax calculations incorrect.
As I've posted on the other thread that you (hedera) began and which DrByte referenced - I am having this exact problem. Using Quickbooks the numbers do not match up. Tax on an order should be computed by totaling the items - not on a line item basis as that can return an under valued number. I have not found a solution for this - is there one?
Re: Sales tax calculations incorrect.
I've noticed the same problem in a few of my sales when there is a discount and the sales tax is then calculated incorrectly. I haven't been able to find any postings where this has been fixed. Are we all stuck with this or did anyone find a solution?
Re: Sales tax calculations incorrect.
Dr Byte - Is there a way to have zen cart compute tax on the order sub total before shipping instead of on each item and then adding the tax for each item up? This seems to be a bug that should be corrected. Am I mistaken?
Re: Sales tax calculations incorrect.
Should I be posting this in the bug area?
Re: Sales tax calculations incorrect.
You can set the number of decimal places to 3 instead of two -- see Admin / Localization / Currencies. This causes Zen Cart to use 3 decimal places instead of 2 for calculations, but has the unfortunate side effect of showing 3 digits after the decimal everywhere on the site.
So Zen Cart can do the right thing, but may display wrongly. The issue then is to have separate settings in Admin for the decimal places used in calculations and the decimal places displayed. I have no doubt this is on the To Do list displayed prominently in the lobby of Zen Cart's vast and palatial headquarters. :smartalec:
HTH
Rob
Re: Sales tax calculations incorrect.
thanks for the info rstevenson. Will this actually solve the problem even though it might not look too good?
Re: Sales tax calculations incorrect.
Well, it's a simple change to make in Admin, so make the change then run some test orders to see.
It will cause the item costs to be truncated at 3 digits instead of 2 (they still won't be rounded properly) so that will make the addition correct(er), though the fundamental problem -- adding tax to each item rather than to the total -- remains unchanged. At least with 3 digits you'll end up with the right number of cents (if you mentally round the third digit yourself.)
This works fine for those of us who use a disconnected accounting system, but would still cause a small problem -- never more than 1 cent, I think -- for anyone who is using an accounting system directly connected to ZC.
Rob