projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cf7e1d5
)
RT# 83341 - added ability to sort by name in advanced customer reports
author
Christopher Burger
<burgerc@freeside.biz>
Wed, 15 May 2019 15:46:38 +0000
(11:46 -0400)
committer
Christopher Burger
<burgerc@freeside.biz>
Wed, 15 May 2019 15:46:38 +0000
(11:46 -0400)
FS/FS/UI/Web.pm
patch
|
blob
|
history
diff --git
a/FS/FS/UI/Web.pm
b/FS/FS/UI/Web.pm
index
9b1c16f
..
b6dda8f
100644
(file)
--- a/
FS/FS/UI/Web.pm
+++ b/
FS/FS/UI/Web.pm
@@
-414,7
+414,14
@@
sub cust_sort_fields {
cust_header(@_) if( @_ or !@cust_fields );
#inefficientish, but tiny lists and only run once per page
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;
}
}