I think I'm having the same problem as this: http://drupal.org/node/67099, but I updated with the new module file from the CVS repository and it still isn't working.

It does seem to work if i make a tax for a country, just not a state. I need to add 8.5% for Colorado (CO). I checked the database and the state in ec_address is entered as CO, and the same for realm_value in ec_tax.

Did I get the right file? First I tried the one from the CVS repository, the date at the top of the module is 2006/06/08. I also tried downloading the latest e-commerce release package and used the tax module from there. Neither worked.

any ideas?

CommentFileSizeAuthor
#2 tax_billing_state.patch.txt1.34 KBneclimdul

Comments

alynner’s picture

I figured out that it is not reading the address array/variable correctly in the case statement. To fix, change this code (starting on line 78):

          case 'state':
            if ($billing->state) {
              if ($states[$billing->state] == $rule->realm_value && tax_rule_product_match($txn, $rule)) {
                if ($tax = tax_calculate($taxable_amount, $rule->operand, $rule->operator)) {
                  $total_tax += $tax;
                }
              }
            }
            break;

to this:

          case 'state':
			if ($billing->state == $rule->realm_value && tax_rule_product_match($txn, $rule)) {
                if ($tax = tax_calculate($taxable_amount, $rule->operand, $rule->operator)) {
                  $total_tax += $tax;
                }
            }
            break;
neclimdul’s picture

StatusFileSize
new1.34 KB

I don't use the tax module and am not sure of how to test it. However, if you could test the attached patch to see if it works for you that would be great.

Comparing CVS and 4.7 this patch should probably apply without too much fuss to CVS as well.

allie micka’s picture

Priority: Normal » Critical
Status: Active » Reviewed & tested by the community

I'm marking this as critical because state taxes don't work at all, and I'm marking it RTBC because #1 (and possibly #2) does the trick.

mzabala’s picture

This patch worked for me. Thank you!

solanas’s picture

It works for me in tax.module,v 1.16.2.4 2006/10/02. Maybe somebody should committ.

Thanks.

philrw@www.neovisic.com’s picture

I'm having the same problem. I'm trying to get a tax rate of 7.60% going in CO but it doesn't come through. Strangely enough a flat amount of +7.60 (or any other flat amount) works just fine. Should using ecivicrm for the address book make any difference?

neclimdul’s picture

Status: Reviewed & tested by the community » Fixed

Committed in #47363 and #47364

philrw@www.neovisic.com’s picture

Okay, nevermind. It works, just not on the products I want it to work on. I can't seem to add a percentage-based tax for file downloads. My state taxes them and I need the ability to charge sales tax on file downloads.

dct66’s picture

I had the same problem. Adding a dollar amount worked for file downloads but a percentage amount doesn't. I fixed it by commenting out the test for a shippable product in tax.module as follows

      foreach ($txn->items as $item) {
/**        if (product_is_shippable($item->vid)) { */
          $taxable_amount += store_adjust_misc($txn, $item) * $item->qty;
/**        } */
      }

I don't understand it, but it works for me.

Anonymous’s picture

Status: Fixed » Closed (fixed)