[freeside-commits] branch FREESIDE_3_BRANCH updated. 0ba8ca80bcd731961d433467f209d012e5c201b0

Christopher Burger burgerc at freeside.biz
Sun Apr 7 12:14:31 PDT 2019


The branch, FREESIDE_3_BRANCH has been updated
       via  0ba8ca80bcd731961d433467f209d012e5c201b0 (commit)
      from  e549e88c134121259da8c57c6f56f398320e0929 (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 0ba8ca80bcd731961d433467f209d012e5c201b0
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 091be9956..7ee6a9302 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -619,7 +619,7 @@ sub search {
   my $dbh = dbh;
 
   my @where = ();
-  my $orderby = "ORDER BY cust_main.custnum";
+  my $orderby;
 
   # initialize these to prevent warnings
   $params = {
@@ -909,7 +909,7 @@ sub search {
       }
     }
 
-    $orderby .= ", cust_main.$field";
+    $orderby ||= "ORDER BY cust_main.$field";
 
   }
 
@@ -1218,8 +1218,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