Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Possible bug in group discount and vat handling

Possible bug in group discount and vat handling

Locked

Started by ltamas on 17 Jan 2008, 12:56 PM · Views: 1,741

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
17 Jan 2008, 12:56 PM
#1
ltamas avatar

ltamas

New Zenner

Join Date:
Jan 2008
Posts:
3
Plugin Contributions:
0

Possible bug in group discount and vat handling

Hi!

I am just setting up my first Zen Cart installation and experimenting with the various features. While testing the group pricing functions I might have came across a bug in 1.3.8a.
My setup is as follows:

Group discount
This module is installed
true
Sort Order
290
Include Shipping
false
Include Tax
false
Re-calculate Tax
Standard
Tax Class
Áfa

result:
40000Ft = Order total
33800Ft = Shipping
-20000Ft =Group Discount
7380Ft = Tax 20%
61180Ft = Total

with the tax calculation changed to None:

Rendelés összege:
40000Ft = Order total
33800Ft = Shipping
-20000Ft = Group Discount
7380Ft = Tax 20%:
68560Ft =Összesen

However this is what is should display:
40000Ft = Order total
33800Ft = Shipping
-20000Ft = Group Discount
10760Ft = Tax 20%:
64560Ft =Összesen

Both the total fields and the tax is wrong, since
1.) The system is set to give discount only on the product itself, not shipping. (the deduction is correct, it this case 50% from the product). While when calculating the taxes does Zen does deduct 50% from the shipping as well (what it shouldn't do as the discount is only valid for the product)
2.) in the second case the total is not correnct. the numbers just don't add up

Can you confirm that this is a bug (and not a feature :) and direct me to a solution. I tried to hack myself, but with no luck yet.

regards
Tamas

17 Jan 2008, 2:32 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Possible bug in group discount and vat handling

Perhaps this is the issue mentioned here:
http://www.zen-cart.com/forum/showpost.php?p=487733&postcount=10

.
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.

17 Jan 2008, 2:59 PM
#3
ltamas avatar

ltamas

New Zenner

Join Date:
Jan 2008
Posts:
3
Plugin Contributions:
0

Re: Possible bug in group discount and vat handling

DrByte:

Perhaps this is the issue mentioned here:
http://www.zen-cart.com/forum/showpost.php?p=487733&postcount=10

No, mine is not a division by zero thing (especially since I have items in cart).

The strange thing is that when I set the Re-calculate tax to Credit note than tha TAX is fine, but the order total isn't...

I tried editing the ot_group_prcing.php to see if there is something wrong there, I just couldn't find anything.

16 Feb 2008, 11:03 PM
#4
pandasam avatar

pandasam

New Zenner

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

Re: Possible bug in group discount and vat handling

I had same problem. To resolve I set Re-calculate tax to Credit Note to get the tax calculation correct then changed the following line in ot_group_pricing.php:

if ($this->calculate_tax == "Standard") $order->info['total'] -= $tax;

to:

if ($this->calculate_tax == "Standard" || $this->calculate_tax == "Credit Note") $order->info['total'] -= $tax;

Problem solved.