Closed (fixed)
Project:
e-Commerce
Version:
5.x-3.5
Component:
tax
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Mar 2007 at 10:32 UTC
Updated:
17 Nov 2008 at 03:17 UTC
Jump to comment: Most recent
Tax is not showing in order summary
regarding:
// $Id: tax.module,v 1.16.2.4.4.7 2007/02/27 06:53:51 sime Exp $
in the function function tax_checkoutapi()
change this:
foreach ($rules as $rule) {
switch ($rule->realm) {
case 'city':
if (drupal_strtoupper($billing->city) == $rule->realm_value && tax_rule_product_match($txn, $rule)) {
if ($tax = tax_calculate($taxable_amount, $rule->operand, $rule->operator)) {
$total_tax += $tax;
}
}
break;
case 'country':
if (drupal_strtoupper($billing->country) == $rule->realm_value && tax_rule_product_match($txn, $rule)) {
if ($tax = tax_calculate($taxable_amount, $rule->operand, $rule->operator)) {
$total_tax += $tax;
}
}
break;
case 'state':
if ($billing->state) {
if (drupal_strtoupper($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 (removed drupal_strtoupper() 3 times):
foreach ($rules as $rule) {
switch ($rule->realm) {
case 'city':
if ($billing->city == $rule->realm_value && tax_rule_product_match($txn, $rule)) {
if ($tax = tax_calculate($taxable_amount, $rule->operand, $rule->operator)) {
$total_tax += $tax;
}
}
break;
case 'country':
if ($billing->country == $rule->realm_value && tax_rule_product_match($txn, $rule)) {
if ($tax = tax_calculate($taxable_amount, $rule->operand, $rule->operator)) {
$total_tax += $tax;
}
}
break;
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;
}
}
or (added drupal_strtoupper() 3 times):
foreach ($rules as $rule) {
switch ($rule->realm) {
case 'city':
if (drupal_strtoupper($billing->city) == drupal_strtoupper($rule->realm_value) && tax_rule_product_match($txn, $rule)) {
if ($tax = tax_calculate($taxable_amount, $rule->operand, $rule->operator)) {
$total_tax += $tax;
}
}
break;
case 'country':
if (drupal_strtoupper($billing->country) == drupal_strtoupper($rule->realm_value) && tax_rule_product_match($txn, $rule)) {
if ($tax = tax_calculate($taxable_amount, $rule->operand, $rule->operator)) {
$total_tax += $tax;
}
}
break;
case 'state':
if ($billing->state) {
if (drupal_strtoupper($states[$billing->state]) == drupal_strtoupper($rule->realm_value) && tax_rule_product_match($txn, $rule)) {
if ($tax = tax_calculate($taxable_amount, $rule->operand, $rule->operator)) {
$total_tax += $tax;
}
}
}
break;
}
}
Both options work, adding drupal_strtoupper() (suggestion 2) may be saver but generates some extra function calls.
Regards, Jos
Comments
Comment #1
gordon commentedThanks this has now been commited to D5 and 4.7
Comment #2
(not verified) commentedComment #3
biohabit commentedI'm seeing this exact issue with drupal 4.7.6 and ecommerce 3.1. When I'm at /admin/store/settings/checkout I see only the following.
ec_anon
address
flexicharge
payment
shipping
cart
Taxes are not being applied (a sales tax for California).
Comment #4
brmassa commentedguys,
I found the bug:
if (drupal_strtoupper($states[$billing->state]) == $rule->realm_value && tax_rule_product_match($txn, $rule)) {should be:
if (drupal_strtoupper($billing->state) == $rule->realm_value && tax_rule_product_match($txn, $rule)) {i fixed on EC4. this needs porting to EC3.
regards,
massa
Comment #5
biohabit commentedI manually applied this change to my d4.7.6 E3.1 site and it works as expected, Thanks!
Comment #6
brmassa commentedComment #7
yareckon commentedThis one line change also works for us using drupal 5.x and eCom 3.x
Comment #8
(not verified) commentedComment #9
Anonymous (not verified) commentedHi - I am encountering this bug on version 5.3.4 -- applying the patch above.
Comment #10
Anonymous (not verified) commentedJust confirming, Massa's fix above (at line 116 in 5.3.4) is not rolled into the released code. Applying the patch fixed it.
Thank you...
Comment #11
jbomb commentedThis is also relevant for the 3.5 release. I also applied the patch with satisfactory results.
Comment #12
davea commentedApplied to 5.x.3.5 HEAD
Comment #13
davea commentedcomplete