Community Add-Ons
New York State Tax By Zip Code
for osCommerce Online Merchant v2.2
this is a modifiation that collects tax bases on New York zip codes.
This can be used for other states as well, as long as you have the tax-by-zip code.
The 'advantage' of this system is that it creates a new zip tax table and uses that to look up the rates. I thought the 60+ tax zones/rates that new york state has would be too cumbersome to manage within oscommerece....
I loved this contribution, so I am adding PA codes for anyone who needs them. Just run this SQL.
UPDATED ziptax.sql for tax rates Effective December 1, 2007
-- Reverted back to three decimal places for 1/8, 3/8, 5/8, 7/8 for accuracy
-- Also broke up Westchester to separate Mt Vernon, New Rochelle, White Plains, Yonkers (they have different tax rates)
-- Hopefully everything's right ;)
Enclosed is only the updated SQL file
(And thanks to the author(s) for a great contrib!)
Updated ziptax table. The previous uploaded tax table included the state tax added in. This update backs out the state tax as this contribution combines the state tax and the county tax from the ziptax table.
All credit goes to the authors of this great contribution that has made my life much easier!!
Not a complete package. Just the updated ziptax table.
CHANGES Version 1.1
**************************************************************************
- Created the missing new button in the admin area.
- Fixed problem in admin area: county would be erased when editing in the admin area or would not be inserted when creating a new zip tax
- Added ability in the admin area to edit the tax rate and apply it to all zip codes that belong to a certain county for easier updating when new tax rates come out
- Updated the zip code tax rate data to the latest tax rates given by New York State June 1, 2007.
NOTES:
**********************************************************************************
Instead of editing every single zip code you can easily edit the tax rate for every zip code in a county in one step.
For the updated tax rates I rounded up the hundreths place so 8.623 would be 8.63. If I had time I would have made
the county a drop down list when editing the tax rate for all zips in a county. That way you dont have to go from page
to page untill you find the next county to edit. Maybe in the future.
Henry C. Weismann IV
www.weismannwebservices.com
www.intellitechsolutions.com
June 1, 2007 Tax Rates Update
*******************************
I updated the ziptax table with the latest county taxes and exported it to an sql file. Just run this sql file using phpMydamin and thats it. These Tax Rates were effective June 1, 2007.
For details on the data used visit see the PDF file in this package.
This download only includes the SQL file to import and the PUB-718 New York State Sales and Use Tax Rates by Jurisdiction PDF fronm the state of NY's website.
####################################################
New York State Tax By Zip Code Modification 1.01 ####################################################
CHANGES Version 1.01
**************************************************************************
- Fixed tep_get_tax_description and tep_get_tax_rate functions: the county tax was being added only if
a tax rate was already happening for New York or the US.
- Also fixed problem with the tep_get_tax_description not outputing or appending the count tax description at all.
CHANGES Version 1.0
*********************************
- Gave the mod a version to allow for versioning and keeping things organized
- Fixed table name error in sql file and compiled it into a simpler set of sql instructions
- Included the definition for TABLE_ZIPTAX in the instructions to remove admin error
- Cleaned up and rewrote installation intructions to make installation easier
- Combined the instructions and files for the Front End and Back End Administation parts of the mod.
This is admin tool to add/edit/delete taxes.
This is and assemble of all prev table updates and bug fixed + some install changes. Full package.
If a user enters the full zip (for example: 11967-1737) it will not be found in the tax table.
To fix this just go to 'catalog/includes/functions/general.php' and find this code:
$county_taxquery = tep_db_query("select zip_tax_rate from " . TABLE_ZIPTAX . " where zip_code = '" . $tax_zip_code . "'");
add this directly above it:
$tax_zip_code = trim($tax_zip_code); // This trims any spaces they may have entered after/begin the zip
if(strlen($tax_zip_code) > 5){
$tax_zip_code = substr($tax_zip_code,0,5); // This cuts the zip down to the first 5 digits
}
This file fixes an error with two counties in the previous file i posted. They were added without the base 4% state tax...
This sql file contains updated sales tax information from NY State Department of Taxation and Finance Publication 718 (2/05).
It might contain errors or omissions, so use at your own risk...
(NY Case - comments apply to other cases)
Bear in mind that if the user is from NY and enters a ZIP code that is not found in the ziptax table (by mistake, or on purpose), then they will be charged less tax than they should.
An easy workaround to this (for the simple NY case) is to check the $zone_id, and if in NY (for example), then default the $county_taxrate to a suitable value if the zip code is not found.
this is a modifiation that collects tax bases on New York zip codes.
This can be used for other states as well, as long as you have the tax-by-zip code.
The 'advantage' of this system is that it creates a new zip tax table and uses that to look up the rates. I thought the 60+ tax zones/rates that new york state has would be too cumbersome to manage within oscommerece....
