summaryrefslogtreecommitdiff
path: root/FS/FS/cust_main
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2019-04-07 14:46:26 -0400
committerChristopher Burger <burgerc@freeside.biz>2019-04-08 08:49:18 -0400
commit3ae83bb3b66c88513278d48faf02cedadaa5c518 (patch)
tree44e6af0e4ae16aef3c44aa043dd7093d9c2b2fa7 /FS/FS/cust_main
parent64730bda4ec6abbe4b5ca153150571ed80e49857 (diff)
RT# 83075 - fixed sorting by referrals error
Diffstat (limited to 'FS/FS/cust_main')
-rw-r--r--FS/FS/cust_main/Search.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 7216fe6..ae219c8 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',