[freeside-commits] branch master updated. 53ac9ee9aff3755c4206f800a5d5a4dd8fc4242b

Ivan ivan at 420.am
Thu May 1 13:52:05 PDT 2014


The branch, master has been updated
       via  53ac9ee9aff3755c4206f800a5d5a4dd8fc4242b (commit)
      from  719e8f45844d5ebc81f14c25258b4c0b0448910e (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 53ac9ee9aff3755c4206f800a5d5a4dd8fc4242b
Author: Jason Terry <jterry at jterry-mac.local>
Date:   Thu May 1 14:41:02 2014 -0600

    Performance improvement on count location data.

diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index ae43b60..94d7f36 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -1617,6 +1617,8 @@ sub tables_hashref {
                           [ 'referral_custnum' ],
                           [ 'payby' ], [ 'paydate' ],
                           [ 'archived' ],
+                          [ 'ship_locationnum' ],
+                          [ 'bill_locationnum' ],
                         ],
       'foreign_keys' => [
                           { columns    => [ 'agentnum' ],
diff --git a/FS/FS/cust_location.pm b/FS/FS/cust_location.pm
index 70ccbfd..309ab06 100644
--- a/FS/FS/cust_location.pm
+++ b/FS/FS/cust_location.pm
@@ -438,8 +438,8 @@ sub disable_if_unused {
 
   my $self = shift;
   my $locationnum = $self->locationnum;
-  return '' if FS::cust_main->count('bill_locationnum = '.$locationnum)
-            or FS::cust_main->count('ship_locationnum = '.$locationnum)
+  return '' if FS::cust_main->count('bill_locationnum = '.$locationnum.' OR
+                                     ship_locationnum = '.$locationnum)
             or FS::contact->count(      'locationnum  = '.$locationnum)
             or FS::cust_pkg->count('cancel IS NULL AND 
                                          locationnum  = '.$locationnum)

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

Summary of changes:
 FS/FS/Schema.pm        |    2 ++
 FS/FS/cust_location.pm |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list