Forums / Currencies & Sales Taxes, VAT, GST, etc. / Tax + discount coupon BUG?

Tax + discount coupon BUG?

Views: 20,227

Results 21 to 34 of 34
13 Apr 2009, 8:21 PM
#21
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,927
Plugin Contributions:
3

Tax + discount coupon BUG?

Hi,

I think that unfortunately the changes we made earlier have introduced thay bug.

To fix, you will need to replace the
function pre_confirmation_check in includes/modules/order_total/ot_coupon.php with

  function pre_confirmation_check($order_total) {
    global $order;
    $od_amount = $this->calculate_deductions($order_total);
    if (DISPLAY_PRICE_WITH_TAX == 'true')
    {
      return $od_amount['total'];
    } else {
      return $od_amount['total'] + $od_amount['tax'];      
    }
  }
13 Apr 2009, 10:03 PM
#22
erikallan avatar

erikallan

New Zenner

Join Date:
Dec 2008
Location:
Stockholm
Posts:
29
Plugin Contributions:
0

Re: Tax + discount coupon BUG?

Hello wilt

Thank you once again! :clap: That did the trick. Now I only have one more question...

If I use a 100% discount coupon that sets the order total to 0, the payment method remains the same in the last (3rd) step as the selected one in the 2nd step.

If I use a discount coupon (fixed amount in $) that covers the whole order balance or more, the payment method is set to nothing in the 3rd step.

What I would like (and need) for this to work is some kind of "Zero balance payment method". Is there any way of doing this? My PSP don't accept 0 balance calls, and there are other possible issues with this problem too...

The best would be if zencart would skip the "selection of payment method step" (or hide it) if the order balance (after any discounts) equals to 0. Wouldn't it? :yes:

Thanks again

/Erik

13 Apr 2009, 10:08 PM
#23
erikallan avatar

erikallan

New Zenner

Join Date:
Dec 2008
Location:
Stockholm
Posts:
29
Plugin Contributions:
0

Re: Tax + discount coupon BUG?

I have tried using the freecharger and the freshipping modules but they don't seem to help me...

/E

14 Apr 2009, 2:42 AM
#24
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,927
Plugin Contributions:
3

Re: Tax + discount coupon BUG?

to fix the 100% discount coupon problem you need to replace

function pre_confirmation_check in includes/modules/order_total/ot_coupon.php again with

  function pre_confirmation_check($order_total) {
    global $order;
    $od_amount = $this->calculate_deductions($order_total);
    if (DISPLAY_PRICE_WITH_TAX == 'true' && $od_amount['type'] != 'P')
    {
      return $od_amount['total'];
    } else {
      return $od_amount['total'] + $od_amount['tax'];      
    }
  }
14 Apr 2009, 2:53 PM
#25
erikallan avatar

erikallan

New Zenner

Join Date:
Dec 2008
Location:
Stockholm
Posts:
29
Plugin Contributions:
0

Re: Tax + discount coupon BUG?

Hi

Now everything seems to work. I will move the bug fixes to my live site tonight and test everthing once again. Thank you for all the help.

Are there any other critical bug fixes I need? I thougt the "check for latest version" in the admin would handle this, but it seems to be used only for major upgrades. As you know I run on 1.3.8a.

/Erik

14 Apr 2009, 11:04 PM
#26
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,927
Plugin Contributions:
3

Re: Tax + discount coupon BUG?

Hi

there is another bug related to shipping tax and coupons but this may not affect you with using DISPLAY_PRICES_WITH_TAX.

I am however currently reworking some of the calculation logic, as currently the way code handles the difference between DISPLAY_PRICE_WITH_TAX = true/false is a little convoluted (as you can probably tell from the problems you encountered)

Hopefully I will have that done in a day or few.

4 Jun 2009, 7:49 AM
#27
erikallan avatar

erikallan

New Zenner

Join Date:
Dec 2008
Location:
Stockholm
Posts:
29
Plugin Contributions:
0

Re: Tax + discount coupon BUG?

Hello Wilt

I came across another problem related to the ot_coupon module. Sometimes the discount sum is rounded wrong. I use 2 decimals for the currency (SEK). It seems like this bug only occurs when using multiple tax classes on the same order, but I´m not sure about that...

/Erik

15 Feb 2010, 8:23 AM
#28
helterskeltermelter avatar

helterskeltermelter

New Zenner

Join Date:
Feb 2010
Posts:
1
Plugin Contributions:
0

Re: Tax + discount coupon BUG?

wilt:

there is another bug related to shipping tax and coupons but this may not affect you with using DISPLAY_PRICES_WITH_TAX.

I am however currently reworking some of the calculation logic, as currently the way code handles the difference between DISPLAY_PRICE_WITH_TAX = true/false is a little convoluted (as you can probably tell from the problems you encountered)

Hopefully I will have that done in a day or few.

Hi Wilt,

Did you get anywhere with this reworking? I'm attempting to solve a discount code and sales tax problem different to the ones fixed in this thread. The problem only occurs when DISPLAY_PRICES_WITH_TAX. I'm finding the code related to DISPLAY_PRICES_WITH_TAX quite confusing.

Cheers

4 Oct 2010, 12:01 PM
#29
steddy_eddie avatar

steddy_eddie

New Zenner

Join Date:
Oct 2007
Posts:
7
Plugin Contributions:
0

Re: Tax + discount coupon BUG?

Hey there, sorry to dig up an old bug but..

I am running a 1.3.9g shop (upgraded from 1.3.8a) and am seeing a similar problem to this.

It occurs when redeeming a discount coupon with a higher value than the order total.

e.g. fill up the cart with £47 worth of goods, and then redeem a £100 coupon, and instead of a discount value of £47.00 it takes off the shipping tax (£0.74 in my case), so you get:


Sub-Total: £47.00

Delivery Options (Standard Delivery: Free if Order Total above £100, £4.99 if under): £4.99

Discount Coupon: HRLM : -£46.26

VAT: £0.74

Total: £5.73

Is there a quick fix for this? Somewhere around line 403 in ot_coupon.php ?

Thanks!

5 Oct 2010, 12:11 PM
#30
panservolvo avatar

panservolvo

New Zenner

Join Date:
Sep 2010
Posts:
38
Plugin Contributions:
0

Re: Tax + discount coupon BUG?

Hi!

I have the same problem as ErikAllan had (i think). The difference is that i am running 1.3.9f and the ot_coupon.php is not the same as it were when you guys fixed it. I tried to implement the changes but nothing seems to happen.

I have the following setup:

Include Shipping
false
Include Tax
false
Re-calculate Tax
Standard

The problem i'm having is: the discount is wrongly calculated when there is VAT on the shipping.

Heres an example of an order with VAT on shipping and an 10% coupon:

Totalt:NOK 125.00
Coupon: -NOK 11.23
Shipping :NOK 63.75
25% VAT: NOK 35.25
Order Total: NOK 177.52

The Coupon SHOULD be -NOK 12,50

Here is the exact same order, but this time I have turned off VAT on shipping. Now everything is as it should be.

Totalt:NOK 125.00
Coupon: :-NOK12.50
Shipping :NOK51.00
25% VAT:NOK22.50
Order Total:NOK163.50

Anyone got an idea of how to fix this?

4 Aug 2011, 1:56 PM
#31
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Tax + discount coupon BUG?

How is the situation for these bugs in the latest version? Also having a shop in Scandinavia and trying to avoid issues with it. Currently it is discounting 10 euro discount without VAT from the order that is not really correct. I changed the settings to include the tax. Lets what happens. Just do not like to test things with a live shop...

I may be blond but at least I found Zen.

4 Aug 2011, 2:16 PM
#32
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Tax + discount coupon BUG?

Should be good in v1.5.0. Best way to find out is to install a copy of it in a test folder+database and check it out using your own data. That's also why it's released as a BETA presently ... we're asking you to test it and point out any bugs.
Everyone who has subscribed to the News & Announcements section of the forum has already read about it here: http://www.zen-cart.com/forum/showthread.php?t=183626

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Nov 2013, 9:41 AM
#33
stevis2002 avatar

stevis2002

Zen Follower

Join Date:
Sep 2004
Posts:
143
Plugin Contributions:
0

Re: Tax + discount coupon BUG?

DrByte:

Should be good in v1.5.0. Best way to find out is to install a copy of it in a test folder+database and check it out using your own data. That's also why it's released as a BETA presently ... we're asking you to test it and point out any bugs.
Everyone who has subscribed to the News & Announcements section of the forum has already read about it here: http://www.zen-cart.com/forum/showthread.php?t=183626

I still cant get this working correctly in 1.51.
I add the discount coupon to remove the discount, but then the vat doesn't get added on to the order at all

Please can somebody help?

Thanks

11 May 2022, 3:37 PM
#34
villalolo avatar

villalolo

New Zenner

Join Date:
Aug 2011
Posts:
5
Plugin Contributions:
1

Re: Tax + discount coupon BUG?

I have a similar issue on 1.5.5.e

Only not working on Fix amount coupon, with VAT 20%

  • I have the following invoice with a 833,33€ Excl.Tax coupon, or 1000€ Incl.Tax
    Product ......2908.33€ .....+20% VAT ( 581.67€ ) Tax ........ 3,490,00€
    Coupon .......-833.33€.... +16.66% (138.88€) Tax ............. - 972.22€
    Total VAT .......442.78€....... total price inc.vat ..... 2,517.78€

I figured out that my coupon was at 16.66% VAT ??

I have only one tax rate, 20%

What I'm getting is this

Sub-Total:.............................€3,490.00
Store Pickup (Walk In):..................€0.00
Discount Coupon: abcdef :.........-€972.22
VAT 20% or similar:....................€442.78
Total:...................................€2,517.78

What I need is this
Sub-Total:...........................€3,490.00
Store Pickup (Walk In):................€0.00
Discount Coupon: abcdef :... -€1000.00
VAT 20% or similar: ............... .€415.00
Total:................................. 2,490.00

for some reasons, its working fine with % coupon , here 28.6532951%

Sub-Total:............................€3,490.00
Store Pickup (Walk In):.................€0.00
Discount Coupon: 987654321 :-€1,000.00
VAT 20% or similar:...................€415.00
Total....................................€2,490.00

this is my coupon setup
Discount Coupon

This module is installed ...............true
Sort Order.................................280
Include Shipping.........................true
Include Tax...............................false
Re-calculate Tax..................Standard
Tax Class.....................Taxable Goods