Zen Cart Logo
Forums / Currencies & Sales Taxes, VAT, GST, etc. / Bizarre Tax calculation

Bizarre Tax calculation

Views: 5,118

Results 21 to 30 of 30
7 Jul 2014, 10:58 PM
#21
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,717
Plugin Contributions:
56

Bizarre Tax calculation

satphone:

Surely getting coupons to work correctly is a pretty basic requirement???

Actually, your requirements (and definition of correctly) are unusual. That's why the code doesn't accommodate the computation you are asking for.

7 Jul 2014, 11:17 PM
#22
satphone avatar

satphone

New Zenner

Join Date:
Jun 2014
Location:
Australia
Posts:
60
Plugin Contributions:
0

Re: Bizarre Tax calculation

I'm not sure why you consider that unusual. Is it not normal to pay tax on the Total amount of an invoice?

Without that ability it precludes the use of Zen Cart and coupons in Australia and New Zealand. I can't speak for other countries but I imagine there'd be many.

7 Jul 2014, 11:26 PM
#23
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,717
Plugin Contributions:
56

Re: Bizarre Tax calculation

I consider it unusual in that I have six years of experience supporting this platform with customers all around the world, including Australia and New Zealand, and your request is a first. Now who knows, maybe you're right and everyone else is wrong, but it's still a first.

Zen Cart is an open source product, and you are welcome to customize it to your requirements.

8 Jul 2014, 12:04 AM
#24
satphone avatar

satphone

New Zenner

Join Date:
Jun 2014
Location:
Australia
Posts:
60
Plugin Contributions:
0

Re: Bizarre Tax calculation

I really surprised at your posts. You don't seem willing or able to assist, and then claim my request for assistance to be "strange"

It is VERY simple indeed. (You'd know this if you've set up stores correctly in AU and NZ.)

The sales tax component (we call it GST) should be calculated on the final value of the purchase being made. eg.

Goods $100, shipping $20, discount (for whatever reason) -$10. This should result in a sale value of $110 where it should be indicated that $10 of the final sale value is tax/GST

Zen Cart 1.5.1 does not manage to do that. It is not strange to want it to do that, in fact it NEEDS to be able to do that to be useable in AU / NZ.

Can you perhaps explain what is needed to make it do this. That is what I requested in my first post.

Pointing out that I am free to modify Zen Cart really is not helping. Everyone knows that as it is open source software.

Can anybody help in getting Zen Cart to do these simple calculations correctly?

Thanks in advance - Kev

8 Jul 2014, 7:00 AM
#25
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Bizarre Tax calculation

satphone:

Rod - here's what I've got
Now here's what it calculates

Sub-Total: $95
Flat Rate (Best Way): $10.00
Discount Coupon: 10 : -$10.00
GST 10%: $8.55
TOTAL: $95.00

Whilst the Total is correct the GST is just whacky. It should be $95/11 = $8.64

So it seems the cart is calculating the discount amount as $10.91 and deducting that. This makes the calculated GST correct IF the coupon was $10.91

Your right, that is whacky. I wonder why I'm not getting the same results? I don't recall having to modify the code at all, but it is giving the expected results on the clients' store (I wonder if he modded it?).

I'll try to find some time to replicate these settings and product costs on one of my local test sites later this evening. I'll let you know what I find.

Cheers
RodG

8 Jul 2014, 8:23 AM
#26
satphone avatar

satphone

New Zenner

Join Date:
Jun 2014
Location:
Australia
Posts:
60
Plugin Contributions:
0

Re: Bizarre Tax calculation

Much appreciated. My accountant is going nuts!

8 Jul 2014, 1:55 PM
#27
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Bizarre Tax calculation

satphone:

Much appreciated. My accountant is going nuts!

Not the only one. Me too.

I couldn't make much sense of the code on the site that was using the 'credit note' setting. The code has been hacked almost beyond recognition, SO, I went back to my notes and the code that used the 'Standard' setting for Re-calculate tax and discovered that this was behaving the way you've described.

I then compared the current ot_coupon code with a copy from an older (also live) server that I have access to (and knew worked as expected) and noticed a minor, but very important difference. I made the same change to the current code, and am now getting the expected results. Hooray!!!

The change:
/includes/modules.order_total/ot_coupon.php

Line #457 ... which reads like..
$od_amount['tax'] += $od_amount['tax_groups'][$key];

Just add a couple of slashes // in front of the line to comment it out. (you can also just delete the line, but I prefer to comment out because it may come in handy someday, as it did this time).

Save the file, and all should work as expected. (settings, include tax = false, Re-calculate tax - standard)

Cheers
RodG

9 Jul 2014, 3:32 AM
#28
satphone avatar

satphone

New Zenner

Join Date:
Jun 2014
Location:
Australia
Posts:
60
Plugin Contributions:
0

Re: Bizarre Tax calculation

WooHooo! That did it! :smile:

Sorry for the delay in getting back to you - I had a mob install SEO URL rewrites for me. They busted the shop and I had to restore from backup. Naturally this meant it broke other add ons, but just about got it fixed now.

I have NO idea whatsoever how you found this bug in all that code. But very well done indeed Sir!

Thanks again.

9 Jul 2014, 7:15 AM
#29
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Bizarre Tax calculation

satphone:

WooHooo! That did it! :smile:

Thanks for letting me/us know that it fixed the problem. Much appreciated.

satphone:

Sorry for the delay in getting back to you - I had a mob install SEO URL rewrites for me.

I'm sorry to hear that. ZenCart gets indexed quite nicely without "SEO" rewrites, and as a general rule they cause far more problems than the thing they are meant to solve. I do all I can to discourage my clients from using them.

satphone:

I have NO idea whatsoever how you found this bug in all that code. But very well done indeed Sir!

A couple of decades of coding experience, and several years of working with Zen-Cart helped a lot. :)

Cheers
RodG

9 Jul 2014, 7:23 AM
#30
satphone avatar

satphone

New Zenner

Join Date:
Jun 2014
Location:
Australia
Posts:
60
Plugin Contributions:
0

Re: Bizarre Tax calculation

RodG:

A couple of decades of coding experience, and several years of working with Zen-Cart helped a lot. :)

I figured it didn't happen without considerable depth of experience. As far as the SEO goes I was reluctant to do it figuring it could make things "fragile" - and it did.

But not getting anywhere in Google rankings despite good content, good tags etc, cross linking in social media etc after 3 months it was time to try something.

Usually adwords relevance should be an indicator of rankability (whole site in near 10/10) but just not getting there in organic ranks.