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.
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.
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.
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.
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.
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.
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);
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: '').
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.
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.