1 <& elements/search.html,
2 'title' => emt('Customer Search Results'),
4 'name' => emt('customers'),
6 'count_query' => $count_query,
7 'header' => [ FS::UI::Web::cust_header(
8 $cgi->param('cust_fields')
13 \&FS::UI::Web::cust_fields,
16 'color' => [ FS::UI::Web::cust_colors(),
19 'style' => [ FS::UI::Web::cust_styles(),
22 'align' => [ FS::UI::Web::cust_aligns(),
25 'links' => [ ( map { $_ ne 'Cust. Status' ? $link : '' }
26 FS::UI::Web::cust_header(
27 $cgi->param('cust_fields')
36 unless ( $FS::CurrentUser::CurrentUser->access_right('List customers') &&
37 $FS::CurrentUser::CurrentUser->access_right('List packages')
42 #$search_hash{'query'} = $cgi->keywords;
46 agentnum status address paydate_year paydate_month invoice_terms
47 no_censustract with_geocode custbatch usernum
49 cust_fields flattened_pkgs
53 for my $param ( @scalars ) {
54 $search_hash{$param} = scalar( $cgi->param($param) )
55 if $cgi->param($param);
59 for my $param (qw( classnum payby tagnum )) {
60 $search_hash{$param} = [ $cgi->param($param) ];
67 foreach my $field (qw( signupdate )) {
69 my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
71 next if $beginning == 0 && $ending == 4294967295 && !defined($cgi->param('signuphour'));
72 #or $disable{$cgi->param('status')}->{$field};
74 $search_hash{$field} = [ $beginning, $ending, $cgi->param('signuphour') ];
82 $search_hash{'current_balance'} =
83 [ FS::UI::Web::parse_lt_gt($cgi, 'current_balance') ];
89 my $sql_query = FS::cust_main::Search->search(\%search_hash);
90 my $count_query = delete($sql_query->{'count_query'});
91 my @extra_headers = @{ delete($sql_query->{'extra_headers'}) };
92 my @extra_fields = @{ delete($sql_query->{'extra_fields'}) };
94 my $link = [ "${p}view/cust_main.cgi?", 'custnum' ];
102 if ( $FS::CurrentUser::CurrentUser->access_right('Bulk send customer notices') ) {
105 $uri->query_form( \%search_hash );
106 my $query = $uri->query;
108 push @$menubar, emt('Email a notice to these customers') =>
109 "${p}misc/email-customers.html?table=cust_main&$query",