Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Join Date
    Feb 2007
    Posts
    18
    Plugin Contributions
    0

    Default [Done v2.0]Currency Rounding Issues with quantity discounts

    I am using zen cart 1.3.8a and have an issue with currency rounding that is causing me an issue with quantity discounts.

    I have a currency rate value set at 1.14999998

    I have a product which has a quantity discount set for 4 @ 2.17 which gets rounded to 2.50 in the display.

    Unfortunately the cart total shows as 2.5 * 4 = 9.98 instead of 10.00.

    It would appear that rather than the displayed rounded value of 2.5 being multiplied, the un-rounded value of 2.17 * 1.14999998 = 2.4954999566 is being multiplied by 4 which does in fact round to 9.98.

    Is there anyway for me to get zen cart to multiply the first rounded number of 2.5?

  2. #2
    Join Date
    Feb 2007
    Posts
    18
    Plugin Contributions
    0

    Default Re: Currency Rounding Issues

    I should point out also that I am not charging sales tax so there should be no calculation issue with this aspect.

  3. #3
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,925
    Plugin Contributions
    4

    Default Re: Currency Rounding Issues with quantity discounts

    You could try this fix here.

    http://www.zen-cart.com/forum/showpo...3&postcount=25

    However, have to ask, the link to your website shows that you are based in the UK. Why are you using any conversion rate at all. ?

  4. #4
    Join Date
    Feb 2007
    Posts
    18
    Plugin Contributions
    0

    Default Re: Currency Rounding Issues with quantity discounts

    Yeah, I tried that already and it didn't help. Presumably the code that generates the price using this function specifies the precision? Is there any reason why this can't be changed to be the same presision as the code that generates the prices that are displayed and where would this be done?

    Alternatively simply multiplying the displayed price (which is rounded to 2 decimal places) would seem like a good plan no?

    Regarding the reasons why I am usng a currency multiplier whilst residing in the UK. I am not charging tax currently although I perceived that I might be and so I inputted all my prices as net of what the vat would be, set tax at 0% and currency to the current vat rate is (for some reason, and I can't remember why, this came out at a strange number of 1.4999...). I figured If I neded to charge vat I would simply create a vat rate and change the currency rate back to 1 and hey presto (all the products have tax classes set where appropriate to make this work).

    I know I could have written a script to amend the the prices in the db but this would have taken longer

  5. #5
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,925
    Plugin Contributions
    4

    Default Re: Currency Rounding Issues with quantity discounts

    Hi,

    The precision is usually based on the currency settings. Which for GBP is always 2, so there's no real reason to change that.

    And again, i'm still confused about your reasons for putting the multiplier in.

    If all of your products are set as 'taxable' but no tax rates are set, then you won't charge VAT at output.

    If later on, you become vat registered, then you only need to set the tax rate, not change all your product prices.

  6. #6
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,925
    Plugin Contributions
    4

    Default Re: Currency Rounding Issues with quantity discounts

    And in fact,

    Surely all the prices you have displayed will include the multiplier. so are not VAT exclusive prices.

    ?????

  7. #7
    Join Date
    Feb 2007
    Posts
    18
    Plugin Contributions
    0

    Default Re: Currency Rounding Issues with quantity discounts

    I will continue to charge the same amount for the items when VAT registered, so I would have had to ammend the prices down, otherwise they would appear to have gone up by the VAT rate when applied? The fact that an element of the sale price then become vat is offset by the fact that I payed the vat when I bought the items.

    This aside, because it is slightly off topic initself anyway, there still exists a calculation issue and whilst the currency is displayed to 2 decimal places calculations made within the code do not honour this as outlined in my first post where I show how it has calculaed it. There must be somewhere I can change the precision on the price before it is subjected to the quantity multiplier.

    I could see this being an issue generally when people are using multiple currencies?

  8. #8
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,925
    Plugin Contributions
    4

    Default Re: Currency Rounding Issues with quantity discounts

    Hi,

    I don't disagree that the rounding problem is separate from the issue of how you have set up your tax regimen :)
    Was just trying to understand your setup.

    I'll try and reproduce this on a stock 138 install and get back to you.

  9. #9
    Join Date
    Feb 2007
    Posts
    18
    Plugin Contributions
    0

    Default Re: Currency Rounding Issues with quantity discounts

    I know it is a bit of a fudge but it seemed the easiest solution at the time.

    Let me know how you get on with reproducing the problem - I eagerly await

  10. #10
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,925
    Plugin Contributions
    4

    Default Re: Currency Rounding Issues with quantity discounts

    Just another point,

    You used 1.14999998 as the rate value. Strictly speaking as the current VAT rate is 15%, that should be 1.15,

    Not much difference, but important.

    I don't want to harp on about VAT (as this is really a subject for an accountant) , as opposed to the bug itself, but do you realise that if you do become VAT registered, and therefore liable to pay the VAT on your ouptuts you will in fact be making less profit per item. ?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Quantity Discounts with salesmaker
    By dmagic in forum General Questions
    Replies: 3
    Last Post: 25 Jun 2013, 09:34 PM
  2. Replies: 5
    Last Post: 10 Sep 2009, 10:33 PM
  3. Rounding error with Quantity Discount
    By Ryk in forum General Questions
    Replies: 3
    Last Post: 30 Sep 2008, 08:49 PM
  4. Replies: 2
    Last Post: 18 Jan 2008, 09:39 PM
  5. Replies: 5
    Last Post: 11 Jun 2007, 05:59 PM

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