ohmygod. this has been killing me, but i think i have it licked.
first post, so bear with me. i might ramble from sleep deprivation.
i have no idea how to put together a zc mod, but i would be happy to work with someone who does, to get this out there. i have been up working on this since about three this afternoon (now about two a.m.) so i am not exactly ready to post code. please give me a chance to clean it up.
anyhow, what i am doing is this: i took the csv file offered by the state of wa, which breaks down the city/county zones as larger chunks than just going with zip codes. the result is a smaller file. yay. i opened it in a spreadsheet program (openoffice.org) and killed the header row, and all columns but the location code name, the location code, and the tax rate for said location. i then resaved it as a csv file.
i put together an admittedly ham-fisted script to:
a) parse the csv file,
b) create new rows in the zc table 'zones', using the wa location code preceded by a 9 as the zone_id column. for future updates, the script first deletes all rows with a zone_id greater than 1000. so, a new row looks like: ```
9100 223 WA ADAMS COUNTY
c) update the 'geo_zones' table with rows that look like```
1 WA Washington Local Sales Tax For: ADAMS COUNTY NULL 0001-01-01 00:00:00
d) update the 'zones_to_geo_zones' table to look like ```
1 223 9100 1 NULL 0001-01-01 00:00:00
and e) update the 'tax_rates' table to show the appropriate sales tax for each location: ```
1 100 1 1 9.0000 Local Sales Tax ADAMS COUNTY NULL 2008-10-17 01:29:04
and to make it all work:
when someone enters their information in the login page, everything below the 'Address Details' is hidden. clicking a continue button that i added makes an ajax call to the state, using the destinationtax.com code referenced above (a lifesaver) if 'WA' (case-insensitive, of course) is entered in the state field. after the destinationtax.com code returns a location name, that name is inserted into the form. i noticed that the actual state does not matter; it is a zone reference that is passed to the zc database. so, as in my example, since 'adams county' has a zone_code of 'WA', that is what shows up onscreen, on ups labels, etc.
so, when the above ajax call returns true, the rest of the form is revealed.
i need sleep. and i just noticed that i need to pass date/time to the db.