diff options
| author | Christopher Burger <burgerc@freeside.biz> | 2019-04-07 14:46:26 -0400 |
|---|---|---|
| committer | Christopher Burger <burgerc@freeside.biz> | 2019-04-07 14:56:52 -0400 |
| commit | 0ba8ca80bcd731961d433467f209d012e5c201b0 (patch) | |
| tree | 965d9dc8a6ef3d171355313c76e422c9f29c060c | |
| parent | e549e88c134121259da8c57c6f56f398320e0929 (diff) | |
RT# 83075 - fixed sorting by referrals error
| -rw-r--r-- | FS/FS/cust_main/Search.pm | 7 |
1 files changed, 3 insertions, 4 deletions
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', |
