Tax calculating wrong on £8.510638 [Issue:Open]
  • scunnyutdscunnyutd April 21

    Hi, I have added a tax code of 17.5% and as far as i can see every product and invoice is displaying the gross, the vat and the invoice totals correctly. However... when I have a product priced at 8.510638 (or 8.51, or 8.5106) the invoice displays the Gross correctly at £8.51 and the VAT correctly at £1.49 but the total invoice amount shows as £9.00 and not as £10.00. The price is stored correctly on the product page and also in phpMyAdmin. If I edit the created invoice and manualy set the price at 8.510638 the invoice total then adds up correctly to £10.00. I have a lot of products at £10.00 including VAT so could you offer any suggestions as to what i'm doing wong! I have created several products and several invoices, each time the total price shows as £9.00 until I manually edit the invoice and add the price of 8.510638. Thanks.

    PHP 5.2.9, MySQl 5.0.45, SUSE 11.0

    I have just tried it on your demo site and it does exactly the same!

    New tax rate of 17.5%
    New Test Item of $8.5106
    It shows correct tax at $1.49
    Then adds them up to = $9 - Not $10

  • scunnyutdscunnyutd April 22

    I've had a little spare time this morning and done a fresh install of si 2010 beta3 but still get the same problem. The version I was using above is si 2010.1

  • justinjustin April 22

    hey scunthorpe fan

    yep - tested and is an issue

    will fix up now

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | SixHQ.com :: Simple Invoices custom development | justin.kelly.org.au
  • scunnyutdscunnyutd April 22

    Thanks Justin, will this be a code fix that I / other users can implement on existing SI 2010.1 ? Many thanks.

  • justinjustin April 22

    the changes can be applied to 2010.1

    refer: http://code.google.com/p/simpleinvoices/source/detail?r=2930 for the files and changes needed to fix this issue

    will be in Simple Invoices 2010.2 beta 5

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | SixHQ.com :: Simple Invoices custom development | justin.kelly.org.au
  • scunnyutdscunnyutd April 22

    I've implemented the code changes but the Invoice Amount is still showing as £9 not £10.

    Gross £8.51 Correct
    VAT £1.49 Correct
    Invoice Amount £9.00 Incorrect

    (After editing the files and making the code changes ncessary do I need to do anything else?)

  • scunnyutdscunnyutd April 22

    I have found that if I enter the item quantity as 2 the total is still only wrong by £1 (this is true of any quantity I add)

    Gross £17.02 correct
    VAT £2.98 correct
    Invoice Amount £19.00 incorrect by £1

  • scunnyutdscunnyutd April 23

    Justin, as this is now marked as closed, and the actual bug is now with" Invoice Total", should I start a new thread? Thanks

  • justinjustin April 27

    hey scunnyutd

    with the adjusted code i tried using your example product cost of 8.510638 and 17.% tax and recorded as $10

    i'll do a new 'beta' release of Simple Invoices later this week some time 2010.2 beta 5 - will include this code

    once its released, please download and retest - hopefully will work OK for you

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | SixHQ.com :: Simple Invoices custom development | justin.kelly.org.au
  • I think this is related to: http://simpleinvoices.org/forum/discussion/732/tax-issue/#Item_14

    The issue seems to be with how the rounding is/isn't done for tax calculation. Generally if a tax calculation is done on an amount that exceeds 2 decimals the value of the 3rd decimal value will be used to round the 2nd decimal value upward if the 3rd decimal value is >=5.

    So for a tax calculated equaling $5.9051 this should equal $5.91 with rounding

    I am not sure how far down you should go. For example if you have a calculated tax of $5.90451. Then should this equal the same $5.91 because the 4th decimal 5 would round the 3rd decimal 4 to 5, which then rounds the 2nd decimal to a 1?

  • scunnyutdscunnyutd April 28

    mrembedded It isn't specifically related to the rounding of the decimal point. If it were the figure would be wrong by 1 pence either way. The actual error on a £8.51 (whatever decimal places..) is that tax is actually calculated correct but the invoice total misses a whole £1 off. Item £8.51, Tax @ 17.5% = £1.49 = Total should = £10, instead it equals £9. Subsequent items and quantities on the same invoice all calculate and add up correctly. It is just an issue with the very first calculation on the first £8.51 sale.

    I will await Justins Beta 5 and update you. (Maybe the issue was fixed with the code update and I have implemented something wrong? we shall see!)

  • i'll try and get beta 5 released in the next few days

    will put up a demo once it out - so we can test online

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | SixHQ.com :: Simple Invoices custom development | justin.kelly.org.au
  • Hi Justin, Not sure what version the online demo is running at the moment? (Perhaps this could be denoted on the page?)

    On the demo, I have just added a tax rate of 17.5% and a product @ £8.5106, invoice total is still $9 and not $10, The tax is showing correctly though. I will download and install beta 5 tomorrow when i'm back in work. If you haven't updated the online demo yet to beta 5 then please disregard / delete this response!

    Many thanks for all your hard work.

  • the demo site has now been upgrade to 2010.2 beta 5, try your 17.5% tax rate example there and let us know how you go

    note: the db gets reset every hour

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | SixHQ.com :: Simple Invoices custom development | justin.kelly.org.au
  • Hi Justin,

    Exactly the same i'm afraid. Item @ 8.51, Tax displayed as 1.49, invoice total at 9.00 and not 10.00. Its on the demo site as we speak. Thanks

  • thanks

    yep - see it in action now

    i;ve disabled the auto-db-refresh thing on the demo site

    will try and get this fixed up asap

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | SixHQ.com :: Simple Invoices custom development | justin.kelly.org.au
  • justinjustin May 10

    hey scunnyutd

    can you try on the demo site again

    i've updated the Zend Framework we use to 1.10.4 and it seems to have fixed the problem

    if it works - you can download the latest Zend Framework and extract the Zend folder in our ./library folder
    - or wait till the next beta

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | SixHQ.com :: Simple Invoices custom development | justin.kelly.org.au
  • Justin,

    Confirmed working. Downloaded and replaced ./library/Zend folder with 1.10.4

    Thanks for a terrific product, and and even better product support.

    All the best

    scunnyutd

  • justinjustin May 10

    great to hear its working!!!

    was freaking out that i made some crazy ass mistake re rounding - but looks to be an issue with the Zend Framework

    by the way, how this scunthorpe united going this season - any chance for promotion?

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | SixHQ.com :: Simple Invoices custom development | justin.kelly.org.au
  • We finished 2 places above relegation (20th out of 24)! However, we are in the second tier of english football which is a lofty height for such a small team! So, overall it was a very successful season :)

  • justinjustin May 11

    good to hear you guys didnt get relegated

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | SixHQ.com :: Simple Invoices custom development | justin.kelly.org.au
  • Hai Justin.,

    This is Mubarak. Could you tell me how to change the $ values into Indian rupees. and how can i give some priviliges to user's like admin can access all those things. but user only acccess some restricted pages. how is posssible in simple invoices.

    Anyine Could known that issue. pls let me know asap. I'm critical situation.

    Thanks in more advance,

  • justinjustin May 26

    hey mubarak

    re $
    - edit the invoice preferences and change the $ symbol to the rupees symbol or whatever you want

    re user rights
    - no really possible right now - this part of Simple Invoices is still a work in progress

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | SixHQ.com :: Simple Invoices custom development | justin.kelly.org.au

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Categories