Post by teratyke » Sat Aug 06, 2011 1:52 am

Hi
I'm afraid this is another tax problem - I've read lots of posts trying to solve similar issues, but I just can't find the answer to this problem. This is starting to give me a headache now so I need help please.

I believe everything is set up correctly - I've not adjusted the order total settings. I'm using 1.5.1.1.

e.g.
item £5.33 (actual item price -tax is 5.3250)
shipping £1.66 (actual shipping cost -tax is 1.6584)
tax (20%) £1.40
Total = £8.38 (It should be 8.38, but because of the rounding those numbers actually add up to 8.39)
Capture.JPG

Capture.JPG (14.16 KiB) Viewed 16680 times

The problem I'm sure is because the prices less vat are being rounded to two decimal places for display in the order confirmation page.

Just to make it extra confusing the order total passed seems to vary on payment method - with paypal its 8.39 with other methods eg sagepay its 8.38.

Thanks
Rob

Active Member

Posts

Joined
Sun Jun 12, 2011 3:05 pm

Post by teratyke » Sat Aug 06, 2011 4:27 pm

I suppose I can live with the fact that the totals don't add up in the cart - because I can explain it based on the fact that its a four decimal place number rounded to two decimal places - not the end of the world.

However, the more I think about it the more I realise the real problem is that paypal customers get charged an extra penny - its because each line (after rounding) is being passed to paypal, I least I think it is.


Ok the same order - two different payment methods...
Here is the total as shown on the confirmation step - the total is correct (even if the lines don't add up to the total)..
confirm.JPG

confirm.JPG (16.89 KiB) Viewed 16670 times

PayPal has the incorrect total...
paypal.JPG

paypal.JPG (25.33 KiB) Viewed 16672 times

Sage pay (or cheque, bank transfer etc) has the correct total... because I think the total has been calculated with 4 decimal places is...
sage.JPG

sage.JPG (31.77 KiB) Viewed 16672 times


Active Member

Posts

Joined
Sun Jun 12, 2011 3:05 pm

Post by markman-b » Mon Sep 05, 2011 8:13 pm

Strange that no one has replied on this message. I can hardly imagine that Rob and I are the only two OC users who're dealing with this issue...

I posted this message today: http://forum.opencart.com/viewtopic.php?f=20&t=40181
it describes the same problem Rob found out earlier.(found Robs message by coincidence)
Last edited by markman-b on Tue Sep 06, 2011 1:10 am, edited 1 time in total.

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by teratyke » Tue Sep 06, 2011 1:04 am

Hello markman-b
I didn't solve the problem, but I did find a partial solution and at least an explanation of sorts.
There are problems with PayPal totals and there are a few threads discussing solutions to this - I found my own solution which was to pass only the order total to PayPal. See here...
http://forum.opencart.com/viewtopic.php?f=113&t=36916
... there may be better ways.

So now the total should be consistent regardless of which payment method is chosen.
I still have a discrepancy though between the total shown at the last step of checkout and the total passed to the chosen payment system (eg paypal) and that is because of rounding and I cannot find a simple solution. Its easy to explain to the customer (but I wish I didn't have to). Because less tax prices are shown to the customer on the last step of checkout and these are rounded to two decimal places, they may differ to the four decimal place rounding that is actually used to calculate the total amount paid.

Hope that makes sense and helps. Happy to discuss this further.

Active Member

Posts

Joined
Sun Jun 12, 2011 3:05 pm

Post by markman-b » Tue Sep 06, 2011 1:20 am

Hi mate,

I know exactly what you mean. Thanx for your link including your temporary solution, but I can not accept this 'bug'.
It will take me too much time to explain it every time to customers. And finally, it is amateurish when different order amounts are displayed.

If no one responds I'll post a bugreport. We keep each other informed, okay?

Kind regards,
Markman

EDIT:
Just installed the XML file: thanx!

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by sb65 » Tue Sep 20, 2011 9:25 pm

Hi both

I've just spotted this same discrepancy with Paypal Standard this morning. I'm using OC 1.4.9.5.

I originally had "whole pence" VAT inclusive prices which resulted in VAT exclusive prices to 4dp in some places. When the order is passed to Paypal, Paypal sums the VAT exclusive prices again, rather than using the subtotal, with the result that the Paypal total sometimes doesn't match the total on the checkout screen because of rounding issues.

In an attempt to fix this I tweaked the VAT exclusive price to whole pence, which resulted in the figure being passed to Paypal matching that on the checkout screen, but the total on the screen then doesn't add up because the sum of the VAT inclusive prices is wrong. However, at least the Paypal total is correct.

As a medium term fix, I intend to tweak my VAT exclusive prices to an amount which is divisible by 5, which with a VAT rate of 20% means that both the VAT exclusive and VAT inclusive prices will be in whole pence, so the rounding problem goes away. I think this will handle things up to the point that VAT is changed to 17.5%.

Not quite sure myself that this is a bug in Opencart - is it perhaps just a facet of rounding?

New member

Posts

Joined
Tue Sep 20, 2011 9:18 pm

Post by teratyke » Tue Sep 20, 2011 10:44 pm

Hi sb65
Those findings seem to match my own - I considered tweaking my prices in the way you are proposing to do, but I hadn't managed to sit down and work out how I was going to do that, so thank you for your divisible by 5 idea - makes perfect sense.
Thanks
Rob

Active Member

Posts

Joined
Sun Jun 12, 2011 3:05 pm

Post by sb65 » Tue Sep 20, 2011 11:06 pm

Glad it was helpful Rob.

Just finished changing all my prices, and it does seem to have had the desired effect. Given that prices are variously displayed as both VAT inclusive and VAT exclusive I can't at the moment see any way of ever getting both the totals to add up correctly without "fudging" the prices - not because of any limitation in Opencart but just because of the rounding problem.

Simon

New member

Posts

Joined
Tue Sep 20, 2011 9:18 pm

Post by kpdirection » Fri Sep 23, 2011 4:26 am

I'm in the same boat.

Client called today, and told me that the system is adding up totals incorrectly. She's not happy, and I'm getting flak for recommending an e-commerce system that doesn't work.

Yes, it's just out by 1c; but that's a big deal where accounting is involved. It adds up, and makes it impossible to reconcile orders against client payments. Every other e-commerce system I work with handles it fine, and at the moment I'm extremely *NOT* a happy bunny. Looks like I'm going to have to recode the this system to work consistently.

Regards,

Peter Connolly

Peter Connolly
Technical Director
KP Direction LLC
White-Label Drupal and PHP Development for Media Companies
http://www.kpdirection.com
USA, UK, Canada


New member

Posts

Joined
Mon Apr 18, 2011 12:14 pm

Post by markman-b » Sun Oct 02, 2011 6:29 pm

Can anyone confirm that this problem has been fixed in version 1.5.1.3?

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by teratyke » Sun Oct 02, 2011 6:34 pm

Same so far as my test goes. Having said that though I don't think this can be fixed, because its a rounding thing, not an error. Well that is the way I see it anyway.
Rob

Active Member

Posts

Joined
Sun Jun 12, 2011 3:05 pm

Post by markman-b » Sun Oct 02, 2011 6:59 pm

Mmmm....that's a pity. I hoped that the new tax system had solved this isue.

I agree it's not an error. But I'm convinced that it can be solved, by changing some code.
Other OS Commerce packages seem to handle paypal payments well (without rounding problems), so there should be a way to fix it.

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by sb65 » Tue Oct 04, 2011 8:45 pm

Watching this discussion with interest as I'm still not happy with having to fudge the prices - which is enforcing some daft prices like £10.02 on my (wife's) shop.

Haven't found time to really work through this but having looked at what Opencart is posting to Paypal (using paypal standard), it does NOT post the total - just the individual line totals exclusive of VAT, the shipping and the VAT. You can see this from the confirm screen by viewing the source code - or via something like Firebug.

So, if Paypal doesn't get the total it has to calculate it from the product totals, which is where the rounding problem kicks in. The logical step therefore would be to get Opencart to pass the total as well...but I'm not sure whether Paypal will allow this.
Last edited by sb65 on Tue Oct 04, 2011 8:53 pm, edited 1 time in total.

New member

Posts

Joined
Tue Sep 20, 2011 9:18 pm

Post by teratyke » Tue Oct 04, 2011 8:52 pm

Yeah, I made a vqmod to pass just the total across to paypal. It seems to be working for me.
Its linked to in one of my posts earlier in this thread -
I'll re-upload here..

pass total to paypal


Active Member

Posts

Joined
Sun Jun 12, 2011 3:05 pm

Post by sb65 » Tue Oct 04, 2011 8:54 pm

Hi Teratyke

So you're just passing the total, not the product details. I'm not sure whether Paypal will accept the total AS WELL as the breakdown.

Simon

New member

Posts

Joined
Tue Sep 20, 2011 9:18 pm

Post by teratyke » Tue Oct 04, 2011 8:58 pm

Yes just the total. Not ideal, but it does at least make the amount charged/paid consistent across payment methods.

Active Member

Posts

Joined
Sun Jun 12, 2011 3:05 pm

Post by sb65 » Tue Oct 04, 2011 9:31 pm

Hmmmm. Pretty sure Paypal will not accept an overall total and a list of products.
I think there might be a possible solution to pass the items with their VAT inclusive prices, and not pass the VAT total. Provided the VAT inclusive price is calculated correctly at the Opencart end that should be OK. Only issue I foresee is with discounts - these would need to be amended to a discount "including VAT".

New member

Posts

Joined
Tue Sep 20, 2011 9:18 pm

Post by teratyke » Tue Oct 04, 2011 9:43 pm

Sorry, I think we are talking at cross purposes. I am only passing the order total, less discounts etc across to PayPal.
I agree, you can't pass both total and items across.

Your items with VAT solution sounds good. Although as you say certainly more problematic than just passing the total. I suppose it depends how important it is to you to have an itemised PayPal transaction. Personally, as a shopper, I don't mind so long as I have a separate more detailed email from the shop.

It would be best if PayPal would accept values with 4 decimal places.

Active Member

Posts

Joined
Sun Jun 12, 2011 3:05 pm

Post by sb65 » Tue Oct 04, 2011 9:50 pm

Yes, I realise you're just passing a single total figure.

I agree about the 4dp - I think that would also solve the problem.

Might have a stab at the VAT inclusive option and post back here....

New member

Posts

Joined
Tue Sep 20, 2011 9:18 pm

Post by markman-b » Tue Oct 04, 2011 10:18 pm

I doubt if 4 decimals is the solution we are all waiting for....

I've used other PayPal extensions before. A couple of months ago when I was unfamiliar with Open Cart, I bought WYSIWYG Webbuilder to develop my website. In WYSIWYG's PayPal extension I could enter two amounts for each product.

1. Productprice ex VAT in 2 decimals
2. VAT per product in 2 decimals

Order totals were always being calculated correctly by PayPal.

In this case the VAT amount is not being calculated by the PayPal, since we have passed these values in a constant amount per product. PayPal only adds up the amounts.

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm
Who is online

Users browsing this forum: No registered users and 3 guests