Forums / Currencies & Sales Taxes, VAT, GST, etc. / California Sales Tax Module

California Sales Tax Module

Results 1 to 20 of 57
13 Sep 2006, 01:57
#1
lincomatic avatar

lincomatic

New Zenner

Join Date:
Sep 2006
Posts:
7
Plugin Contributions:
0

California Sales Tax Module

I've implemented a tax module for California. According to the BOE, you're supposed to charge CA local tax based on where the items are going to be shipped. However, any tax that you don't collect is the responsibility of the buyer ... they're the ones who are supposed to submit the tax that they didn't pay. So, I decided to implement something simpler such as what newegg.com does.. basically, you charge your local tax if the order is shipped to your local county, and 7.25% to other destinations in CA. Out of state is not charged tax.

My module contains all of the zip codes in Los Angeles County, and charges 8.25% if the item will be shipped to a zip code withing LA County.

You can easily modify the module to work w/ other states and zip codes.

This is a quick and dirty hack.. the data are all hard coded into the PHP, rather than using SQL ... perhaps I will go back and make it fancier if I have time in the future.
14 Sep 2006, 05:18
#2
lincomatic avatar

lincomatic

New Zenner

Join Date:
Sep 2006
Posts:
7
Plugin Contributions:
0

Re: California Sales Tax Module

I decided that my quick and dirty implementation was too ugly, so I implemented a database version today. You put all your local zip codes into a table called local_zips, and then the php does a query to decide whether or not the zip code is local.

The non-database version is also included in the new zip archive.
14 Sep 2006, 05:23
#3
tinas avatar

tinas

Totally Zenned

Join Date:
Jan 2005
Posts:
1,090
Plugin Contributions:
0

Re: California Sales Tax Module

Thanks for this ! Saves a LOT of set up time for us Californians :D
14 Sep 2006, 05:50
#4
lincomatic avatar

lincomatic

New Zenner

Join Date:
Sep 2006
Posts:
7
Plugin Contributions:
0

Re: California Sales Tax Module

Oops! Sorry I left some debug messages in scl-zip-tax-v2.zip... but for some strange reason I can't edit my previous posts. So here is it again, w/o the debugs.
28 Sep 2006, 19:51
#5
tgs avatar

tgs

New Zenner

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

Re: California Sales Tax Module

Hi there,

It sounds like this might be what I am looking for...

The store is located in Ontario, Canada...and I need to be able to separate out the local and federal taxes in the sales report so the client can remit the appropriate amounts to the government at tax time.

Is there a quick way to change this module to allow this, or is there another solution more suitable...

I had tried the sales report with local filter, but it filters for California and I am not sure how to change that - I get an error message when I change it to Ontario in the stats_sales_report.php file.

Please help! :)
28 Sep 2006, 21:13
#6
tgs avatar

tgs

New Zenner

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

Re: California Sales Tax Module

I found the answer.

I just changed shipping_state':'billing_state to delivery_state':'delivery_state in classes/sales_report.php (line 105)

and

California to Ontario (line 65) in stats_sales_report.php.

:)
15 Oct 2006, 12:20
#7
kbalona avatar

kbalona

Zen Follower

Join Date:
Oct 2006
Posts:
213
Plugin Contributions:
0

Re: California Sales Tax Module

I'm assuming I could use this module for NY and just change the ZIP codes?
25 Oct 2006, 03:13
#8
tj1 avatar

tj1

Totally Zenned

Join Date:
Mar 2005
Posts:
628
Plugin Contributions:
0

Re: California Sales Tax Module

Thanks, this is very nice. I'll check it out right away.

Just one thing, you mention "any tax that you don't collect is the responsibility of the buyer ... ", I think that's wrong, it's the other way around. You (the seller) are resposible for paying sales tax to the BOE, you are allowed, but not required, to pass this cost on to the customer, but you are the one ultimately responsible for making sales tax payments.

I just charge 8.25% for all of California. The BOE does allow this and doesn't mind, it just says if you over-collected just send it all to them. I think most companies do it this way, it's just too much of a hassle figuring it out for all counties/districts unless you only deal withing your local zone.
26 Oct 2006, 15:22
#9
stevehare avatar

stevehare

Zen Follower

Join Date:
Dec 2005
Posts:
108
Plugin Contributions:
0

Re: California Sales Tax Module

Does this module work with: Zen Cart 1.3.0.2
09 Nov 2006, 18:26
#10
kiki_jgh95krs avatar

kiki_jgh95krs

New Zenner

Join Date:
Oct 2006
Posts:
5
Plugin Contributions:
0

Re: California Sales Tax Module

I have Zen cart 1.3.6 (the latest version) and I want to know the advantages and disadvantages of doing it via PHP file or the database.
30 Nov 2006, 02:37
#11
jeremy7786 avatar

jeremy7786

New Zenner

Join Date:
Jun 2004
Posts:
13
Plugin Contributions:
0

Re: California Sales Tax Module

Awesome Module!

Quick question though...

When using this module i get the following in the Order Total Section of the checkout process:

select zip from local_zips where zip='92128'

How can I get rid of this? Thanks!

-Jeremy
06 Dec 2006, 05:18
#12
creeperkat avatar

creeperkat

New Zenner

Join Date:
Nov 2006
Posts:
9
Plugin Contributions:
0

Re: California Sales Tax Module

I am getting a similar error:

select zip from local_zips where zip='92822'
1146 Table 'db188733754.local_zips' doesn't exist
in:
[select zip from local_zips where zip='92822']


It works fine for out of state zip codes but not local.
06 Dec 2006, 15:04
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: California Sales Tax Module

Your "table does not exist" errors indicate that you neglected to install the database table required for the mod to work.
The readme.txt explains to do that.
06 Dec 2006, 18:11
#14
creeperkat avatar

creeperkat

New Zenner

Join Date:
Nov 2006
Posts:
9
Plugin Contributions:
0

Re: California Sales Tax Module

I tried installing the database but I am having a bit of trouble.

My host uses MySQL. Here is what I have done so far:
I go to the database and click on phpMyAdmin and see a list of all the tables.
At the bottom, I see: Create new table on database. I use the name provided in the readme.txt notes. The setup asks me for how many fields, I entered 1.

I change all the attributes to match the sql.txt example. The only thing I wasn't sure about is the type. I left the default which is MyISAM.

It looks like I have everything setup. It looks like I can add them one at a time but is there a way to import a file? I see a link for: Insert data from a text file into the table.
Do I just edit the sample lacountylocalzip.sql txt file so it starts with this (removing the CREATE TABLE stuff at the top of the example):
INSERT INTO `local_zips` (`zip`) VALUES(90001);
INSERT INTO `local_zips` (`zip`) VALUES(90002);
INSERT INTO `local_zips` (`zip`) VALUES(90003);
INSERT INTO `local_zips` (`zip`) VALUES(90004);
INSERT INTO `local_zips` (`zip`) VALUES(90005);
INSERT INTO `local_zips` (`zip`) VALUES(90006);
INSERT INTO `local_zips` (`zip`) VALUES(90007);

Then send it up?
06 Dec 2006, 20:08
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: California Sales Tax Module

No.

Select your Zen Cart database from the left pulldown menu.
Then click on the "Import" tab across the top right (if no "Import", choose "SQL").
Then you can either paste the contents of the lacountylocalzip.sql file in the textbox, or you can browse for the file and upload/submit it.
That should create the table and insert the required records.

If you specified a "table prefix" during installation of your Zen Cart system, you'll need to make some changes to the lacountylocalzip.sql file contents before you do this. You can determine this by checking if your "DB_PREFIX" setting in the /includes/configure.php file is set to blank (ie: '').
06 Dec 2006, 20:55
#16
creeperkat avatar

creeperkat

New Zenner

Join Date:
Nov 2006
Posts:
9
Plugin Contributions:
0

Re: California Sales Tax Module

Think I got it now! Thanks!

One last question. When I use the checkout, step 2 (Payment information) shows this in the YOUR TOTAL box.

select zip from local_zips where zip='92822'

Is there a way to change this?
08 Dec 2006, 17:45
#17
wickedstangs avatar

wickedstangs

New Zenner

Join Date:
Nov 2006
Posts:
48
Plugin Contributions:
0

Re: California Sales Tax Module

Could sure use some help installing this? Thanks
09 Dec 2006, 01:02
#18
wickedstangs avatar

wickedstangs

New Zenner

Join Date:
Nov 2006
Posts:
48
Plugin Contributions:
0

Re: California Sales Tax Module

creeperkat:

Think I got it now! Thanks!

One last question. When I use the checkout, step 2 (Payment information) shows this in the YOUR TOTAL box.

select zip from local_zips where zip='92822'

Is there a way to change this?


I second that how to change it?? very nice hack thank you
12 Jan 2007, 00:16
#19
fymbscu avatar

fymbscu

New Zenner

Join Date:
Jan 2006
Posts:
38
Plugin Contributions:
0

Re: California Sales Tax Module

This sounds like a nice module and I am looking to adapt it to Orange County California.

I have a question about implementation: Why the reliance on zip codes, rather than say, city names. The BOE provides both CVS and Excel versions of the tax rates linked to City and County names, but no zip code information.

Can this module be adapted to work with city names instead of zip codes? Not sure where to get the necessary zip code information.

Thanks for the contribution.

Regards,

Mark Harrison
15 Jan 2007, 17:46
#20
decohenh avatar

decohenh

New Zenner

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

Re: California Sales Tax Module

It would be nice to see this work with cities as well, instead of zip codes. The state publishes a free database that has tax rates based on cities, that is constantly updated. Here is the link for the state database. Thank you.

http://www.boe.ca.gov/sutax/pam71.htm