diff options
author | ivan <ivan> | 2011-04-02 19:23:07 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-04-02 19:23:07 +0000 |
commit | e0c8fd57f370ed0de3d58fc61cc451b492adc773 (patch) | |
tree | 1690b4767f208f931a4018d64dee1e9e549c522e /httemplate | |
parent | b65b8096089410001dfbcd35f9a56f9405b9f5f1 (diff) |
fix line item report when linked from CCH tax report credits, RT#12329
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/search/cust_bill_pkg.cgi | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index a87e44651..0db4b35da 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -475,13 +475,12 @@ if ( $cgi->param('pkg_tax') ) { $count_query .= "SUM(usage)"; } elsif ( $unearned ) { $count_query .= "SUM(cust_bill_pkg.recur)"; + } elsif ( scalar( grep( /locationtaxid/, $cgi->param ) ) ) { + $count_query .= "SUM( COALESCE(cust_bill_pkg_tax_location.amount, cust_bill_pkg.setup + cust_bill_pkg.recur))"; + } elsif ( $cgi->param('iscredit') eq 'rate') { + $count_query .= "SUM( cust_credit_bill_pkg.amount )"; } else { - if ( scalar( grep( /locationtaxid/, $cgi->param ) ) || - $cgi->param('iscredit') eq 'rate') { - $count_query .= "SUM( COALESCE(amount, cust_bill_pkg.setup + cust_bill_pkg.recur))"; - } else { - $count_query .= "SUM(cust_bill_pkg.setup + cust_bill_pkg.recur)"; - } + $count_query .= "SUM(cust_bill_pkg.setup + cust_bill_pkg.recur)"; } if ( $unearned ) { |