diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-12-17 13:44:39 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-12-17 13:44:39 -0800 |
commit | 65acf1fd9746f1dd98e061044657c185367f7903 (patch) | |
tree | ef89c1e5f4bf641f3302c1517c99284918a8cb12 /httemplate/search/cust_bill_pkg.cgi | |
parent | 74b63c87c33cdd97f7b9239e626d34bded497e20 (diff) |
add line item report, RT#18676
Diffstat (limited to 'httemplate/search/cust_bill_pkg.cgi')
-rw-r--r-- | httemplate/search/cust_bill_pkg.cgi | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index ed3444027..0c5fbd211 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -205,27 +205,27 @@ if ( $cgi->param('custnum') =~ /^(\d+)$/ ) { push @where, "cust_main.custnum = $1"; } +# then we want the package and its definition +$join_pkg = +' LEFT JOIN cust_pkg USING (pkgnum) + LEFT JOIN part_pkg USING (pkgpart)'; + +my $part_pkg = 'part_pkg'; +if ( $cgi->param('use_override') ) { + # still need the real part_pkg for tax applicability, + # so alias this one + $join_pkg .= " LEFT JOIN part_pkg AS override ON ( + COALESCE(cust_bill_pkg.pkgpart_override, cust_pkg.pkgpart, 0) = part_pkg.pkgpart + )"; + $part_pkg = 'override'; +} +push @select, 'part_pkg.pkg'; # or should this use override? + # the non-tax case if ( $cgi->param('nottax') ) { push @where, 'cust_bill_pkg.pkgnum > 0'; - # then we want the package and its definition - $join_pkg = -' LEFT JOIN cust_pkg USING (pkgnum) - LEFT JOIN part_pkg USING (pkgpart)'; - - my $part_pkg = 'part_pkg'; - if ( $cgi->param('use_override') ) { - # still need the real part_pkg for tax applicability, - # so alias this one - $join_pkg .= " LEFT JOIN part_pkg AS override ON ( - COALESCE(cust_bill_pkg.pkgpart_override, cust_pkg.pkgpart, 0) = part_pkg.pkgpart - )"; - $part_pkg = 'override'; - } - push @select, 'part_pkg.pkg'; # or should this use override? - my @tax_where; # will go into a subquery my @exempt_where; # will also go into a subquery |