summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorjeff <jeff>2009-02-03 21:33:12 +0000
committerjeff <jeff>2009-02-03 21:33:12 +0000
commitd51b66e2ba1ea7378096bbe28037f7eb459d6011 (patch)
treed8b0b4d037155c94fcc7685c0b17aaf645a3e9d5 /FS
parent0bab56e6204a7e443921730ffcd05517c07cce28 (diff)
the taxproductnum is ALWAYS one of the filtering conditions
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_pkg.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 563a5cfc5..e53d7b821 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -1015,10 +1015,13 @@ sub part_pkg_taxrate {
')';
# much more CCH oddness in m2m -- this is kludgy
my @tpnums = $self->_expand_cch_taxproductnum($class);
- $extra_sql .= ' AND ('.
- join(' OR ', map{ "taxproductnum = $_" } @tpnums ).
- ')'
- if @tpnums;
+ if (scalar(@tpnums)) {
+ $extra_sql .= ' AND ('.
+ join(' OR ', map{ "taxproductnum = $_" } @tpnums ).
+ ')';
+ } else {
+ $extra_sql .= ' AND ( 0 = 1 )';
+ }
my $addl_from = 'LEFT JOIN part_pkg_taxproduct USING ( taxproductnum )';
my $order_by = 'ORDER BY taxclassnum, length(geocode) desc, length(taxproduct) desc';