Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14
  1. #11
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,489
    Plugin Contributions
    88

    Default Re: Tax display off by a penny for some tax rates

    I now believe that at least part of the rounding-related issues might be due to various castings to (float).

    Take a "simple" case:

    A $1.00 product taxed at 0.055% with free shipping is added to the cart. On entry to the 'checkout_payment' page, the order's "Tax" improperly displays as $0.05 while the order's total properly shows $1.06.

    The issue is that the value recorded in the order's tax_groups for that product is 0.05499999999999994 which, when rounded to 2 significant digits, is 0.05!

  2. #12
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Tax display off by a penny for some tax rates

    Quote Originally Posted by lat9 View Post
    The real question is: At what point should tax-related rounding occur?

    Zen Cart pricing/tax calculations get rounded by the order- and shopping-cart classes and various payment methods and order-totals, so that each taxed addition (or subtraction) from an order's pricing is rounded (or not) at the hands of the module that's making that change to the order's totals.

    I guess the question is whether any tax additions/subtractions from the order should be performed with or without rounding, leaving the final rounding operation to the ot_tax module.
    While in the US it is typically done one way, some other countries do treat it other ways. The answer would need to start with determining whether tax is initially charged at the per-item level vs the per-item-times-its-quantity level vs the all-items-of-that-tax-class level, as that affects the initial rounding strategy. Then an order-edit module would follow accordingly.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #13
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: Tax display off by a penny for some tax rates

    I have lost count of how many threads or posts there are about rounding errors. It seems way overdue that this issue is resolved.
    So, if the issue is the tax basis
    whether tax is initially charged at the per-item level vs the per-item-times-its-quantity level vs the all-items-of-that-tax-class level,
    In my case (Spain), tax is added on the sub-total of all items within a tax group.

    What is the roadmap for resolving this - can a discussion be initiated to determine all the possible tax basis?
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  4. #14
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,489
    Plugin Contributions
    88

    Default Re: Tax display off by a penny for some tax rates

    Quote Originally Posted by torvista View Post
    I have lost count of how many threads or posts there are about rounding errors. It seems way overdue that this issue is resolved.
    So, if the issue is the tax basis

    In my case (Spain), tax is added on the sub-total of all items within a tax group.

    What is the roadmap for resolving this - can a discussion be initiated to determine all the possible tax basis?
    Good idea! I've created this (https://www.zen-cart.com/showthread....ndling-methods) post as starting point to gather the taxation requirements (and underlying algorithms) required for the various localities.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v154 Tax rates, shopping cart spiltting tax rates
    By jwlamb in forum General Questions
    Replies: 0
    Last Post: 24 Mar 2015, 08:20 PM
  2. What is best tax plugin to auto-set tax rates for Canada/US?
    By crexis in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 21 Jul 2013, 03:23 AM
  3. Display prices with TAX and without tax
    By liizz in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 3
    Last Post: 3 Aug 2011, 03:29 AM
  4. Rounding tax rates, result wrong tax.
    By Swech in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 1
    Last Post: 7 Jul 2009, 02:22 PM
  5. Local tax rates to add to state tax
    By terrykiwi in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 18 Feb 2008, 04:02 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