[freeside-commits] branch master updated. 66c62dfc4734fa278e7e28c5fda5c4061778dc14
Ivan
ivan at 420.am
Sat Aug 9 17:32:20 PDT 2014
The branch, master has been updated
via 66c62dfc4734fa278e7e28c5fda5c4061778dc14 (commit)
via 16f7115e52ec02d1b1e3e59d8b5ba54126f1a506 (commit)
from 3d88896c03e09483714c84a06106233081800f70 (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 66c62dfc4734fa278e7e28c5fda5c4061778dc14
Author: Ivan Kohler <ivan at freeside.biz>
Date: Sat Aug 9 17:32:19 2014 -0700
optimize package view with tons of packages, RT#28526
diff --git a/httemplate/view/cust_main/packages/location.html b/httemplate/view/cust_main/packages/location.html
index 871bfcb..c5ef10e 100644
--- a/httemplate/view/cust_main/packages/location.html
+++ b/httemplate/view/cust_main/packages/location.html
@@ -74,7 +74,7 @@ my $countrydefault = $opt{'countrydefault'} || 'US';
my $statedefault = $opt{'statedefault'}
|| ($countrydefault eq 'US' ? 'CA' : '');
-my $loc = $cust_pkg->cust_location_or_main;
+my $loc = $cust_pkg->cust_location_or_main('_cache'=>$opt{cust_location_cache});
# dubious--they should all have a location now
my $default = $cust_pkg->locationnum == $opt{'cust_main'}->ship_locationnum;
commit 16f7115e52ec02d1b1e3e59d8b5ba54126f1a506
Author: Ivan Kohler <ivan at freeside.biz>
Date: Sat Aug 9 17:29:30 2014 -0700
optimize freeside-cdrd pending query, RT#29752
diff --git a/FS/bin/freeside-cdrd b/FS/bin/freeside-cdrd
index b21bd5b..45d5878 100644
--- a/FS/bin/freeside-cdrd
+++ b/FS/bin/freeside-cdrd
@@ -39,24 +39,27 @@ my $extra_sql =
" AND optionvalue = '1' ".
" AND ( susp IS NULL OR susp = 0)".
" AND ( cancel IS NULL OR cancel = 0)".
- " AND 0 < (
- SELECT COUNT(*) FROM svc_phone LEFT JOIN cust_svc USING (svcnum)
+ " AND EXISTS (
+ SELECT 1 FROM svc_phone LEFT JOIN cust_svc USING (svcnum)
WHERE cust_pkg.pkgnum = cust_svc.pkgnum
- AND 0 < ( SELECT COUNT(*) FROM cdr
- WHERE ( freesidestatus IS NULL OR freesidestatus = '' )
- AND ( charged_party = svc_phone.phonenum
- OR charged_party = svc_phone.countrycode
- || svc_phone.phonenum
- OR src = svc_phone.phonenum
- OR src = svc_phone.countrycode
- || svc_phone.phonenum
- )
- )
+ AND EXISTS ( SELECT 1 FROM cdr
+ WHERE ( freesidestatus IS NULL OR freesidestatus = '' )
+ AND ( charged_party = svc_phone.phonenum
+ OR charged_party = svc_phone.countrycode
+ || svc_phone.phonenum
+ OR src = svc_phone.phonenum
+ OR src = svc_phone.countrycode
+ || svc_phone.phonenum
+ )
+ LIMIT 1
+ )
+ LIMIT 1
)
- AND 0 = (
- SELECT COUNT(*) FROM queue
+ AND NOT EXISTS (
+ SELECT 1 FROM queue
WHERE queue.job = 'FS::cust_main::queued_bill'
AND queue.custnum = cust_pkg.custnum
+ LIMIT 1
)
";
-----------------------------------------------------------------------
Summary of changes:
FS/bin/freeside-cdrd | 31 ++++++++++++----------
httemplate/view/cust_main/packages/location.html | 2 +-
2 files changed, 18 insertions(+), 15 deletions(-)
More information about the freeside-commits
mailing list