Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Location
    France
    Posts
    600
    Plugin Contributions
    8

    Default Admin rounding errors

    I have an issue with rounding errors in admin using version 1.5.3.
    I thought these had been resolved in 1.5 but i've just tested a completely clean install of 1.5.3 using the same tax settings as the client site and there is indeed an issue.
    Tax is set at 20%. Product price including tax is 6.99 which when entered into Products Price (Gross) on the product entry page is automatically calculated as 5.825 in the Products Price (Net) entry field. Preview page changes this to 2 decimal places making it 5.83. Tax added to 5.83 is 7.00. Tax added to 5.825 is 6.99

    The product list in admin shows the product as 7.00 as do any order pages and invoices. Store side shows the correct value of 6.99

  2. #2
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Admin rounding errors

    Quote Originally Posted by strelitzia View Post
    I have an issue with rounding errors in admin using version 1.5.3.
    I thought these had been resolved in 1.5 but i've just tested a completely clean install of 1.5.3 using the same tax settings as the client site and there is indeed an issue.
    Tax is set at 20%. Product price including tax is 6.99 which when entered into Products Price (Gross) on the product entry page is automatically calculated as 5.825 in the Products Price (Net) entry field. Preview page changes this to 2 decimal places making it 5.83. Tax added to 5.83 is 7.00. Tax added to 5.825 is 6.99

    The product list in admin shows the product as 7.00 as do any order pages and invoices. Store side shows the correct value of 6.99
    This thread might give you a clue: http://www.zen-cart.com/showthread.p...94#post1254894

  3. #3
    Join Date
    Nov 2005
    Location
    France
    Posts
    600
    Plugin Contributions
    8

    Default Re: Admin rounding errors

    Just looked at your thread. Interesting. I'll give your code changes a go and see if it resolves the issue.
    TBH, if this issue really has been around since 2008 it's ridiculous that a major flaw such as this has not been addressed!
    Devs, If this is the case, care to comment why this hasn't been resolved?

  4. #4
    Join Date
    Nov 2005
    Location
    France
    Posts
    600
    Plugin Contributions
    8

    Default Re: Admin rounding errors

    I made the edits listed by frank18 to a vanilla 1.5.3 and it didn't fix the admin displayed price issue so further help is going to be needed.
    The store side is showing the correct price of 6.99 but admin stubbornly shows 7.00

    Making the Net price only 2 decimal places wouldn't fix the problem as 20% tax on 5.82 is 6.984
    It will only work if it uses the full 5.825 value.
    It must be feasible as the store side can calculate it from the figure stored in the database.

  5. #5
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Admin rounding errors

    Quote Originally Posted by strelitzia View Post
    I made the edits listed by frank18 to a vanilla 1.5.3 and it didn't fix the admin displayed price issue so further help is going to be needed.
    The store side is showing the correct price of 6.99 but admin stubbornly shows 7.00

    Making the Net price only 2 decimal places wouldn't fix the problem as 20% tax on 5.82 is 6.984
    It will only work if it uses the full 5.825 value.
    It must be feasible as the store side can calculate it from the figure stored in the database.
    Did you also apply the change in admin/includes/functions/functions_prices.php ?

    PHP Code:
    return number_format($blah_blah_variable2'.'''); 

  6. #6
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Admin rounding errors

    Searching through my live 1.5.3 site I noticed that I had made one other change in admin/functions/functions_prices.php

    starting around line 90

    PHP Code:
          if (!$special_price) { 
            return 
    number_format($sale_product_price2'.'''); // number_format changed from 4 to 2 decimals - frank18 
          
    } else { 
            switch(
    $sale->fields['sale_specials_condition']){ 
              case 
    0
                return 
    number_format($sale_product_price2'.'''); 
                break; 
              case 
    1
                return 
    number_format($special_price2'.'''); 
                break; 
              case 
    2
                return 
    number_format($sale_special_price2'.'''); 
                break; 
              default: 
                return 
    number_format($special_price2'.'''); 
            } 
          } 
    Didn't think that was relevant for your purpose as it deals with specials - but worth a try in your vanilla 1.5.3 installation

 

 

Similar Threads

  1. USPS Rounding Errors -- Should never round down
    By TraderDan in forum Built-in Shipping and Payment Modules
    Replies: 20
    Last Post: 10 Aug 2009, 03:07 PM
  2. product quanitites cause VAT Rounding Errors
    By guyp in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 6 Jun 2008, 11:10 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