[freeside-commits] branch FREESIDE_4_BRANCH updated. 3ae83bb3b66c88513278d48faf02cedadaa5c518

Christopher Burger burgerc at freeside.biz
Mon Apr 8 06:07:26 PDT 2019


The branch, FREESIDE_4_BRANCH has been updated
       via  3ae83bb3b66c88513278d48faf02cedadaa5c518 (commit)
      from  64730bda4ec6abbe4b5ca153150571ed80e49857 (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 3ae83bb3b66c88513278d48faf02cedadaa5c518
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Sun Apr 7 14:46:26 2019 -0400

    RT# 83075 - fixed sorting by referrals error

diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 7216fe604..ae219c801 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -618,7 +618,7 @@ sub search {
   my $dbh = dbh;
 
   my @where = ();
-  my $orderby = "ORDER BY cust_main.custnum";
+  my $orderby;
 
   # initialize these to prevent warnings
   $params = {
@@ -937,7 +937,7 @@ sub search {
       }
     }
 
-    $orderby .= ", cust_main.$field";
+    $orderby ||= "ORDER BY cust_main.$field";
 
   }
 
@@ -1213,8 +1213,7 @@ sub search {
 
   }
 
-  # set select a customer only once. some joins create multiple customer records.
-  my $select = 'DISTINCT ON (cust_main.custnum) ' . join(', ', @select);
+  my $select = join(', ', @select);
 
   my $sql_query = {
     'table'             => 'cust_main',

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

Summary of changes:
 FS/FS/cust_main/Search.pm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list