diff --git a/lib/WebGUI/Shop/Tax.pm b/lib/WebGUI/Shop/Tax.pm index dda7ef7f0..5bbe69528 100644 --- a/lib/WebGUI/Shop/Tax.pm +++ b/lib/WebGUI/Shop/Tax.pm @@ -222,20 +222,12 @@ sub getTaxRates { my $code = $address->get('code'); my $result = $self->session->db->buildArrayRef( q{ - select taxRate from tax where - (country=? and state='' and city='' and code='') - OR (country=? and state=? and city='' and code='') - OR (country=? and state=? and city=? and code='') - OR (country=? and state=? and city='' and code=? ) - OR (country=? and state=? and city=? and code=? ) + select taxRate from tax where country=? + and (state='' or state=?) + and (city='' or city=?) + and (code='' or code=?) }, - [ - $country, - $country, $state, - $country, $state, $city, - $country, $state, $code, - $country, $state, $city, $code, - ]); + [ $country, $state, $city, $code, ]); return $result; } diff --git a/t/Shop/Tax.t b/t/Shop/Tax.t index ee34afc4b..1e4567186 100644 --- a/t/Shop/Tax.t +++ b/t/Shop/Tax.t @@ -439,7 +439,7 @@ cmp_deeply( cmp_deeply( $taxer->getTaxRates($taxFreeAddress), - [0.0], + [0,0], 'getTaxRates: return correct data for a state with no tax data' );