Forums / Currencies & Sales Taxes, VAT, GST, etc. / VAT not calculating correct after using Discount Coupon

VAT not calculating correct after using Discount Coupon

Locked

Views: 5,784

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
6 Mar 2007, 12:07 PM
#1
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

VAT not calculating correct after using Discount Coupon

HI

I can't seem to find this solution in other threads. On one of my sites, when using a discount coupon "First Order" you get 10% off. But the VAT is calculating wrong when using the coupon. I cannot see where the figure is coming from. I've tried turning tax on and off for shipping and the coupon but this is not the issue. I can't see what values its using to calculate tax.

Wrong Values:-

Sub-Total: £13.98
Discount Coupon: First Order : -£1.40
Shipping Method (Standard): £6.95
VAT 17.5%: £3.17
Total: £22.70

What it should be:-

Sub-Total: £13.98
Discount Coupon: First Order : -£1.40
Shipping Method (Standard): £6.95
VAT 17.5%: £3.42
Total: £22.95

Where is £3.17 for Tax coming from??? Its like it thinks the total to calculate tax on is less than it is. The total to calculate tax on should be £13.98 - £1.40 + £6.95 = £19.53 (17.5% of which = £3.42). BUT £3.17 is 17.5% of £18.11. So where is it getting £18.11 from??

Thanks

Laurie

6 Mar 2007, 4:06 PM
#2
jaygee avatar

jaygee

New Zenner

Join Date:
Mar 2005
Location:
UK
Posts:
38
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Looking purely at the numbers would imply it is deducting the VAT element of the discount again, i.e. ((13.98 -1.4).175) - (1.4.175) + (6.95*.175) which results in 18.13*.175 that equals 3.17.

You need to check the code and see if it's easily fixed.

6 Mar 2007, 4:27 PM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

No easy solution to this... It's a bug in the core code::lamo:

If the cart contains multiple products, it somehow "compounds" the discount tax calculation. If the cart has just ONE product, the discount coupon will calculate tax correctly.

We got round it by doing the following:-

ADMIN->MODULES->ORDER TOTAL->DISCOUNT COUPON...

Then, EDIT...

Set RECALCULATE TAX as a CREDIT NOTE (RADIO BUTTON), (STANDARD seems to be the default, so CHOOSE CREDIT NOTE)

Set TAX CLASS as your chosen tax class.

I don't know why this fixes things for us. There may be other settings that influence what we've done, but at least we can have a shopper add multiple products, invoke the discount at checkout, and get the correct tax to display.

Try my solution, add some (more than 1) products to a cart and invoke a discount coupon, see if the tax calculation is now correct.

PS: This MAY be influenced by some settings in the Discount Coupon set-up - ie: where you configure what categories and products the discount coupon is applicable to. If your discount coupon is GLOBAL (all categories and products) then you should have no problems doing what we did.

BEAR IN MIND that if you offer GIFT VOUCHERS --- DO NOT apply discounts to these!!! (You could soon go out of business if you do... Think about what I'm saying here!):smartass: (See my WIKI article on Discount Coupons)

20 years a Zencart User

6 Mar 2007, 4:46 PM
#4
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Laurie,

I can't remember the full details now but I had a similar problem many moons ago.

Ajeh and Jeff helped me out in this old archived thread

It was for the older version but I bet some of the suggestions will still help you.

Regards

Brent

6 Mar 2007, 6:41 PM
#5
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Thanks Schoolboy, tried your method setting the re-calculate tax to Credit Note and now get different values! Also trtied setting it to None and got same as Credit Note.

Sub-Total: £13.98
Discount Coupon: First Order : -£1.40
Shipping Method (Standard): £6.95
VAT 17.5%: £3.67
Total: £23.20

6 Mar 2007, 6:48 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Yeh... but in your calcs (above) you're still getting a slightly incorrect VAT. If you CHARGE vat, then you must not set it as <NONE>. Try it again to your default tax setting and see if it shows vat properly...

(It looks like it's not taking tax off the £1.40).

Your tax should come to £3.42...

The "extra" 25p is being added because the £1.40 "discount" is classified as not being "influenced" by your vat settings. (maybe???)

(IT GETS SO COMPLICATED - especially after a few glasses of wine!!!)

EEK... having said that... what are the tax settings on your shipping??? You may need to ensure that everything "sings off the same hymn-sheet".

Grahame

20 years a Zencart User

6 Mar 2007, 6:59 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Oh.. and by the way....

The SORT ORDER of <ORDER_TOTAL> also influences how the calcs are done...

Make sure the discount coupon total comes AHEAD of tax... (seems like you're doing this though???)

The <ORDER-TOTAL> module has to add everything up... see what must be DEDUCTED (eg: coupons)... ADD the shipping... come up with the SUB TOTAL... and THEN apply your tax... THEN >>> GRAND TOTAL.

Grahame

20 years a Zencart User

6 Mar 2007, 7:17 PM
#8
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Yeah am applying VAT (same 17.5%) to shipping too, and order total is at the bottom. Must be a big like others have said. Thanks for helping, I will have to take a look again tomrrow now.
Laurie

6 Mar 2007, 7:26 PM
#9
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

The thread I supplied above is worth a read as the order totals are discussed in detail along with the "incl tax" settings. It was following these instructions that fixed the problem for me.

7 Mar 2007, 5:39 PM
#10
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Hi Brent. Sorry the thread is quite long and many solutions are suggested, but I can't seem to pick out the one that fixes this problem. What was the solution you tried?

Thanks

7 Mar 2007, 6:40 PM
#11
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Laurence... I can't figure out why your tax is still slightly out, esp since you invoked Credit Note.

Go to one of my websites:-

http://www.commotionstore.co.uk

Register as a customer and put a few prods into the shopping cart (keep total to under £100 to invoke shipping), then take it through the checkout. Discount coupon code is 75-2007. Select ACCOUNT HOLDERS as payment type, then look at the order total calcs on the next screen.

I'm getting the correct vat settings on a discount coupon with shipping and multiple products in the cart...

Can't understand why you aren't

My products are excl vat... vat is added in the order_total mod... That may have something to do with it.

20 years a Zencart User

14 Mar 2007, 5:12 PM
#12
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Hi Schoolboy, Sorry for late reply.

I dont think your site is suitable as you say the products are exclusing VAT. Thsi may have something to do with it.

This problem only occirs for me when I have 2 or more products in the cart. It calculates OK when there is one product in the cart.

Clients really pressuring me now. I think I read on another forum that this was abug so can't believe there;s no fix yet. If this is built in (which it must be as I have not changed any files) then loads of people must be getting the error when 2 or more products are ordered and a discount coupon applied.

Laurie

14 Mar 2007, 5:14 PM
#13
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Anyone know which file calculates the the TAX amount? ot_tax.php does not have any calculations in it. I dont think it's ot_coupon.php as the coupon calculation works out to be correct. Its purely the TAX (17.5%) calculation that is applied to the sub-total of products that is wrong.
Thanks

14 Mar 2007, 5:38 PM
#14
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

The price error is the amount of TAX on the discount coupon. Looks like the discount coupon is being taxed twice, and this double amount deduced.

Example:-
**
Wrong:-**
Sub-Total: 13.98
Discount Coupon: First Order : -£1.40
Shipping Method (Standard): £6.95
VAT 17.5%: £3.17
Total: £22.70

What it should be:-
Sub-Total: £13.98
Discount Coupon: First Order : -£1.40
Shipping Method (Standard): £6.95
VAT 17.5%: £3.42
Total: £22.95

The difference (25p) equates to 17.5% of 1.40.

So it looks like its deducting twice the TAX from discount coupon.
i.e.
The total that is taxable is:
SubTotal - Discount Coupon + Shipping ( £13.98 - £1.40 + £6.95 = £19.53).
So TAX (17.5%) should then calculated on £19.53 = £3.42.
BUT you can see in the wrong amount that the result is 25p less at £3.17. 25p is actually 17.5% of £1.40, the discount coupon. So it looks like it is taking ANOTHER TAX amount off the coupon value even though its already deducted it in the previous calculation.

In ot_tax I have chosen not to include shipping or tax, calculation is set to standard. I changed this to include TAX but then this just deducts more from the price. So this cant be it.

Thanks

22 Mar 2007, 9:42 AM
#15
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Hi

Does anyone know the file where it calulcates TAX? I still have this problem.

Thanks

22 Mar 2007, 10:09 AM
#16
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: VAT not calculating correct after using Discount Coupon

Hi Laurence and others,

the coupon and tax issues have been discussed many times. It probably would be better to have a sticky thread and or FAQ item about it..... :smartass:

One of the threads that helped me most is the bug report by s_mack and the comments and fixes of JeffD:
http://www.zen-cart.com/forum/showthread.php?t=54847

Got it working including tax now, but it's certainly not really fixed because it does not work excluding tax and I think my settings don't work properly anymore. And I think got severe coupontaxfobia now.... :wacko:

26 Mar 2007, 8:51 AM
#17
infocom avatar

infocom

Zen Follower

Join Date:
Jul 2006
Location:
Cardiff, Wales
Posts:
308
Plugin Contributions:
0

Re: VAT not calculating correct after using Discount Coupon

Hi Paulm.

Thanks for pointing me in the right direction I have finally fixed it! The code changes that s_mack posted on page 4 of your forum link above solved the issue: http://www.zen-cart.com/forum/showthread.php?t=54847&page=4. It seems to work fine.

Thanks

Laurie