projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
fcc3ddb
)
customer classification, RT#6376
author
ivan
<ivan>
Thu, 29 Oct 2009 19:08:13 +0000
(19:08 +0000)
committer
ivan
<ivan>
Thu, 29 Oct 2009 19:08:13 +0000
(19:08 +0000)
FS/FS/cust_main.pm
patch
|
blob
|
history
httemplate/elements/select-table.html
patch
|
blob
|
history
httemplate/search/cust_main.html
patch
|
blob
|
history
httemplate/search/report_cust_main.html
patch
|
blob
|
history
diff --git
a/FS/FS/cust_main.pm
b/FS/FS/cust_main.pm
index
fdcd801
..
e192ef9
100644
(file)
--- a/
FS/FS/cust_main.pm
+++ b/
FS/FS/cust_main.pm
@@
-8328,6
+8328,21
@@
sub search_sql {
}
###
}
###
+ # classnum
+ ###
+
+ my @classnum = grep /^(\d*)$/, @{ $params->{'classnum'} };
+ if ( @classnum ) {
+ push @where, '( '. join(' OR ', map {
+ $_ ? "cust_main.classnum = $_"
+ : "cust_main.classnum IS NULL"
+ }
+ @classnum
+ ).
+ ' )';
+ }
+
+ ###
# payby
###
# payby
###
diff --git
a/httemplate/elements/select-table.html
b/httemplate/elements/select-table.html
index
10a8b27
..
45585a8
100644
(file)
--- a/
httemplate/elements/select-table.html
+++ b/
httemplate/elements/select-table.html
@@
-86,7
+86,7
@@
Example:
% {
% my $recvalue = $record->$key();
<OPTION VALUE="<% $recvalue %>"
% {
% my $recvalue = $record->$key();
<OPTION VALUE="<% $recvalue %>"
- <% ref($value) && $value->{$recvalue} || $value == $recvalue
+ <%
$opt{'all_selected'} ||
ref($value) && $value->{$recvalue} || $value == $recvalue
? ' SELECTED' : ''
%>
><% $opt{'label_showkey'} ? "$recvalue: " : '' %>
? ' SELECTED' : ''
%>
><% $opt{'label_showkey'} ? "$recvalue: " : '' %>
diff --git
a/httemplate/search/cust_main.html
b/httemplate/search/cust_main.html
index
f098fd3
..
186467e
100755
(executable)
--- a/
httemplate/search/cust_main.html
+++ b/
httemplate/search/cust_main.html
@@
-54,9
+54,8
@@
for my $param ( @scalars ) {
}
#lists
}
#lists
-for my $param (qw( payby )) {
- $search_hash{$param} = [ $cgi->param($param) ]
- if $cgi->param($param);
+for my $param (qw( classnum payby )) {
+ $search_hash{$param} = [ $cgi->param($param) ];
}
###
}
###
diff --git
a/httemplate/search/report_cust_main.html
b/httemplate/search/report_cust_main.html
index
f139d4b
..
92df58c
100755
(executable)
--- a/
httemplate/search/report_cust_main.html
+++ b/
httemplate/search/report_cust_main.html
@@
-20,6
+20,13
@@
)
%>
)
%>
+ <% include( '/elements/tr-select-cust_class.html',
+ 'label' => 'Class',
+ 'multiple' => 1,
+ 'pre_options' => [ '' => '(none)' ],
+ 'all_selected' => 1,
+ )
+ %>
% foreach my $field (qw( signupdate )) {
% foreach my $field (qw( signupdate )) {