summaryrefslogtreecommitdiff
path: root/FS/FS/UI
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 13:11:57 -0400
commit52312ae99dc66d0afb1aa4465a4f4b36f054a2eb (patch)
tree361d5d34f9da11ac3d4de4cb32d14f7405ba0585 /FS/FS/UI
parenteff39148d63816b4a470ae43541664e4a7422bd6 (diff)
RT# 83341 - added ability to sort by name in advanced customer reports
Diffstat (limited to 'FS/FS/UI')
-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 2580474..158a855 100644
--- a/FS/FS/UI/Web.pm
+++ b/FS/FS/UI/Web.pm
@@ -411,7 +411,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;
}