Zen Cart Logo
Forums / Bug Reports / [Done v1.3.9] Sales Tax Calculation Incorrect

[Done v1.3.9] Sales Tax Calculation Incorrect

Locked

Views: 6,543

Results 21 to 29 of 29
This thread is locked. New replies are disabled.
14 May 2009, 5:54 PM
#21
batterygenie avatar

batterygenie

New Zenner

Join Date:
May 2008
Location:
Thousand Oaks, CA
Posts:
30
Plugin Contributions:
0

[Done v1.3.9] Sales Tax Calculation Incorrect

Perhaps a bad example of what I meant:

Here's another Sample order:
Sub-Total: $17.99
Standard: $7.99
Discount Coupon: SAVE20 : -$3.60
Tax (CA residents only) + : $1.18
Total: $23.56

Tax Rate of 8.25%

In the MySQL orders_total table it stores the tax as value 1.1838.

The value I get with my trusty calculator is 1.187175. Rounded up the value should be 1.19.

The problem is that half of the taxable orders end up rounding incorrectly, so at the end of the month I'm a dollar or more off my numbers. It's more annoying than anything else, but I'm really curious if this is a problem inherent in Zen Cart. I do have a number of mods installed--it could always be something like that--but I've tried not to tinker with anything crucial to order processing.

Anyway, looking through my orders it looks like something that's existed since installation. I have two sites and one is running 1.3.8 and the other is still on 1.3.7 but the problem looks like it exists in both locations.

20 May 2009, 12:24 PM
#22
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: [Done v1.3.9] Sales Tax Calculation Incorrect

fergusmacdonald:

Fantastic, thanks. Will try it out and let you know if i get any problems.

Much appreciated.

Unfortunately it appears that this issue has not been fixed by the change posted in all areas.

Discount Coupon
Include Shipping
false

Include Tax
false

Re-calculate Tax
Standard

Sub-Total: £10.00
Free Shipping: £0.00
Discount Coupon: thanksforten :-£1.00
Included VAT @ 15%:£1.17
Total:£9.00

All these figures appear to be correct, however, the coupon is including tax, yet include tax is set to false. When there is no tax on an order, it also calculates correctly, so even though the controls are the wrong way round - it works!

However, when there is a quantity of 10 products in the cart:

Sub-Total: £100.00
Free Shipping: £0.00
Discount Coupon: thanksforten :-£10.01
Included VAT @ 15%:£11.74
Total:£90.00

A myseterious 1 pence appears on the discount, but not in the total. Change the quantity to 100 and it is corrected.

Quantity Discount

On the quantity discount module, a problem still exists.

When:
Include Tax
true

Re-calculate Tax
None

Sub-Total: £100.00
Free Shipping: £0.00
Quantity Discount (10%) :-£10.00
Included VAT @ 15%:£13.04 (incorrect)
Total:£90.00

When:
Include Tax
false

Re-calculate Tax
Standard

Sub-Total: £100.00
Free Shipping: £0.00
Quantity Discount (10%) :-£8.70
Included VAT @ 15%:£11.73
Total:£89.99

Any help on this would be much appreciated.

20 May 2009, 8:27 PM
#23
wilt avatar

wilt

Oji-san

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

Re: [Done v1.3.9] Sales Tax Calculation Incorrect

@fergusmacdonald

k

on the include_tax setting, I think you might be misunderstanding its use.

The include_tax setting does not govern whether the coupon will include tax in its output figure, but whether tax should be included in the total value that the coupon discount is calculated on.

Generally as discount coupons recalculate the tax anyway, you do not need to include tax. However the reason for the setting is that in some tax jurisdictions, a discount coupon can be sometimes considered as a fixed discount amount (much like a Gift Voucher) where tax is not recalculated, but the coupon may reduce the total order value including tax.

As for the penny difference you are seeing when using 10 items. I am not seeing this in my v139 code. (which contains fixes in a number of files to address rounding problems)

These changes have been posted elsewhere, but i'll try and come up with a definitive list.

N.B. haven't looked at the quantity discount prob you posted yet.

20 May 2009, 8:34 PM
#24
wilt avatar

wilt

Oji-san

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

Re: [Done v1.3.9] Sales Tax Calculation Incorrect

@batterygenie

BTW haven't forgotten about you either. Will test asap

20 May 2009, 8:49 PM
#25
wilt avatar

wilt

Oji-san

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

Re: [Done v1.3.9] Sales Tax Calculation Incorrect

@fergusmacdonald

The quantity discounts is a 3rd party contribution IIRC, so not sure how much I can help with that.

21 May 2009, 3:25 PM
#26
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: [Done v1.3.9] Sales Tax Calculation Incorrect

wilt:

@fergusmacdonald

k

on the include_tax setting, I think you might be misunderstanding its use.

The include_tax setting does not govern whether the coupon will include tax in its output figure, but whether tax should be included in the total value that the coupon discount is calculated on.

Generally as discount coupons recalculate the tax anyway, you do not need to include tax. However the reason for the setting is that in some tax jurisdictions, a discount coupon can be sometimes considered as a fixed discount amount (much like a Gift Voucher) where tax is not recalculated, but the coupon may reduce the total order value including tax.

As for the penny difference you are seeing when using 10 items. I am not seeing this in my v139 code. (which contains fixes in a number of files to address rounding problems)

These changes have been posted elsewhere, but i'll try and come up with a definitive list.

N.B. haven't looked at the quantity discount prob you posted yet.

Ah ok, maybe i understood it correctly. My understanding is as follows:

Include tax:true

Sub-total: £11.00
Discount (10%): £1.10
Total: £9.90

That means the coupon would take 10% off the price including tax.

If include tax:false
Sub-total: £11.00
Discount (10%): £1.00
Total: £10.00

So the include tax variable controls whether the discount is calculated from the sub-total including or excluding tax.

Is that correct?

21 May 2009, 3:26 PM
#27
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: [Done v1.3.9] Sales Tax Calculation Incorrect

wilt:

@fergusmacdonald

The quantity discounts is a 3rd party contribution IIRC, so not sure how much I can help with that.

No worries, i thought that the two were a related problem. I will try posting on the support forum.

21 May 2009, 3:33 PM
#28
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: [Done v1.3.9] Sales Tax Calculation Incorrect

wilt:

@fergusmacdonald

As for the penny difference you are seeing when using 10 items. I am not seeing this in my v139 code. (which contains fixes in a number of files to address rounding problems)

These changes have been posted elsewhere, but i'll try and come up with a definitive list.

Any news on where i can get a list of these changes, or where you can get v139?

Thanks.

21 May 2009, 9:49 PM
#29
batterygenie avatar

batterygenie

New Zenner

Join Date:
May 2008
Location:
Thousand Oaks, CA
Posts:
30
Plugin Contributions:
0

Re: [Done v1.3.9] Sales Tax Calculation Incorrect

Hmm...I initially thought I was having a similar problem as fergnus but I'm beginning to think after reading these latest posts that it may be an unrelated issue...at least as far as quantity discounts is concerned. Oh well, I can hang out here for a bit until someone can shine a light on this...