X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_payby.html;fp=httemplate%2Fsearch%2Fcust_payby.html;h=140391b15316212544496fe9390a9c2ba3897c8b;hb=a4d4d3df88b33a6db30b565921f6d62efb252351;hp=0000000000000000000000000000000000000000;hpb=6615733676adb431ae48c78ce24758fe571614c1;p=freeside.git diff --git a/httemplate/search/cust_payby.html b/httemplate/search/cust_payby.html new file mode 100644 index 000000000..140391b15 --- /dev/null +++ b/httemplate/search/cust_payby.html @@ -0,0 +1,94 @@ +<& elements/search.html, + 'title' => emt('Customer stored payment information results'), + 'menubar' => $menubar, + 'name' => emt('cards or bank accounts'), #?? + 'query' => $sql_query, + 'count_query' => $count_query, + 'header' => [ @headers, + FS::UI::Web::cust_header( + $cgi->param('cust_fields') + ), + ], + 'fields' => [ + @fields, + \&FS::UI::Web::cust_fields, + ], + 'color' => [ + ( map '', @fields ), + FS::UI::Web::cust_colors(), + ], + 'style' => [ + ( map '', @fields ), + FS::UI::Web::cust_styles(), + ], + 'align' => [ + ( map '', @fields ), + FS::UI::Web::cust_aligns(), + ], + 'links' => [ + ( map '', @fields ), + ( map { $_ ne 'Cust. Status' ? $link : '' } + FS::UI::Web::cust_header( + $cgi->param('cust_fields') + ) + ), + ], +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Advanced customer search'); + +my %search_hash = (); + +my @scalars = qw ( + paydate_year paydate_month +); + +for my $param ( @scalars ) { + $search_hash{$param} = scalar( $cgi->param($param) ) + if length($cgi->param($param)); +} + +#lists +for my $param (qw( payby )) { + $search_hash{$param} = [ $cgi->param($param) ]; +} + +### +# etc +### + +my $sql_query = FS::cust_payby->search_sql(\%search_hash); +my $count_query = delete($sql_query->{'count_query'}); + +my @headers = ( 'Payment information', + ); + +my @fields = ( sub { my $cust_payby = shift; + FS::payby->shortname( $cust_payby->payby ). ' '. + $cust_payby->paymask; + } + ); + +my $link = [ "${p}view/cust_main.cgi?", 'custnum' ]; + +### +# email links +### + +my $menubar = []; + +#XXX TODO +#if ( $FS::CurrentUser::CurrentUser->access_right('Bulk send customer notices') ) { +# +# my $uri = new URI; +# $uri->query_form( \%search_hash ); +# my $query = $uri->query; +# +# push @$menubar, emt('Email a notice to these customers') => +# "${p}misc/email-customers.html?table=cust_main&$query", +# +#} + +