Results 1 to 10 of 12

Hybrid View

  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
    Nov 2009
    Location
    worcester
    Posts
    3
    Plugin Contributions
    0

    Default Re: Rounding error in Sales Tax

    Hello - any suggestions for this one please??

    I am currently using version 1.3.8 and also having pricing issues.

    I have had the dynamic price updater installed to allow pricing of products that have attributes that affect the final cost.

    It was working great and the price was displaying correctly on the product page (some have two attributes, some have three - all selections affect the price) and correctly also in the cart .......until

    I changed the individual product option to 'taxable goods'.

    Now the price on the product page is always higher (approx 1%) than it should be. If you refresh the page, you can see the CORRECT price very briefly and then it settles INCORRECTLY.

    However, when you add the product to cart, the price reverts back to the CORRECT price that has been set for that particular product!!

    Please see:

    http://www.prestigeringcompany.com/i...roducts_id=377

    I have seen the solutions talked about on this thread, but not entirely sure that this is the same problem as mine, as on the particular product (above) I have NOT split the prices anywhere (for testing purposes) and just put one price into the metal attribute, therefore eliminating any 'rounding up' issues that may occur if having multiple prices split on one product.

    Any suggestions would be very appreciated.

    Thanks

    Darrel

 

 

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

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