Herro!,
Does anybody know if there's a mod that deals with the destination based sales tax that starts in WA 7/1/8: http://dor.wa.gov/Content/FindTaxesA...d/MoreSST.aspx
Herro!,
Does anybody know if there's a mod that deals with the destination based sales tax that starts in WA 7/1/8: http://dor.wa.gov/Content/FindTaxesA...d/MoreSST.aspx
Anyone ?
Is there a practical solution to this without a mod?
It seems like one would have to enter 1000s of zone records to match up the over lapping zip code / counties if it even is possible.
And the online lookup service they provide: http://dor.wa.gov/Content/FindTaxesa...ookUpATaxRate/
does not lend itself to automation. I would have thought that they could have provided a web service or something....
I'm needing a solution too. I have done a bit of work on the problem but perhaps there are other here who could help finalize the solution.
I'm using the WAStateRateParser.inc.php file from:
http://www.destinationtax.com/washin...tax-lookup.htm
And I wrote the following code to call the function
The problem I have is I'm not familiar enough with where zen-cart stores the address, city, state, zip of the shipping destination, or how to insert the calculated tax rate to override what zen-cart would do on it's own.Code:<?php // $override_tax_rate is used incase there are any problems connecting to or with the results returned from dor.wa.gov. (value is percent expressed as a decimle 9% = .09) $override_tax_rate = ".09"; // when set to true only the debug settings will be used $wa_tax_debug_mode = "true"; // ########## DEBUG SETTINGS ########## $wa_tax_debug_address = "6500 Linderson way"; $wa_tax_debug_city = ""; $wa_tax_debug_zip = "98501"; // 5 or 9 digit is OK include_once('WAStateRateParser.inc.php'); if($wa_tax_debug_mode) { $wa_tax_address = $wa_tax_debug_address; $wa_tax_city = $wa_tax_debug_city; $wa_tax_zip = $wa_tax_debug_zip; } else { $wa_tax_address = $wa_tax_debug_address; $wa_tax_city = $wa_tax_debug_city; $wa_tax_zip = $wa_tax_debug_zip; } $rate_look = new WAXMLParser($wa_tax_address,$wa_tax_city,$wa_tax_zip); $rate_look->setSimpleXML(); $my_lookup = $rate_look->getParsedData(); $wa_local_tax_rate = floatval($my_lookup['localrate']); $wa_state_tax_rate = floatval($my_lookup['staterate']); $wa_tax_rate = ($wa_local_tax_rate + $wa_state_tax_rate); // check for valid tax rates otherwise go with the highest default rate $wa_tax_error = 0; if ($wa_local_tax_rate < 1 && $wa_local_tax_rate > .01) { } else { $wa_tax_error++; } if ($wa_state_tax_rate < 1 && $wa_state_tax_rate > .06) { } else { $wa_tax_error++; } if ($wa_tax_error > 0 ) { $wa_tax_rate = $override_tax_rate; } // if in debug mode display returned tax rates for the address given if($wa_tax_debug_mode) { echo "WA Tax Rate: <strong>$wa_tax_rate</strong><br>Local Tax Rate: $wa_local_tax_rate<br>State Tax Rate: $wa_state_tax_rate<br><br>"; if ($wa_tax_error > 0 ) { echo "<br>There were errors with the returned tax rates. Default tax rate of $override_tax_rate was used instead.<br>"; } print_r($my_lookup); } ?>
I believe it needs to get inserted somewhere in the file: /includes/modules/order_total/custom/ot_tax.php
I'm sure there are people out there much better at this than I, or perhaps someone has already figured out a better solution to this problem.
Any help is much appreciated!
Last edited by jds580s; 29 Jul 2008 at 05:42 PM. Reason: added a bit more...
It does not seem feasible to do what our state wants us to do. There are too many overlapping areas (counties) with different sales tax rates to ever implement this. I am not even attempting to do this. It looks like Washington is trying to force people to not comply, or stop shipping to their home state.
I agree it's a very complicated request, especially for the smaller shops who don't employ dedicated programmers. That's why I'm focusing on an automated solution that could simply be dropped in place on the server and fix the problem.
Just wish I understood a bit more about how zen-cart worked.
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:c) update the 'geo_zones' table with rows that look likeCode:9100 223 WA ADAMS COUNTYd) update the 'zones_to_geo_zones' table to look likeCode:1 WA Washington Local Sales Tax For: ADAMS COUNTY NULL 0001-01-01 00:00:00(see the 9 again, prefixing the location code 100?)Code: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:and to make it all work:Code:1 100 1 1 9.0000 Local Sales Tax ADAMS COUNTY NULL 2008-10-17 01:29:04
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.
This issue is a huge headache for me too. At this point I would rather just not make in-state sales (they're a very small percentage of my sales). I did take a survey on the DOR website that asked for input from online retailers.
https://fortress.wa.gov/dor/efile/Se...x?surveyid=114
Bookmarks