Falcon Media Posted January 10, 2007 Share Posted January 10, 2007 When generating an order with the TAX value shown as 17.5% the order initially shows a figure which at invoice end differs as it appears that it rounds the figure down tothe nearest penny and not up. e.g. If you generate a product which is £35.00 + tax... The order screen shows tha total correctly at £41.13 but when it comes to the invoice stage it rounds it down to £41.12 Anything that can be done in the code here? Thanks 0 Quote Link to comment Share on other sites More sharing options...
ozzie Posted January 10, 2007 Share Posted January 10, 2007 I'm not confirming this observation, just commenting. I think tax rounding should be neither up nor down. As a rule it should be to the nearest cent. i.e. >=0.005 = 0.01 and < 0.005 = 0.00 The other issue is what to round and when. Say a price is 61.355 (just for argument sake) 10% tax is 6.1355 Total is 67.4905 ROUNDED > 67.49 In this case the Australian tax office would expect to receive 6.14 (10/110*67.49) IMHO, on the invoice, the rounding should be goods 61.355 = 61.36 tax 10% 6.1355= 6.14 invoice total 67.50 (no rounding necessary) tax payment 10/110*67.50 = 6.14 Just another thought, is PHP rounding always accurate? I remember... many moons ago... when I used to code the odd BASIC program or two, we used to get rounding errors. I stopped using the round() function and used my own instead (add .005 and truncate) Cheers from Downunder, Ozzie __________________ /me Australian (thats my excuse and i'm stickin to it. 0 Quote Link to comment Share on other sites More sharing options...
s1rk3ls Posted January 14, 2007 Share Posted January 14, 2007 In his example, it would come out to 41.125 which should be rounded to 41.13 (If on the other hand, it had been 41.124, then yes... rounding to 41.12 is fine) I believe PHP's round() function will do this properly - it sounds as if the invoice is just trimming it to 2 decimals rather than rounding. But I dunno, just adding my own comment. I finally had the chance to download and install WHMCS Beta R2 today and play with it a little.. I can't wait for the release so I can start using some of the new features for my customers (such as Tax and being able to assign affiliates to orders, and so much more!) 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted January 14, 2007 WHMCS CEO Share Posted January 14, 2007 I can't recreate this issue so I'm going to assume it's fixed or not a bug. All amounts are rounded either up or down to 2 digits already. 0 Quote Link to comment Share on other sites More sharing options...
ptnetworks Posted January 24, 2007 Share Posted January 24, 2007 In V3 Beta 2 they are not rounding, i have the same problem. Ruben 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted January 26, 2007 WHMCS CEO Share Posted January 26, 2007 In V3 Beta 2 they are not rounding, i have the same problem. Ruben Are there any specific details you can provide about this so it can be recreated? Like when this happens and where? What amounts are being used, what tax rate is set, etc...? Matt 0 Quote Link to comment Share on other sites More sharing options...
ptnetworks Posted January 26, 2007 Share Posted January 26, 2007 Hello, When i create a invoice of 7€ with inclusive tax it gives: Sub-Total=6.08 and the Tax=0.91 so that is 6.99 and not 7€ Regards Ruben 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted January 26, 2007 Share Posted January 26, 2007 that doesnt make sense, 6.99 would be the correct total. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted January 26, 2007 WHMCS CEO Share Posted January 26, 2007 What tax rate do you have setup? 13%? 0 Quote Link to comment Share on other sites More sharing options...
ptnetworks Posted January 26, 2007 Share Posted January 26, 2007 Sorry, the tax is 15% 7 / 1.15 = 6.086 = 6.09 Regards Ruben 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted January 26, 2007 WHMCS CEO Share Posted January 26, 2007 Hi, This seems to be working on my local copy here so I think some changes since the R2 BETA must have corrected this issue. Matt 0 Quote Link to comment Share on other sites More sharing options...
ptnetworks Posted January 26, 2007 Share Posted January 26, 2007 Good So will wait to the new release. Thanks Ruben 0 Quote Link to comment Share on other sites More sharing options...
ozzie Posted March 2, 2007 Share Posted March 2, 2007 Hi, This seems to be working on my local copy here so I think some changes since the R2 BETA must have corrected this issue. Matt Matt, I'm sorry, but something is definitely wrong and should be looked at: situation analysis: program License Type: Owned License License Expires: Never Version: 3.0.0 ------------------------------------ salex tax rule AU = 10.0% sales tax exclusive switch = ON price 14.95 Tax Product = ON Client Country = AU Tax client = ON ------------------------------------ results: On screen order shows OK product 14.95 sales tax 1.50 total 16.45 Order Confirmation email Cpanel Hosting - Bronze Plan (tax-enabled.com) Amount: $14.95 AUD Monthly <<=============== no tax showing Total: $16.45 AUD Invoice confirmation Bronze Plan - tax-enabled.com (02/03/2007 - 02/04/2007) $14.95 AUD ------------------------------------------------------ Sub Total: $14.95 AUD Credit: $0.00 AUD 10.00% Tax Due: $1.49 AUD <<========should be 1.50 Total: $16.44 AUD <<===============should be 16.45 ------------------------------------------------------ Invoice $14.95 AUD Sub Total: $14.95 AUD Credit: $0.00 AUD 10.00% Tax Due: $1.49 AUD Total: $16.44 AUD I will repeat this test with sales inclusive Kind regards, Ozzie 0 Quote Link to comment Share on other sites More sharing options...
xTiNcTion Posted March 2, 2007 Share Posted March 2, 2007 hi ozzie, i had the same issues (tax no showing) + 0.01 differs (wrong calc...) tax no showing in order confirmation email is still an issue i just cut-off that part and only show [Product] and [Amount]. remember an invoice is send at the same time. hope this get fixed soon. about the 0.01 minus. i reported that error since v3 release. Matt said it was because of the database version i use (MySQL 4.x), uhh? he did "some code changes" and issue get fixed. Later (a couple of day ago) i re-installed whmcs to get "all this files update" (bug report fixed) thinking that all of them was included in the zip. in my case, it seems this 0.01 issue get fixed. but this "no tax showing" is new. hehe.... if you wonder where is the file that fixe 0.01 ?? i narrowed down to "include" folder. so download the .zip from client area and upload that folder (binary mode). NOTE: it's a good idea to make a backup of "include" folder on your server before u upload the new one. 0 Quote Link to comment Share on other sites More sharing options...
ozzie Posted March 2, 2007 Share Posted March 2, 2007 Same settings as before except for sales tax inclusive switch = ON order step 4 $16.45 AUD Subtotal: $14.95 AUD GST @ 10.00%: $1.50 AUD Total Due Today: $16.45 AUD Total Recurring: $16.45 AUD Monthly Heh, this looks promising invoice $16.45 AUD Sub Total: $14.95 AUD Credit: $0.00 AUD 10.00% Tax Due: $1.49 AUD Total: $16.45 AUD Pitty, wrong again Order Confirmation email Cpanel Hosting - Bronze Plan (tax-inclusive.com) Amount: $16.45 AUD Monthly no tax showing Total: $16.45 AUD This was to be expected. Not as dramatic on this instance since the advertised price would have been $16.45, still should be shown for consistency. Invoice confirmation email Bronze Plan - tax-inclusive.com (02/03/2007 - 02/04/2007) $16.45 AUD ------------------------------------------------------ Sub Total: $14.95 AUD Credit: $0.00 AUD 10.00% Tax Due: $1.49 AUD Total: $16.45 AUD ------------------------------------------------------ Over to you Matt. Kind regards, Ozzie 0 Quote Link to comment Share on other sites More sharing options...
ozzie Posted March 2, 2007 Share Posted March 2, 2007 hi ozzie, out the 0.01 minus. i reported that error since v3 release. Matt said it was because of the database version i use (MySQL 4.x), uhh? Mmmm, Sounds like a strange proposition to me, I've never heard of a database engine of any sort, causing rounding errors. Usually it's not the database doing calculations of any kind. But, I'm willing to learn and look forward to a further explanation from the experts. Cheers, Ozzie 0 Quote Link to comment Share on other sites More sharing options...
Dominic Posted March 2, 2007 Share Posted March 2, 2007 Bankers' rounding maybe? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted March 2, 2007 WHMCS CEO Share Posted March 2, 2007 The order confirmation email not showing the tax is a known issue in V3. For the rounding error, you'll need to open a ticket so I can take a look. Matt 0 Quote Link to comment Share on other sites More sharing options...
ozzie Posted March 3, 2007 Share Posted March 3, 2007 The order confirmation email not showing the tax is a known issue in V3. For the rounding error, you'll need to open a ticket so I can take a look. Matt OK, ticket raised. Cheers, Ozzie 0 Quote Link to comment Share on other sites More sharing options...
ozzie Posted March 4, 2007 Share Posted March 4, 2007 The order confirmation email not showing the tax is a known issue in V3. For the rounding error, you'll need to open a ticket so I can take a look. Matt And Matt looked and it was good. Problem solved. FOR ALL YOU CURIOUS PEOPLE OUT THERE The solution is : An upload of the latest V3.0.0 files (which I thought I had from a 5 Feb 2007 download...) Cheers, Ozzie 0 Quote Link to comment Share on other sites More sharing options...
xTiNcTion Posted March 4, 2007 Share Posted March 4, 2007 Problem solved. FOR ALL YOU CURIOUS PEOPLE OUT THERE The solution is : An upload of the latest V3.0.0 files (which I thought I had from a 5 Feb 2007 download...) Cheers, Ozzie for tax issue or rounding one? 0 Quote Link to comment Share on other sites More sharing options...
ozzie Posted March 4, 2007 Share Posted March 4, 2007 for tax issue or rounding one? That's the rounding one. The confirmation email is a known problem, as Matt said. So I assume it will be corrected in a future release. And so it should, I think, but it is not a showstopper for me. The rounding issue was. Cheers, Ozzie 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.