Forums / Currencies & Sales Taxes, VAT, GST, etc. / Local Sales Tax Mod (with admin!) for testing

Local Sales Tax Mod (with admin!) for testing

Locked

Views: 63,205

Results 81 to 100 of 287
This thread is locked. New replies are disabled.
7 Nov 2007, 8:33 PM
#81
bouncey avatar

bouncey

New Zenner

Join Date:
Oct 2006
Location:
Norman, OK USA
Posts:
26
Plugin Contributions:
0

Local Sales Tax Mod (with admin!) for testing

I'll try a quick hack and let you know what happens. :smile:

...

Actually... You might be right. The data that provides the tax rate is coming back from Google, meaning they have already decided on a tax rate (or lack thereof). I'll have to dig a bit deeper.

7 Nov 2007, 10:26 PM
#82
bouncey avatar

bouncey

New Zenner

Join Date:
Oct 2006
Location:
Norman, OK USA
Posts:
26
Plugin Contributions:
0

Re: Local Sales Tax Mod (with admin!) for testing

I'm still not sure how it all fits together and where we can insert some extra logic, but there is definitely some tax related code in there.

There's a library file (googletax.php) with some tax-related stuff, but the real action seems to be in gcheckout.php. Also there's a parameter buried inside to turn "merchant calculated tax" on and off -- but it's off by default.

So far it looks like at least it's checking taxability status from the tax_class table. Also it might be generating a list of tax rules from tax_table, countries, zones_to_geo_zones, and zones tables.

Now whether any of that is actually being used? Dunno for sure. I tried adding zone-based tax info for Oklahoma (just the state rate, ignore county and local), modeled after what was already in there somehow for Florida. It still refuses to do any taxes for OK. But maybe I don't have something set up right.

Edited to add: Hard-coding merchant calculated tax to "true" actually got a result! Okay, so now GC thinks that 4.5% of $8 is $15 somehow. But it's a start. Something got passed through.

7 Nov 2007, 10:32 PM
#83
ladyhlg avatar

ladyhlg

Zen Follower

Join Date:
May 2005
Posts:
361
Plugin Contributions:
1

Re: Local Sales Tax Mod (with admin!) for testing

It sounds like we might have to talk directly to the google checkout developers to find out for sure if zone taxes are even possible.

7 Nov 2007, 11:20 PM
#84
bouncey avatar

bouncey

New Zenner

Join Date:
Oct 2006
Location:
Norman, OK USA
Posts:
26
Plugin Contributions:
0

Re: Local Sales Tax Mod (with admin!) for testing

You're right, the actual Google crew might have some better insights. But I'm pretty sure the underlying XML APIs support several different kinds of tax "zone" types. There's an explicit type for zip code anyway.

At least local tax calculation is working for the PayPal and cash/check payment options. If anyone else needs the data for Oklahoma, look here: [link to default zip lookup tool] Then hit the "DOWNLOAD TXT" button, but only after reading the stern Due Diligence warnings and trembling in fear.

I have a perl script to turn the downloaded file into SQL to be applied through the Zen Cart admin query tool. You can get it here: [link to file] It was designed and tested on a Mac, so no guarantees that it'll work on anything else yet.

I could just upload the finished SQL, but the rates change every few months...

Ya know, PHP and Perl are almost addictive. :laugh:

12 Dec 2007, 4:53 PM
#85
bushkillfarms avatar

bushkillfarms

New Zenner

Join Date:
Dec 2007
Posts:
9
Plugin Contributions:
0

Re: Local Sales Tax Mod (with admin!) for testing

I'm having some issues with the Total not being calculated correctly. I'm sure I've got some admin setting screwed up, but for the life of me can't figure it out.

I have set up a a New York zone with and associated tax rate of 4%. I have also set up local tax rates for each zipcode (4% for Ulster in this example). I also have tax on shipping enabled.

It seems to handle the total correctly when I have the local sales tax module disabled in Order Total.

But once I activate the local sales tax module, the total is wrong.

I'm running ZEN 1.3.7.1 with Local Sales Tax Mod v1.2

Any guidance would be greatly appreciated.

12 Dec 2007, 5:08 PM
#86
ladyhlg avatar

ladyhlg

Zen Follower

Join Date:
May 2005
Posts:
361
Plugin Contributions:
1

Re: Local Sales Tax Mod (with admin!) for testing

My first suggestion is to check the sort order for your Order Total Modules.
You may have to play with these settings to see what works.
For my test cart I have the subtotal calculated first, then shipping, then Local Sales Tax, then Tax, then Total.

Hope that helps.
LadyHLG

12 Dec 2007, 5:38 PM
#87
bushkillfarms avatar

bushkillfarms

New Zenner

Join Date:
Dec 2007
Posts:
9
Plugin Contributions:
0

Re: Local Sales Tax Mod (with admin!) for testing

LadyHLG:

For my test cart I have the subtotal calculated first, then shipping, then Local Sales Tax, then Tax, then Total.

That is the same order as mine are set up:blush:

One thing that is not clear to me, though I don't believe it has any bearing on this mod is the difference between zones and zone definitions under the Location/Taxes tab. I set up a New York zone under Location/Taxes -> Zone Definitions because I couldn't figure out how to assign a tax rate to the New York predefined in the Location/Taxes -> Zones

12 Dec 2007, 6:09 PM
#88
ladyhlg avatar

ladyhlg

Zen Follower

Join Date:
May 2005
Posts:
361
Plugin Contributions:
1

Re: Local Sales Tax Mod (with admin!) for testing

Setting up the zones can be a bit confusing.
Did you happen to take a look at the following FAQ?
https://www.zen-cart.com/tutorials/index.php?article=76

It goes step by step through the process.

LadyHLG

12 Dec 2007, 8:06 PM
#89
bushkillfarms avatar

bushkillfarms

New Zenner

Join Date:
Dec 2007
Posts:
9
Plugin Contributions:
0

Re: Local Sales Tax Mod (with admin!) for testing

Looked at the FAQ and that is exactly how I did it.

I just did a complete reinstall of zen cart and the local tax module and still have the same problem. I have also tried many different scenarios with the Order Total modules with no luck either. I was hoping to come up with some type of work around like doing away with the 4% NYS tax and just uping all the counties by 4%, but as soon as I remove Tax from the order total, I loose the local tax from the checkout as well.

I guess one question I have is why does the local tax show up after the state tax during checkout if I have it sorted before the state tax. Everything else seems to show up in the order sorted by.

I'm out of ideas of things to try now, guess I'll sleep on it before I give up completely. What a bummer, this module is exactly what I need to be able to get my online store going.....

12 Dec 2007, 8:08 PM
#90
ladyhlg avatar

ladyhlg

Zen Follower

Join Date:
May 2005
Posts:
361
Plugin Contributions:
1

Re: Local Sales Tax Mod (with admin!) for testing

I would be happy to help narrow down the problem, are you testing locally or online somewhere?

12 Dec 2007, 8:36 PM
#91
ladyhlg avatar

ladyhlg

Zen Follower

Join Date:
May 2005
Posts:
361
Plugin Contributions:
1

Re: Local Sales Tax Mod (with admin!) for testing

bushkillfarms,
I think maybe there is a problem in the calculations. I just did some testing using 4% for state and 4% for local and the numbers are not totally correctly.
I'm not sure what is happening let me take a closer look and see if I can find the problem.

LadyHLG

12 Dec 2007, 8:42 PM
#92
bushkillfarms avatar

bushkillfarms

New Zenner

Join Date:
Dec 2007
Posts:
9
Plugin Contributions:
0

Re: Local Sales Tax Mod (with admin!) for testing

Thanks for the offer. I just sent you a PM

Rob...

12 Dec 2007, 8:45 PM
#93
ladyhlg avatar

ladyhlg

Zen Follower

Join Date:
May 2005
Posts:
361
Plugin Contributions:
1

Re: Local Sales Tax Mod (with admin!) for testing

Got it! Sent a reply.
I think we might be seeing a bug.
Doing some testing now and will get back you!

LadyHLG

12 Dec 2007, 9:18 PM
#94
ladyhlg avatar

ladyhlg

Zen Follower

Join Date:
May 2005
Posts:
361
Plugin Contributions:
1

Re: Local Sales Tax Mod (with admin!) for testing

I think I found it!!

Replace the following file with the one attached below, give it a test and let me know if your numbers work out correctly.

includes\modules\order_total\ot_local_sales_taxes.php

LadyHLG

13 Dec 2007, 12:03 AM
#95
bushkillfarms avatar

bushkillfarms

New Zenner

Join Date:
Dec 2007
Posts:
9
Plugin Contributions:
0

Re: Local Sales Tax Mod (with admin!) for testing

LadyHLG,

Gave it a shot, and the good news is the total is now correct.

BUT, now I have another problem. When I add a non-taxable item to the cart. In this example, a $10 item to the above example. The State Tax correctly stays the same, but the Local tax is incorrectly applied to it, and an extra Tax: $0.00 is displayed.

13 Dec 2007, 4:55 PM
#96
ladyhlg avatar

ladyhlg

Zen Follower

Join Date:
May 2005
Posts:
361
Plugin Contributions:
1

Re: Local Sales Tax Mod (with admin!) for testing

Unfortunately this is where things start to get much more complicated. None of the previous local sales tax mods dealt with non-taxable items and since mine was built based on those it doesn't either. I'm not saying it isn't possible, its just going to take some time to figure out.

I will post back here when I have something.

LadyHLG

13 Dec 2007, 10:43 PM
#97
dharper1988 avatar

dharper1988

New Zenner

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

Re: Local Sales Tax Mod (with admin!) for testing

Hi i just finished my tax list for Florida by the County zip codes if someone wants it and if there are any errors can you tell me? This is from my backup.

14 Dec 2007, 3:24 AM
#98
klept0 avatar

klept0

New Zenner

Join Date:
Dec 2007
Posts:
2
Plugin Contributions:
0

Re: Local Sales Tax Mod (with admin!) for testing

dharper1988:

Hi i just finished my tax list for Florida by the County zip codes if someone wants it and if there are any errors can you tell me? This is from my backup.

Ill be testing this tonight...I'll let you know...Ive been dreading this task but I decided to find the forums and hunt for help and your a godsend...so testing will commence tonight

14 Dec 2007, 5:51 AM
#99
klept0 avatar

klept0

New Zenner

Join Date:
Dec 2007
Posts:
2
Plugin Contributions:
0

Re: Local Sales Tax Mod (with admin!) for testing

works like a charm..thanks to all who have helped make this possible...for someone new @ this whole thing you guys sure made it easy and user friendly...thanks to ladyhlg for the original deal and thanks to dharper1988 for doing FL for all of us! :clap:

14 Dec 2007, 6:17 PM
#100
ladyhlg avatar

ladyhlg

Zen Follower

Join Date:
May 2005
Posts:
361
Plugin Contributions:
1

Re: Local Sales Tax Mod (with admin!) for testing

I have uploaded a new version of the Local Tax Mod to the downloads section.

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=623

This new version supports Tax Classes which in turn supports non-taxable items.
It also contains some bug fixes for previous calculation problems.

I STRONGLY RECOMMEND THAT EVERYONE UPDATES TO THE NEW VERSION.

Upgrading is easy, simply copy over the new Local Sales Tax Mod files (overwriting the old ones) and run the included database sql updates.

Also, because this new version supports tax classes, each local tax must now be associated with a zen cart tax class id. I have included an sql file to update all your local tax rates to a single tax class id. For most people this will be the default "Taxable Goods" (Tax Class ID 1) that was created with your zen cart install.

For any of you who have more than one type of tax class or have altered the tax classes you will need verify your tax class id before running the included sql file and update the id number if necessary.

To verify your "Taxable Goods" Tax Class ID in your cart admin go to:
Locations/Taxes -> Tax Classes
This will show you all the Tax Classes defined for your cart, the ID for each class is on the far left.

If you only have one tax class and its ID = 1 then you dont have to update anything, just upload the included SetAllTaxClasses.sql file.

If your tax class ID is not 1 then you will need to open SetAllTaxClasses.sql and change the **1 **to whatever your tax class ID is:

UPDATE `tax_rates_local` SET `local_tax_class_id`=[B]1[/B];

Save your changes and upload the SetAllTaxClasses.sql file.

If you have more than one tax class you will need to decide which tax class your local taxes are to be applied to and use that Tax Class ID.

I hope this isn't too confusing, just take a deep breath and go slow. Be sure to read the included readme.txt and/or upgradenotes.txt files and follow the directions.

As, always, be sure to back up your files and database before you begin.

Good Luck!

LadyHLG