Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jan 2007
    Posts
    169
    Plugin Contributions
    0

    Default Rounding error in Sales Tax

    ZenCart version: 1.5.9

    In certain minority of cases involving customer orders containing multiple products, there is a rounding error in the computed sales tax and the sales tax paid by the customer is off by one penny. This does not happen often, but more likely to occur when tax percentage is to two decimal places (as in California base tax rate of 8.25%).

    Repro steps:
    1. Create a product "Red Gumball" with price $3.95.
    2. Create product "Blue T-Shirt" with price $8.95.
    3. Set California sales tax to 8.25%.
    4. Have California customer purchase a red gumball and a blue t-shirt with product total of $12.90.
    5. See that ZenCart is charging incorrect tax of $1.07
    6. Expected result: The correct tax to be charged the customer is $1.06 obtained by (12.90 * 0.0825).

    Reason: ZenCart is computing sales tax for each product, rounding, and then totalling. This is wrong. You should not round intermediary calculations.

    The correct order is to total, compute sales tax, and then round.

    Proposed code fix:

    1. Remove the call to zen_round() from zen_add_tax() and zen_calculate_tax() functions in the file includes/functions/functions_taxes.php.

    2. Remove the call to zen_round() from the file includes/classes/order.php

  2. #2
    Join Date
    Jan 2007
    Posts
    169
    Plugin Contributions
    0

    Default Re: Rounding error in Sales Tax

    Sorry, the zencart version that I meant to say was ZenCart version 1.3.8.

  3. #3

    Default Re: Rounding error in Sales Tax

    Sorry, I am new at this. Is this a FIX or a *recommended fix*?

    I am not very comfortable with making changes and want to make sure that I do this correctly.

    Thanks!

  4. #4
    Join Date
    Jan 2008
    Posts
    22
    Plugin Contributions
    0

    bug Re: Rounding error in Sales Tax

    Is there really no solution for this problem?
    I find it very frustrating, and many others.
    This seems to me a bug that should be solved asap.

  5. #5
    Join Date
    Jan 2007
    Posts
    169
    Plugin Contributions
    0

    Default Re: Rounding error in Sales Tax

    To fix the sales tax error on my clients' ZenCart sites, I made code changes as described in learnwebdesignonline.com/tutorials/zencart/sales-tax-error.
    Last edited by Kim; 22 Nov 2009 at 07:29 PM.

  6. #6
    Join Date
    Jan 2008
    Posts
    22
    Plugin Contributions
    0

    Default Re: Rounding error in Sales Tax

    Quote Originally Posted by artcoder View Post
    To fix the sales tax error on my clients' ZenCart sites, I made code changes as described in this tutorial linked here.
    I've tried and it didn't work.

    Can you show me how your follow files look like?
    includes/functions/functions_taxes.php
    includes/classes/order.php
    includes/functions/functions_general.php
    includes/functions/functions_taxes.php

    it's a long shot but maybe i can copy these files to my server and give it a try.

  7. #7
    Join Date
    Feb 2008
    Posts
    27
    Plugin Contributions
    0

    Default Re: Rounding error in Sales Tax

    Hi, i have tried i think everything on this forum regarding the tax rounding problem in Zen Cart.
    I made the changes as in the tutorial and my rounding problems whent away.
    PM me and i can give you those files to compare.
    Best regards Zoli.

  8. #8
    Join Date
    Oct 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: Rounding error in Sales Tax

    Hi,

    Thanks for the tutorial. My prices are now calculating correctly. The only place I have noticed which is still using the old calculation is on the Admin invoice. (Customers > Orders)

    Could anyone help me out with correcting that?

    Thanks,
    Joe

  9. #9
    Join Date
    Jan 2007
    Posts
    169
    Plugin Contributions
    0

    Default Re: Rounding error in Sales Tax

    When I applied the changes in learnwebdesignonline.com/tutorials/zencart/sales-tax-error it fixed the rounding problem as displayed in customer checkout pages as well as in the Admin Orders invoice.

    Note that there are two files that needed to be changed.
    Last edited by Kim; 22 Nov 2009 at 07:30 PM.

  10. #10
    Join Date
    Jan 2007
    Posts
    169
    Plugin Contributions
    0

    Default Re: Rounding error in Sales Tax

    This rounding issue and fix only applies to version 1.5.8 -- not 1.5.9.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. 1.3.8 a Tax calculation rounding error
    By chandroo007 in forum General Questions
    Replies: 1
    Last Post: 11 Jul 2011, 07:50 AM
  2. New York State Sales Tax by Zip Full Database for Local Sales Tax Mod 2011
    By SCHNiKEN in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 0
    Last Post: 11 Apr 2011, 04:51 AM
  3. Sales Tax Rounding error in Zen Cart 1.3.9d
    By wilorc in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 29 Jul 2010, 06:58 AM
  4. Replies: 11
    Last Post: 23 Jul 2010, 11:49 AM
  5. Tax Rounding Error - zen 137
    By DogTags in forum Bug Reports
    Replies: 2
    Last Post: 6 Oct 2007, 04:46 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR