Forums / Currencies & Sales Taxes, VAT, GST, etc. / Discount Coupon AND Group Discount Tax Problem

Discount Coupon AND Group Discount Tax Problem

Locked

Started by mrkrinkle on 15 Aug 2006, 1:02 AM · Views: 12,251

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
15 Aug 2006, 1:02 AM
#1
mrkrinkle avatar

mrkrinkle

New Zenner

Join Date:
Jun 2006
Posts:
27
Plugin Contributions:
0

Discount Coupon AND Group Discount Tax Problem

I have a problem with tax calculations where a Discount Coupon and a Group Discount apply...

Sub-Total: $10.00
Shipping Not Applicable: $0.00
Discount Coupon (25%): -$2.50
Group Discount (10%): -$0.72
GST (10%): $0.75
Total: $7.53

The GST is calculating with the Discount Coupon but not the Group Discount.

The Group Discount options are:

Include Shipping
true

Include Tax
false

Re-calculate Tax
Credit Note

Tax Class
GST

And the Discount Coupon options are;

Include Shipping
true

Include Tax
false

Re-calculate Tax
Credit Note

Tax Class
GST

Zen Cart version is 1.3.0.1.

On it's own the Group Discount works;

Sub-Total: $10.00
Shipping Not Applicable: $0.00
Group Discount (10%): -$1.00
GST (10%): $1.00
Total: $10.00

As does the Discount Coupon on it's own;

Sub-Total: $10.00
Shipping Not Applicable: $0.00
Discount Coupon (25%): -$2.50
GST (10%): $0.75
Total: $8.25

Any Clues?

15 Aug 2006, 1:57 AM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,728
Plugin Contributions:
0

Re: Discount Coupon AND Group Discount Tax Problem

Have you tried restoring the default settings for both modules?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

15 Aug 2006, 2:05 AM
#3
mrkrinkle avatar

mrkrinkle

New Zenner

Join Date:
Jun 2006
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon AND Group Discount Tax Problem

What are the defaults?

I have tried all different combinations but I need the Discounts to be applied pre-tax...

16 Aug 2006, 1:47 AM
#4
mrkrinkle avatar

mrkrinkle

New Zenner

Join Date:
Jun 2006
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon AND Group Discount Tax Problem

I have recreated the scenario on my test site which is v1.3.0.2 and still have the sam problem...

This is what it should look like according to my calculations;

Sub-Total: $10.00
Shipping (Flat Rate): $5.00 = $15.00
Discount Coupon (10%): -$1.50 = $13.50
Group Discount (10%): -$1.35 = $12.15
GST Tax (10%): $1.21 = $13.36
Total: $13.36

As you can see below the GST Tax does not re-calculate after the Group Discount;

Sub-Total: $10.00
Shipping (Flat Rate): $5.00
Discount Coupon (10%): -$1.50
Group Discount (10%): -$1.35
GST Tax (10%): $1.35
Total: $13.50

The GST Tax and Total appear to be wrong.
If I swap the order of the Discount Coupon so it is calculated after the Group Disount I get this;

Sub-Total: $10.00
Shipping (Flat Rate): $5.00
Group Discount (10%): -$1.50
Discount Coupon (10%): -$1.50
GST Tax (10%): $1.35
Total: $13.35

The Discount Coupon, GST Tax and Total appear to be wrong although Total is only 1c out and may be rounding issue.
If I revert to either the Group Discount or Discount Coupon on their own then it works fine;

Sub-Total: $10.00
Shipping (Flat Rate): $5.00
Group Discount (10%): -$1.50
GST Tax (10%): $1.35
Total: $14.85

Sub-Total: $10.00
Shipping (Flat Rate): $5.00
Discount Coupon (10%): -$1.50
GST Tax (10%): $1.35
Total: $14.85

INFO

The Zen Cart Version is 1.3.0.2, the Shipping and product are both taxable.
Both Disount Coupon And Group Discount have the following settings;

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

Can anyone help or have you had a similar issue? :dontgetit

Cheers
Will

16 Aug 2006, 4:38 AM
#5
mrkrinkle avatar

mrkrinkle

New Zenner

Join Date:
Jun 2006
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon AND Group Discount Tax Problem

I think I have worked out where my problems are coming from...

When you have taxable and non-taxable items and you apply a discount (Coupon or Group), does the discount subtract from the taxable item or the non-taxable or both, an if both how does it calculate the percentage. This calculation obviously effects the tax payable on the order...

Does anyone know how this works?

Cheers
Will

16 Aug 2006, 7:47 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: Discount Coupon AND Group Discount Tax Problem

Before pulling any more hair, you might want to fix a small bug:

includes/modules/order_total/ot_group_pricing.php
line 21 has:```php
$this->credit_tax = MODULE_ORDER_TOTAL_GROUP_PRICING_CREDIT_TAX;

change it to:```php
      $this->tax_class = MODULE_ORDER_TOTAL_GROUP_PRICING_TAX_CLASS;

As an addendum, the "include shipping" and "include tax" settings, if set to "true", work like this:
"Order Total" minus "Shipping Costs" minus "Tax Amount" = "Amount to apply discount to"
ie: $50.00 - $3.50 - $2.80 = $43.70 .... if discount rate is 10%, then the discount will be $4.37

Hope that helps clarify some of how it works.

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

16 Aug 2006, 11:36 PM
#7
mrkrinkle avatar

mrkrinkle

New Zenner

Join Date:
Jun 2006
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon AND Group Discount Tax Problem

Thanks DrByte,

However I want the Discount to re-calculate the tax. ie. I want the discount to come off the pre-tax figure and then the tax to be calculated.

I have "Include Shipping" set to true but not "Include Tax". I want it to do;

Subtotal (pre-tax) + Shipping - Discount >> calculate tax

I guess my question is if I had taxable and non-taxable product in the order;

A: Can I do this?

B: If I did, would the discount come from the taxable product or the non taxable product as this obviously woud effect the outcome of the tax calculation?

I am trying to work out how Zen Cart gets the Tax amount that it does in this example... (ignore the "GST Incl" on the subtotal)

Thanks for your time... :wacko:

17 Aug 2006, 5:10 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: Discount Coupon AND Group Discount Tax Problem

Things I'd do:

  1. write down all payment-module settings

  2. paste them here (without passwords)

  3. "remove" and re-"install" them

  4. write down all shipping-module settings

  5. paste them here

  6. "remove" and re-"install" them

  7. write down all order-total module settings

  8. paste them here

  9. "remove" and re-"install" them ... WITHOUT EDITING SETTINGS or SORT ORDERS etc.

  10. post tax-configuration settings from My Store and from the zones-definitions, tax-classes, and tax-rates.

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

21 Aug 2006, 3:38 AM
#9
mrkrinkle avatar

mrkrinkle

New Zenner

Join Date:
Jun 2006
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon AND Group Discount Tax Problem

I don't really want to uninstall everthing at this stage as it is live however...

When you have taxable and non-taxable items and you apply a discount (Coupon or Group Discount), does the discount subtract from the taxable item or the non-taxable or both?

If both, how does it calculate the amounts to discount from the taxable and non-taxable items?

Anbody know the standard processes that applies here?

Thanks,
Will

21 Aug 2006, 4:16 AM
#10
drbyte avatar

drbyte

Sensei

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

Re: Discount Coupon AND Group Discount Tax Problem

Well, if you're not ready to remove and do deep testing, can you do the steps I mentioned, without actually removing the modules? As well as all the details of the redeemed coupon, the group-discount rates, and the zones info I requested.

The math works in various ways depending on all your settings... It's not a simple algorithm.

Basically, tell me how to reproduce what you're experiencing, and then we can work on finding out what's causing it vs making it work differently.

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

21 Aug 2006, 4:33 AM
#11
mrkrinkle avatar

mrkrinkle

New Zenner

Join Date:
Jun 2006
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon AND Group Discount Tax Problem

Thanks Dr. Byte,

Ok...

ORDER TOTALS

ot_coupon
This module is installed
true
Sort Order
280
Include Shipping
false
Include Tax
false
Re-calculate Tax
Standard
Tax Class
--none--

ot_group_pricing
This module is installed
true
Sort Order
290
Include Shipping
false
Include Tax
false
Re-calculate Tax
Standard
Tax Class
--none--

ot_shipping
This module is installed
true
Sort Order
200
Allow Free Shipping
false
Free Shipping For Orders Over
$50.00
Provide Free Shipping For Orders Made
national

ot_tax
This module is installed
true
Sort Order
300

ot_subtotal
This module is installed
true
Sort Order
100

ot_total
This module is installed
true
Sort Order
999

SHIPPING

flat
Enable Flat Shipping
True
Shipping Cost
6.5
Tax Class
--none--
Tax Basis
Shipping
Shipping Zone
--none--
Sort Order
10

PAYMENT

custom payment module
Enable WebAdvantage Module
True
Merchant ID


E-Mail Address


Payment Zone
--none--
Set Preparing Order Status
Pending [1]
Test Mode
False
Set Processed Order Status
Payment confirmed [WebAdvantage] [6]
Sort order of display.
10

DISCOUNT COUPON

Coupon Name :: PWC
Coupon Amount :: 10.0000%
Start Date :: 30/07/2006
End Date :: 31/12/2006
Uses per Coupon :: Unlimited
Uses per Customer :: Unlimited
Valid Product List :: NONE
Valid Categories List :: NONE
Date Created :: 30/07/2006
Date Modified :: 30/07/2006

I think that is all the relevant modules/settings...

5 Apr 2007, 11:16 AM
#12
vinod_989 avatar

vinod_989

New Zenner

Join Date:
Apr 2007
Posts:
1
Plugin Contributions:
0

Re: Discount Coupon AND Group Discount Tax Problem

I have a problem in tax calcluation. i have applied tax calss at each product. when i apply discount coupn then tax calculation is not correct at the puag and play payment getway .

so please suggect me the solutuion for this