We have a customer that we built an Drupal + Ubercart site for. They have what I beleive will be a completely unique request when it comes to taxes. They said that they need to be able to apply taxes to all the zip codes in the U.S. because they have people in every state.
We found out that there are little over 40,000 zipcodes total. I set about to enter all the tax rates in through the back end with a few queries and a csv file. Just having that many records in the uc_taxes table alone made the drupal installation take up more then 128megs as php halted the script and said that it hit the limit. I upped the limit and got it working, but that would not happen in a production environment.
Needless to say, that method of having 40k+ entries in uc_taxes will not work as it completely choked workflow-ng even when I changed the time limit for php to 300 seconds.
What I did find was that workflow-ng can execute custom php for both the condition and the action, so I turn to the community. While I know I can create the condition code, have it check a custom table or even hit a different db server to find the tax rate, what I am having a hard time with is how to make the code for the action it would take if the condition returns true.
Considering that a few states have decided to make it harder to determine what taxes should be applied, what with the deciding factor being if you use shipper's address or buyer's address to determine taxes, I'd like to open up discussion on how what kind of code needs to be made to make add a tax item based on customer workflow-ng snippet. I figure that if we collectively come up with how to make the action work, we can all point to it and say, "if you have a convoluted tax mess you need to make happen" then point them to the custom workflow-ng snippets, or find a php developer that can create a custom snippit to be used in workflow-ng.
While this method would include the overhead of creating a custom table, or have custom algorithms, it would at least be answered.
So can anyone tell me how I can get a workflow-ng action to apply a custom tax?
Granville


