If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / Incorrect processing of Tax

Incorrect processing of Tax

Started by dbltoe on 17 Nov 2023, 4:14 PM · Views: 5,047

Results 21 to 40 of 50
30 Nov 2023, 10:11 PM
#21
wilt avatar

wilt

Oji-san

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

Incorrect processing of Tax

I've been investigating this issue and have come up with a reason that it is failing.

The biggest issue relates to how customer accounts are being created, and maybe you can confirm.
The current default in Zen Cart is not to use dropdowns for state zones. e.g states are entered free hand.

In this scenario the entered State is not checked against the potential states allowed for a country
e.g I can enter a state called "florid" and there will be no validation on this, even if a correct state is entered it still wont be validated against correct states allowed for the country id subsequently the entry zone id in a customer address book is set to 0

Furthermore all of our tax calculations attempt to match a tax zone id against an adddressbook entry zone id and will never match as the addressbook entry zone id is always 0

There are mitigations we can make here. e.g trying to find the real zone id from the country id/state in the zone table and this will work if the customer has entered a valid state name (e.g FL or Florida) but will fail if they have entered an incorrect state name .e.g. "florid"

I do have some ideas how we can further mitigate if the customer has entered an invalid state name, but this requires an intervention at various places in code

Will post more about this

30 Nov 2023, 10:25 PM
#22
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

I the non-functioning test site, we have only one customer. That customer's entry_zone_id is correctly shown in the database. zone_counry_id - 23, zone_id - 57, zone_code - TX and zone_name - Texas. The store is set to Florida and all buttons are in the green.

The test site also does not use dropdown state information for log in. BUT, some browsers enter the data with autofill.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

30 Nov 2023, 10:32 PM
#23
wilt avatar

wilt

Oji-san

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

Re: Incorrect processing of Tax

k. thanks.
then it maybe there is something else going wrong.
will do a quick test with your data.

30 Nov 2023, 10:39 PM
#24
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

It's greatly appreciated.

I can provide full access if needed.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

1 Dec 2023, 3:10 PM
#25
wilt avatar

wilt

Oji-san

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

Re: Incorrect processing of Tax

Just another question.

Assume your scenario is this

Store is set to be in Florida e.g STORE_ZONEi 18, STORE_COUNTRY = 223
Customer is in Texas with correct entry zone id in database

Surely Florida tax regs say you only collect tax on an in state customer, but not for out of state

1 Dec 2023, 3:43 PM
#26
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

I set it to Florida to match the test site created by lat9

Shouldn't it make no difference as Zen Cart is told rather than decides how to procecss tax?

We're still telling it to display at product (doesn't when returning to the shopping cart) and collect based on the store (does sometimes but does not include the amount in the total).

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

1 Dec 2023, 4:13 PM
#27
wilt avatar

wilt

Oji-san

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

Re: Incorrect processing of Tax

I think we might be getting confused here and I'm not grokking what your expected outcome is

If I set product tax to be 'Store' based then Zen Cart will only calculate some tax if the customer is in the same 'zone' as the store.
Therefore if the store is Florida and the customer is in Texas then tax will be calculated at zero

think all the posts in this thread might be confusing what your main issue is

Happy to go back to first principles

1 Dec 2023, 4:16 PM
#28
wilt avatar

wilt

Oji-san

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

Re: Incorrect processing of Tax

Note as well
US sales/shipping tax related to e-commerce is a nightmare

e.g. California has a mix of origin and destination based taxes (its always California)

and there are some things Zen Cart does not handle (eg county/district based taxes)

Lots of rich tax lawyers out there.

1 Dec 2023, 5:18 PM
#29
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

wilt:

If I set product tax to be 'Store' based then Zen Cart will only calculate some tax if the customer is in the same 'zone' as the store.
If this is true, how can our customer (New Mexico) comply with his state’s tax law that requires he charge tax on all sales?

Isn’t that what tax based on store should really do?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

1 Dec 2023, 7:25 PM
#30
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

To begin again, again....

Store is based in New Mexico. You can find information that New Mexico store owners both do (07/23) and do not (07/21) have to charge tax to all customers.

I have been unable to get a response from New Mexico's tax folks as to the TRUE setting. Meanwhile, we have to go with tax applied to anyone shopping at the site and sending anywhere.

The zone has to be set in order to determine the amount of tax (it's Gross Receipts vs Sales Tax in New Mexico), correct?

If the goal is to charge everyone who visits the site a tax rate of 7.72%, what would be the settings in Zen Cart to facilitate this process?

I have been unable to find any combination that accomplishes this.:frusty::frusty:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

2 Dec 2023, 3:51 AM
#31
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Incorrect processing of Tax

That's because (as @wilt indicated earlier) he's working on a solution for stores that use a tax-basis of "Store". Please be patient, it's not an easy correction.

2 Dec 2023, 4:28 AM
#32
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

That was clarification. Not impatience.

it was the first time there has been any indication that setting the tax to store would only be charged if the buyer was in the store zone.

That is simply counter to what the settings infer.

I understand the desire to “work on one’s own turf”, but I still offer the test site and any other assistance needed in solving this issue.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

2 Dec 2023, 8:28 PM
#33
wilt avatar

wilt

Oji-san

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

Re: Incorrect processing of Tax

Hi

First off as per internet regulations, I'm not a Tax lawyer. :)

I had a quick look at New Mexico state law and as ever all the information is poor with no definitive guidance for e-commerce sales
If any one else has some more insight, feel free to post here.

if it is the case that New Mexico requires you to charge x% for any US destination, then this is doable in Zen Cart

Basically you need to set up a Zone Definition which is tied to USA and covers all zones within the USA rather than tying it to a specific State like say the example Florida sales tax.

You can do this in Zone Definitions

Click on Insert and name the zone, e.g. New Mexico

For the newly created New Mexico entry click on the 'Details' button in the right side bar.

Now click on insert

you can then set the country to USA and the zones to all zones
(it doesn't give you an option for all zones, but as long as you don't select a zone and submit it will set to all zones)

Lets go to Tax Rates next

You might already have a taxable goods tax rate here.
If so, edit it
and change the Zone to New Mexico and set the TaxRate and description appropriately
If no Tax rates set then just create one and go from there.

HTH

2 Dec 2023, 11:47 PM
#34
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

New Mexico does not have a "Sales Tax" per se. It has a "Gross Receipts Tax" which is levied against ALL e-commerce sales. It is up to the seller to decide if the tax is passed on to the consumer or not.

The GRT is charged the owner whether the sale is in Albuquerque, London, New York, Sydney, or Tajikistan. The seller, particularly our customer, has the option to pass that tax on to the customer or raise their prices to absorb the fee.

This is not an option as the seller also attends functions in other states selling his product and feels the basic price should be the same to all customers. If the GRT were added to the product when selling in Texas, the Texas Sales Tax of 8.5% would added making the product less expensive if they skipped his Texas show and bought online.

The fairest to the customer is to add the GRT as if a Sales Tax is being charged to the whole world if they purchase online.

With that in mind, why would a store set to charge tax on the store's location not be able to charge tax to anyone?. The tax is set on the store's Zone, is it not?

Why are we getting the old "Illegal bounds interupt, STOP" from the system when we say charge based on the store's tax rate for both shipping and the product?

Other note to follow....

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

3 Dec 2023, 12:14 AM
#35
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

I wanted to keep this separate from the other as I think it has been lost in the shuffle.

THIS IS CURRENTLY THE STORE

Configuration >> My Store >> Basis of Product Tax and Basis of Shipping Tax set to Store

Display Prices with Tax to true

Shipping is USPS, Taxable Goods, Tax Basis - Store

Zone Definitions show New Mexico and described as New Mexico Gross Receipts Tax Zone

Tax Classes set to Taxable Goods

Tax Rates is set to Taxable Goods, Zone - New Mexico, Tax Rate - 7.75%

With the stated logic that any order from Texas should not show up as being taxed, that is what is happening.

With the stated logic that any order from New Mexico should show up as being taxed, (again) that is what is happening.

**BUT...

**Although the tax shows everywhere the system tells it to be displayed, it is NEVER added to the Total!

In my mind, this constitutes an error.

He said patiently:P

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

3 Dec 2023, 12:53 AM
#36
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

AND.....

The tax should be $1.62 if shipping is correctly taxed as listed.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

3 Dec 2023, 1:55 PM
#37
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Incorrect processing of Tax

dbltoe:

I wanted to keep this separate from the other as I think it has been lost in the shuffle.

THIS IS CURRENTLY THE STORE

Configuration >> My Store >> Basis of Product Tax and Basis of Shipping Tax set to Store

Display Prices with Tax to true

Shipping is USPS, Taxable Goods, Tax Basis - Store

Zone Definitions show New Mexico and described as New Mexico Gross Receipts Tax Zone

Tax Classes set to Taxable Goods

Tax Rates is set to Taxable Goods, Zone - New Mexico, Tax Rate - 7.75%

With the stated logic that any order from Texas should not show up as being taxed, that is what is happening.

With the stated logic that any order from New Mexico should show up as being taxed, (again) that is what is happening.

**BUT...

**Although the tax shows everywhere the system tells it to be displayed, it is NEVER added to the Total!

In my mind, this constitutes an error.

He said patiently:P

dbltoe:

AND.....

The tax should be $1.62 if shipping is correctly taxed as listed.
Although the edit orders debug data may reflect the answer to this question as it is the only place I found related data, what is the sort order for the various order total modules?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

3 Dec 2023, 2:11 PM
#38
wilt avatar

wilt

Oji-san

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

Re: Incorrect processing of Tax

Not sure how you have your taxes set up

I started with a clean v158 install - no demo products
Set the store location to New Mexico
Removed the Tax Rate for Florida
Created a Zone Definition for New Mexico and a Tax Rate for the Zone @ 7.75

Set basis of Product Tax to Store.

Created a product @ 15.90 and set to Taxable Goods

Created a customer with NM address and purchased product.

Attachment 20438

With a little more work (edited Flat rate in shipping to be taxable/store) and got this

Attachment 20439

3 Dec 2023, 2:31 PM
#39
wilt avatar

wilt

Oji-san

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

Re: Incorrect processing of Tax

k.

Think I have reproduced you error.

3 Dec 2023, 2:36 PM
#40
wilt avatar

wilt

Oji-san

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

Re: Incorrect processing of Tax

Can you check your database and confirm the entry_zone_id in addressbook for the customer in the order you posted