[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 9a4f4f3eb604881f976546566efc671ffe65fdf2

Ivan ivan at 420.am
Wed Mar 13 14:49:58 PDT 2013


The branch, FREESIDE_2_3_BRANCH has been updated
       via  9a4f4f3eb604881f976546566efc671ffe65fdf2 (commit)
      from  bcdeefe43f138092344200535100f5c035566efc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9a4f4f3eb604881f976546566efc671ffe65fdf2
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Mar 13 14:49:57 2013 -0700

    optimize line item detail "Paid" column inefficiency sometimes causing load issues for big installs, RT#21933

diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi
index c813313..c421711 100644
--- a/httemplate/search/cust_bill_pkg.cgi
+++ b/httemplate/search/cust_bill_pkg.cgi
@@ -677,12 +677,11 @@ if ( $cgi->param('nottax') ) {
 
 
 #total payments
-my $pay_sub = "SELECT SUM(cust_bill_pay_pkg.amount) AS pay_amount,
-    billpkgnum
-  FROM cust_bill_pay_pkg
-  GROUP BY billpkgnum";
-$join_pkg .= " LEFT JOIN ($pay_sub) AS item_pay USING (billpkgnum)";
-push @select, 'item_pay.pay_amount';
+my $pay_sub = "SELECT SUM(cust_bill_pay_pkg.amount)
+                 FROM cust_bill_pay_pkg
+                   WHERE cust_bill_pkg.billpkgnum = cust_bill_pay_pkg.billpkgnum
+              ";
+push @select, "($pay_sub) AS pay_amount";
 
 #total credits
 my $credit_sub = "SELECT SUM(cust_credit_bill_pkg.amount) AS credit_amount,

-----------------------------------------------------------------------

Summary of changes:
 httemplate/search/cust_bill_pkg.cgi |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)




More information about the freeside-commits mailing list