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
hey scunthorpe fan
yep - tested and is an issue
will fix up now
cheers
justin
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
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
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?
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
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
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
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
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
good to hear you guys didnt get relegated
cheers
justin
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,
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
It looks like you're new here. If you want to get involved, click one of these buttons!