1 <% include( 'elements/search.html',
2 'title' => 'Customer Search Results',
5 'count_query' => $count_query,
6 'header' => [ FS::UI::Web::cust_header(
7 $cgi->param('cust_fields')
12 \&FS::UI::Web::cust_fields,
15 'color' => [ FS::UI::Web::cust_colors(),
18 'style' => [ FS::UI::Web::cust_styles(),
21 'align' => [ FS::UI::Web::cust_aligns(),
24 'links' => [ ( map { $_ ne 'Cust. Status' ? $link : '' }
25 FS::UI::Web::cust_header(
26 $cgi->param('cust_fields')
35 my $link = [ "${p}view/cust_main.cgi?", 'custnum' ];
41 unless ( $FS::CurrentUser::CurrentUser->access_right('List customers') &&
42 $FS::CurrentUser::CurrentUser->access_right('List packages')
47 #$search_hash{'query'} = $cgi->keywords;
50 for my $param (qw( agentnum status cancelled_pkgs cust_fields flattened_pkgs)) {
51 $search_hash{$param} = scalar( $cgi->param($param) )
52 if $cgi->param($param);
56 for my $param (qw( payby )) {
57 $search_hash{$param} = [ $cgi->param($param) ]
58 if $cgi->param($param);
65 foreach my $field (qw( signupdate )) {
67 my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
69 next if $beginning == 0 && $ending == 4294967295;
70 #or $disable{$cgi->param('status')}->{$field};
72 $search_hash{$field} = [ $beginning, $ending ];
80 $search_hash{'current_balance'} =
81 [ FS::UI::Web::parse_lt_gt($cgi, 'current_balance') ];
87 my $sql_query = FS::cust_main->search_sql(\%search_hash);
88 my $count_query = delete($sql_query->{'count_query'});
89 my @extra_headers = @{ delete($sql_query->{'extra_headers'}) };
90 my @extra_fields = @{ delete($sql_query->{'extra_fields'}) };