Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

WA state destination based sales tax


kidsngarden

Recommended Posts

I have no idea if it goes to the next closest or not via the api it returns an address a code and tax rate. You are manually calculating the taxes via a form or something. This contrib accesses the database and returns some info I have no control over what info is returned. The xml version returns alot more info but none of it seems relevant. I do like the idea of a confirmation number though, however via the api it is not provided. I will suggest it to the DOR. here are the specs for the API

 

The address I posted earlier will show you what info is returned for use.

 

lildog

 

 

........it seems to be more reliable ...the page I linked to is

by address look up...but you have Lat/Lon look up also, which would not be very useful in making a mod...too difficult.

But I think with just some small modification to your existing mod, it will work. I don't know, your the expert here!

 

Thanks PS.... I typed in my address, rural address it did not find mine but it went to my neighbors, but I then had to click

on that address to get the tax code...so you might want to also look at it as what to do if it can't find that exact address, but finds the next closest thing, maybe find a way to have it then click to get that info? so it always returns a tax code?

Input your address, then one that is like next door to you but non-existent house number...see what it does.....

Link to comment
Share on other sites

  • Replies 274
  • Created
  • Last Reply
The server this contrib uses is up....go here to check.

Ok...well I have something else going on.

I am beginning to maybe think that it is the SSL on my site. Anyone using this on a secure server?

I am thinking that when I am in the check out area, where it calculates the tax...since it has to access

a off site server for the tax info, the 128 encryption is causing a problem? I don't know whats wrong with mine now.

 

any suggestion lildog?

Link to comment
Share on other sites

I am using it on a secure server.....how modified is your site? Do you have a test server? I will write a quick test for you to try.

 

lildog

 

 

 

Ok...well I have something else going on.

I am beginning to maybe think that it is the SSL on my site. Anyone using this on a secure server?

I am thinking that when I am in the check out area, where it calculates the tax...since it has to access

a off site server for the tax info, the 128 encryption is causing a problem? I don't know whats wrong with mine now.

 

any suggestion lildog?

Link to comment
Share on other sites

I made a mistake...I must have restored it back to a wrong date, when I was installing the separate pricing mod.

I found the right one to restore it back again, and it is working...shheeeezzzzz.... I need a bottle of Tylenol....

or somebody just run over me with a Mac Truck......

Any one want to help me pull my hair out?

 

Thanks again....

 

Note to self: " Do Not Touch The Mod,, Do Not Touch The Mod,, Do Not Touch The Mod...."

:wacko:

Link to comment
Share on other sites

It happens to everyone. Now it should at very least use your stores tax and send you an email telling you what is wrong and a link to the manual form on the web. Although to edit it you need to have order editor installed, which I do, but may not let you edit the taxes. I have not yet made the two compatible yet, I don't think. When someone runs across the problem I will work it out, after I fix pay_pal and ccgv-

 

WARNING WARNING DON'T install ccgv until you are really pretty good at php it works well on a fresh install but DOES NOT play well with anything else. I have been fighting it for 2 years now. And it is so embedded in the code it is easier to debug than uninstall..........

 

So we good for now here? If someone has any ideas about the server being down let me know.

 

lildog

Link to comment
Share on other sites

There are multiple versions of PWA available, the newer version 1.25 to the current and .90 or something. The install instructions for wa tax should make small mention of it.

 

the earlier versions use a slightly different pwa_shipping or pwa_label_shipping variables......

 

lilodg

 

Yeah, my system uses pwa_array_shipping, but that could be something I wrote myself. I have a shortened checkout system that is mostly custom code at this point so installing contributions can get fun. Everything is fixable though!

 

And, as I said, this contribution works great for me. I only had to change a couple things.

 

Gretchen

Link to comment
Share on other sites

  • 3 weeks later...

I am looking for a way to calculate the tax AFTER the shipping has been added. Right now, it appears that it's only taxing the sub total. I currently am using 2.1.1 (I believe), and want to know if going through the trouble of upgrading everything will fix this problem.

 

If not, can someone possibly give me the gist of how to do this? I'm proficient in PHP, but for the life of me cannot figure out how to fix this.

Link to comment
Share on other sites

I am looking for a way to calculate the tax AFTER the shipping has been added. Right now, it appears that it's only taxing the sub total. I currently am using 2.1.1 (I believe), and want to know if going through the trouble of upgrading everything will fix this problem.

 

If not, can someone possibly give me the gist of how to do this? I'm proficient in PHP, but for the life of me cannot figure out how to fix this.

 

it's all about the "ORDER TOTAL" module sort order: just be sure your shipping module has a sort order value lower than your tax module. that's it

Link to comment
Share on other sites

Thanks, but that didn't seem to do the trick. My order total modules are sorted as such:

 

Sub-Total 1

Shipping 2

Tax 3

Total 999

 

When I run a test, this is what I get:

 

Sub-Total: $8.99

Flat Rate (Best Way): $7.99

WA Tax Rate: $0.68 (the rate for this location is .076)

Total: $17.66

 

So, in summary, this is what I need:

8.99 + 7.99 = $16.98

16.98 * .076 = $1.29

Total = $18.27.

 

As you can see, the $0.68 is still coming from: tax rate * sub-total

It needs to be (sub-total + shipping) * tax rate

 

Any suggestions?

Link to comment
Share on other sites

Thanks, but that didn't seem to do the trick. My order total modules are sorted as such:

 

Sub-Total 1

Shipping 2

Tax 3

Total 999

 

When I run a test, this is what I get:

 

Sub-Total: $8.99

Flat Rate (Best Way): $7.99

WA Tax Rate: $0.68 (the rate for this location is .076)

Total: $17.66

 

So, in summary, this is what I need:

8.99 + 7.99 = $16.98

16.98 * .076 = $1.29

Total = $18.27.

 

As you can see, the $0.68 is still coming from: tax rate * sub-total

It needs to be (sub-total + shipping) * tax rate

 

Any suggestions?

 

Charles,

 

Have you set the Tax Class of your shipping module to taxable?

Link to comment
Share on other sites

Lildog,

 

I believe I have figured out how to modify OSC to tax shipping when the cart contains taxable items. So far it's working in my system but I have a highly modified installation. So I don't know if it will work elsewhere. This was actually a requirement long before the destination tax issue as my client's store sells both taxable and non-taxable goods. But the destination tax allowed me to look at this as well.

 

Would you be interested in incorporating it into your destination tax contribution?

 

Doug

Link to comment
Share on other sites

Yes I would be interested. I am building an rc2a shop and now have the sam problem as you. The order is not making the tax tax shipping.... let me know what you have worked out and we can integrate it into the contrib.

 

Anyone paying attention here: What versions of oscommerce are you using?

 

lildog

Link to comment
Share on other sites

I just went and changed the text in my WA tax rate in admin and changed the sort order of the shipping, then changed it back and it is now loading in the correct order. Also make sure your shipping module is set to taxable goods. Doug, I don't know what happened but this does work, still give me your discovery and maybe the answer is there. I now cannot replicate the problem so I cannot tarack it down, something did happen though.

 

lildog

Link to comment
Share on other sites

Ok, below is what worked for our install. The change was surprisingly small although it took me forever to find. And admittedly the coding is not exactly elegant. But I really hope it can work for others.

 

Files modified

catalog/includes/modules/order_total/ot_shipping.php

catalog/includes/modules/shipping/<your shipping module>.php

 

SETUP/ENVIRONMENT CONSIDERATIONS

 

* While I this was done in OSC 2.2, it was a highly modified version so it is unclear as to whether or not this will work in a default installation. We're using a customized order page and credit cards are charged through the admin.

 

* In the OSC admin, set the shipping modules tax classes to "none".

 

* Set your products' tax classes accordingly (e.g. taxable for those that should be taxed).

 

* Order Total modules set in the following order: Sub-Total, Shipping, Tax and Total.

 

* Set your tax zones and rate as described in the WA State Destination Tax contribution.

 

STEP 1:
catalog/includes/modules/order_total/ot_shipping.php

find (around line 68)

     if (tep_not_null($order->info['shipping_method'])) {
        if ($GLOBALS[$module]->tax_class > 0) {
           $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
           $shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);


replace with 

     if (tep_not_null($order->info['shipping_method'])) {
        $ship_tax_class = $GLOBALS[$module]->tax_class;
        for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
           if (($order->products[$i]['tax'] > 0) && ($order->delivery['state'] = 'Washington')) {
              $ship_tax_class = 1;
              $i = $n;
           }
        }
        if ($ship_tax_class > 0){
           $shipping_tax = tep_get_tax_rate($ship_tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
           $shipping_tax_description = tep_get_tax_description($ship_tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

*---------------------------------------------------------------------------------------------
STEP 2: MODIFY YOUR SHIPPING MODULE

You'll need to modify the code for each shipping module you have in use.  Below is my modification for USPS.  This exact code worked for UPS as well.

catalog/includes/modules/shipping/usps.php

around line 21, find

     $this->code = 'usps';
     $this->title = MODULE_SHIPPING_USPS_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_USPS_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_USPS_SORT_ORDER;
     $this->icon = DIR_WS_ICONS . 'shipping_usps.gif';
     $this->tax_class = MODULE_SHIPPING_USPS_TAX_CLASS;
     $this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);

just below it, add the following: 

     for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
        if (($order->products[$i]['tax'] > 0) && ($order->delivery['state'] = 'Washington')) {
           $this->tax_class = 1;
           $i = $n;
        }
     }

Link to comment
Share on other sites

I just went and changed the text in my WA tax rate in admin and changed the sort order of the shipping, then changed it back and it is now loading in the correct order. Also make sure your shipping module is set to taxable goods. Doug, I don't know what happened but this does work, still give me your discovery and maybe the answer is there. I now cannot replicate the problem so I cannot tarack it down, something did happen though.

 

lildog

 

In our setup, when I set shipping to Taxable Goods, it would also tax shipping on orders that only contained non-taxable items.

Link to comment
Share on other sites

Hello:

 

 

how do you run this add-on for dev. purposes using a localized server environment. (localhost)? I made all the edits to my files and if a WA test account is logged in the page loads part of the page then gives the following error:

 

 

fatal error: call to undefined function curl_init() in wa_taxes.php on line 39.

 

(I'm not a php coder so any help is appreciated)

 

 

thanks,

Thomas

Link to comment
Share on other sites

your cURL function is off. This is a part of your php server, not osc. You can probably turn it on in your php.ini. That's all the info I can give you though, mine was on by default. Look up cURL at google probably.

 

lildog

 

Hello:

 

 

how do you run this add-on for dev. purposes using a localized server environment. (localhost)? I made all the edits to my files and if a WA test account is logged in the page loads part of the page then gives the following error:

 

 

fatal error: call to undefined function curl_init() in wa_taxes.php on line 39.

 

(I'm not a php coder so any help is appreciated)

 

 

thanks,

Thomas

Link to comment
Share on other sites

Help!

 

i am getting this error on the admin side when I click on the Wa Taxes in Reports now that it's live on a GoDaddy Linux server.

 

Parse error: parse error, unexpected '}' in /home/content/..../admin/includes/functions/wa_taxes_report.php on line 32

 

thanks

Link to comment
Share on other sites

  • 2 weeks later...

Let me first disclose that I am working on a solution for a client that is not using osC and I am very new to PHP but this being the most developed public solution I though I might ask a question here.

 

First I noticed that having the "if ($class_id != 0){" statement outside of the "if (tep_get_zone_code($customer_country_id, $customer_zone_id, "") == "WA") {" statement causes an error in the amount of tax calculated if both taxed and non-taxed products are in the shopping cart. I assume that this will also be the case for osC. Placing the "if ($class_id != 0){" statement inside of the "if (tep_get_zone_code($customer_country_id, $customer_zone_id, "") == "WA") {" statement seems to fix this. I guess they could also be combined into an "and" statement but I haven't tested this.

 

My question is regarding cURL, the script I am working on grabs the XML array using "simplexml_load_string" and it is working without a cURL session being opened. If I don't need any return codes is there a reason that I need to open a cURL session?

 

Thanks,

Jim

Link to comment
Share on other sites

  • 2 weeks later...
I noticed that having the "if ($class_id != 0){" statement outside of the "if (tep_get_zone_code($customer_country_id, $customer_zone_id, "") == "WA") {" statement causes an error in the amount of tax calculated if both taxed and non-taxed products are in the shopping cart. I assume that this will also be the case for osC. Placing the "if ($class_id != 0){" statement inside of the "if (tep_get_zone_code($customer_country_id, $customer_zone_id, "") == "WA") {" statement seems to fix this.

This does *not* apply to osCommerce, sorry about making a useless post to this thread.

 

If a moderator sees this could you delete both my previous post as well as this one?

 

Thanks,

Jim

Link to comment
Share on other sites

  • 3 weeks later...

I am having a bit of extending the tax reporting tool to display both taxable & tax rate data in the report for each order as well as the zone totals.

 

I have been able to get the single order portion to work by running separate a query for the order total inside the loop, and then deducting the tax amount. from their I divide the taxable amount by the tax collected to find the rate I charged. All this seems to work fine but I seem to be stuck when trying to add the taxable totals together for zone totals.

 

It looks as though to get the zone array to build with the extra column(order total) the order tax query needs to be rolled into the tax query performed but I'm not sure how to accomplish this, any help work be appreciated.

 

Right now to get the single order portion I have added the following code:

<?php $wa_total_query = tep_db_query("SELECT value FROM orders_total WHERE orders_id = $wa_oid AND sort_order = 99");
			  $wa_total = tep_db_fetch_array($wa_total_query);
			  $wa_taxable = $wa_total['value'] - $wa_orders['tax_total'];
			  $wa_taxrate = ($wa_orders['tax_total'] / $wa_taxable) *100;

 

Mark

Link to comment
Share on other sites

  • 1 month later...

I am wondering if verison WA_Dest_tax_v2.2f is ready for production use? I am going to launch my webiste-I am ok at following the directions on the contributions but not great. I would not probably be very helpful when it comes to testing because I don't know too much about coding. Please let me know if this is ready so I can try it on my site. Like I said, I'm new at this and I'm learning as I go. Please help me out-This is about the last step to my website. Thank you so much to everyone who worked on this!

 

Stacy

Link to comment
Share on other sites

  • 2 weeks later...

I am wondering the same thing. I have not put this in place on my site yet because last I read it said it was not ready for a production site. I am anxious to get this in place, granted I just found out about it a few days ago.

 

Thanks,

Dennis

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...