Jump to content

tax rounding incorrectly


KirkM
 Share

Recommended Posts

A client in California has noticed that occasionally the tax is rounded to the wrong penny.  As illustrated below, his tax rate is a flat 9% and the total of $140.04 at 9% would be .09 x 140.04 = 12.6036.  This should round DOWN to $12.60.  However, CC 6.4.4 is rounding it UP to $12.61.  My wild guess is that there is other rounding taking place upstream that is delivering something above 12.605 to the final tax rounding or something like that but I really have no idea.

Has this been seen before?

Screen Shot 2022-07-01 at 9.02.43 PM.png

Link to comment
Share on other sites

  • 4 weeks later...

It seems to be a rounding issue: not a miscalculation in the rounding function, but rather when and on what the rounding takes place.

56.96 * .09 = 5.1264 | ( 5.13)
39.96 * .09 = 3.5964 | ( 3.60)
43.12 * .09 = 3.8808 | ( 3.88)
=====================   =====
             12.6036   (12.61)

Rounding the total of 12.6036 returns 12.60.

Then there is the rounding on each individual item, then that is summed.

If I recall from looking at the code, the tax per each individual item is the method CubeCart uses. (A mix of tax rates is averaged, then applied to each individual item.)

This requires an answer to the question, regarding the algorithm used to calculate the tax values, has the method changed from an earlier version of CubeCart? If so, when did the change happen and the reason why.

I could scan for changes in the related code, but if there was a change in the algorithm, I have no insight as to why.

A wild guess would be to conform to the very specific legal language in the tax laws. Does the language say to apply the tax rate to the sub-total, or does the language say to apply the tax rate to each item? (I have the impression CubeCart has no interest in doing the research for an answer.) If there is a difference between UK (EU) laws and US laws, should there be an administrative setting to configure CubeCart based on the merchant's home locality? (Which is a squirrely proposition to solve as each locality in the US gets to force merchants to follow their residents' tax rates/laws - if one wants to argue that point.)

 

 

Link to comment
Share on other sites

Posted (edited)

Thanks Brian for confirming my suspicion that there was individual item cascade rounding going on instead of sum subtotal rounding.  I am pretty sure in the U.S. that the tax is always applied to a taxable subtotal.  Even if there are exempt items in a purchase, they are just supposed to be excluded from the subtotal taxability (sort of a ghost subtotal for tax calculation).  A penny isn't a huge deal, but his problem is it doesn't square up with his accounting books and for his state tax reporting.  Technically, he is illegally charging too much tax when this anomaly occurs.  While no one thinks he is looking at jail time for a few cents here and there, it is wrong, at least in this country and / or state.  

It would be interesting to know if this is a response to UK or EU tax codes.  If not, then it is a flawed process that has yielded this issue.  Alas, it appears I will have to go back to him, shrug my shoulders and tell him not much I can do at this point.

Appreciate your help sir, as always.

Edited by KirkM
Link to comment
Share on other sites

If either of you have a CPA, perhaps an innocent query could reveal exactly how your client's home tax is determined -- hopefully no difference between Federal, State, County, and City tax computation rules -- and no difference between other states' tax computation rules if required to collect and forward.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...