summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2019-05-15 11:46:38 -0400
committerChristopher Burger <burgerc@freeside.biz>2019-05-15 11:48:49 -0400
commit41eec783951d2378d7d6f5f6b6f4c6e3bf50647b (patch)
tree751f2dd7b262da0d76ff319bc655ee16a89b60fc
parent3eac020a3c79c14d218edf3ded10ad6c1ca61ff2 (diff)
RT# 83341 - added ability to sort by name in advanced customer reports
-rw-r--r--FS/FS/UI/Web.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm
index 0bb01566f..cdd7826c1 100644
--- a/FS/FS/UI/Web.pm
+++ b/FS/FS/UI/Web.pm
@@ -410,7 +410,14 @@ sub cust_sort_fields {
cust_header(@_) if( @_ or !@cust_fields );
#inefficientish, but tiny lists and only run once per page
- map { $_ eq 'custnum' ? 'custnum' : '' } @cust_fields;
+ my @sort_fields;
+ foreach (@cust_fields) {
+ if ($_ eq "custnum") { push @sort_fields, 'custnum'; }
+ elsif ($_ eq "contact" || $_ eq "name") { push @sort_fields, '(last, first)'; }
+ elsif ($_ eq "company") { push @sort_fields, 'company'; }
+ else { push @sort_fields, ''; }
+ }
+ return @sort_fields;
}