From: Mark Wells Date: Tue, 24 Feb 2015 23:12:13 +0000 (-0800) Subject: fix SQL syntax, #25718 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=52e5c0e05140ae3b1ae0bfd7486ac33a3af6f55c fix SQL syntax, #25718 --- diff --git a/FS/FS/part_pkg_taxproduct.pm b/FS/FS/part_pkg_taxproduct.pm index c12a432a3..e86d0285a 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';