summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-02-24 15:12:13 -0800
committerMark Wells <mark@freeside.biz>2015-02-24 15:12:13 -0800
commit52e5c0e05140ae3b1ae0bfd7486ac33a3af6f55c (patch)
tree263d8cb4b98ea9da90b3025cfbcf4003ef24f512
parentef7a02376e94a07b6488956c467ae2e2face8b99 (diff)
fix SQL syntax, #25718
-rw-r--r--FS/FS/part_pkg_taxproduct.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/FS/FS/part_pkg_taxproduct.pm b/FS/FS/part_pkg_taxproduct.pm
index c12a432..e86d028 100644
--- a/FS/FS/part_pkg_taxproduct.pm
+++ b/FS/FS/part_pkg_taxproduct.pm
@@ -153,7 +153,11 @@ sub part_pkg_taxrate {
map { $_->taxproductnum }
$self->expand_cch_taxproduct
);
- $extra_sql .= "AND taxproductnum IN($tpnums)";
+
+ # if there are no taxproductnums, there are no matching tax classes
+ return if length($tpnums) == 0;
+
+ $extra_sql .= " AND taxproductnum IN($tpnums)";
my $addl_from = 'LEFT JOIN part_pkg_taxproduct USING ( taxproductnum )';
my $order_by = 'ORDER BY taxclassnum, length(geocode) desc, length(taxproduct) desc';