Post by waynebr76 » Wed Jul 12, 2017 3:36 am

I have seen various topics on this subject but have not found a solution yet. On my site many products which are price at £9.99 including 20% tax included. If someone orders 3 of these this works out £29.97 Inc Vat however the calculations do not work out. The subtotal shows as £24.98 & the tax at £5.00 which totals £25.98.
I know that this is a rounding issue and if I change my decimal places to 4 then the calculations are correct but it does not look right when displayed in the front end.
The product price in admin is set to 4 decimal places £8.3250 as this is the only way to get it to be at the correct price of £9.99.

Where am I going wrong or what do I need to do to get the calculations to work properly?

New member

Posts

Joined
Tue Aug 27, 2013 6:12 am

Post by artcore » Wed Jul 12, 2017 4:36 am

You have to enter a price at 8.32 to get to 9.99 at the frontend?
My hunch would be that your currency values are not 1 for Pound. Check admin>localization>curencies and set them at 1 and disable currency updates in the store settings.
It might not get rid of rounding fully until you change to 8 decimals which is a database adjustment. You'll find some more on the forum about that too.
Cheers

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by waynebr76 » Wed Jul 12, 2017 4:50 am

Hi thanks for the reply 8.32 gives a front end value of 9.98, my currency is 1.00000000. I've looked through the forum and cannot find a fix, it's surprising given that this appears as an issue on all versions of Opencart. If anyone knows of a fix it would be appreciated.

New member

Posts

Joined
Tue Aug 27, 2013 6:12 am

Post by Johnathan » Wed Jul 12, 2017 11:19 pm

This may not work for you, but you can try the edit I post here:

viewtopic.php?f=110&t=184159#p674522

That should round the tax values to 2 decimals.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by waynebr76 » Thu Jul 13, 2017 12:54 am

THanks I can't find the file using that route, i'm using 2.3.0.2

New member

Posts

Joined
Tue Aug 27, 2013 6:12 am

Post by Johnathan » Thu Jul 13, 2017 1:07 am

There are two file references in the edit. For 2.3 or later, use the second file reference.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by waynebr76 » Thu Jul 13, 2017 1:15 am

Thanks that didn't quite work, what I have at the moment is
Product price £9.99
Subtotal = £8.33
VAT = £1.67 (£10 total)
If I make this adjustment it makes the total £10 which is correct according to OC's calculations of subtotal & VAT but the actual price is £9.99 not £10

New member

Posts

Joined
Tue Aug 27, 2013 6:12 am

Post by Johnathan » Thu Jul 13, 2017 1:40 am

Unfortunately that's not something that's solvable by rounding. If you have a 20% tax on a product with a price of 8.33, the tax calculation will be 1.67, which is a total of 10.00. If you changed the price to 8.32 it would calculate tax of 1.66, but that would be a final total of 9.98. So that would still be off.

If you need a final price of exactly 9.99, you're going to need to find a modification that allows you to specify prices including tax, instead of without tax. There's no way around that in the normal tax system without modifying it, and it would likely be more complex than the one-line edit I suggested.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by waynebr76 » Thu Jul 13, 2017 1:53 am

Thanks I'm surprised that this hasn't been picked up by Opencart, I can see many people have the same issue i'm surprised that the code doesn't make the subtotal & Tax add up to the total of all products. I don't get this issue with my till or my accounting package as I put the price including tax and then it performs the calculation.

New member

Posts

Joined
Tue Aug 27, 2013 6:12 am

Post by waynebr76 » Thu Jul 13, 2017 2:13 am

Thinking about it, as each sale is below £250 I believe I can use a simplified invoice in the UK, this means I can remove all tax and then let my accounting package manage the VAT element. I would prefer to have Opencart provide the correct calculations but it may be easier to forget about TAX and Opencart until such a day as they can make write the code so that the calculations are correct.

New member

Posts

Joined
Tue Aug 27, 2013 6:12 am

Post by Johnathan » Thu Jul 13, 2017 10:47 pm

Setting prices including tax has been a feature request by many users, but Daniel hasn't implemented it up until now. I don't know if it's on his list for the future or not, but there are some extensions that can do it if you find you need that in the future.

If you can't find one that works well, feel free to send me a message at www.getclearthinking.com/contact and I can see about creating a full-featured one.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by waynebr76 » Thu Jul 13, 2017 11:53 pm

Thanks, I saw some extensions but unfortunately I also use Openstock so then I would need to pay to get this amended too, It's already cost quite a bit in extensions / custom work and at the moment I don't have the budget to fix something that should work as standard. Strangely since I noticed this issue I can tell which sites use Opencart when I place online orders as they appear to have the same issue.

New member

Posts

Joined
Tue Aug 27, 2013 6:12 am
Who is online

Users browsing this forum: No registered users and 418 guests