X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Femail-customer-statement.html;h=7ed380b58fedf86fff7181a8dbaae4f7d1112ce6;hp=65660f1be4a4f8c4f3c4eca7ecee24cf6f64b339;hb=f822e27a1e00594332ffa487a1c284234c5580a6;hpb=3b46d452696901ff2dec41125f68c689ecffd5b9 diff --git a/httemplate/misc/email-customer-statement.html b/httemplate/misc/email-customer-statement.html index 65660f1be..7ed380b58 100644 --- a/httemplate/misc/email-customer-statement.html +++ b/httemplate/misc/email-customer-statement.html @@ -1,17 +1,18 @@ - - <% include('email-customers.html', - 'form_action' => 'email-customer-statement.html', - 'title' => 'Send statement to customer', - 'no_search_fields' => [ 'start_date', 'end_date' ], - 'alternate_form' => $alternate_form, - 'post_search_hook' => $post_search_hook, - ) - %> - +<& email-customers.html, + 'form_action' => 'email-customer-statement.html', + 'title' => 'Send statement to customer', + 'no_search_fields' => [ 'start_date', 'end_date' ], + 'alternate_form' => $alternate_form, + 'post_search_hook' => $post_search_hook, + 'acl' => $acl, + 'process_url' => 'process/email-customer-statement.html', +&> <%init> +my $acl = 'Resend invoices'; + die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); + unless $FS::CurrentUser::CurrentUser->access_right($acl); my $alternate_form = sub { # this could maaaybe be a separate element, for cleanliness @@ -24,23 +25,23 @@ my $alternate_form = sub { my $label = ucfirst($_); $label =~ s/_/ /; include('/elements/tr-input-date-field.html',{ - 'name' => $_, - 'value' => $cgi->param($_) || '', - 'label' => $label, + 'name' => $_, + 'value' => ( scalar($cgi->param($_)) || '' ), + 'label' => $label, 'noinit' => $noinit++ }); } qw( start_date end_date ) ), '', - '', + '', '', ); }; my $post_search_hook = sub { my %opt = @_; - return unless $cgi->param('action') eq 'preview'; + return unless $cgi->param('preview'); my $cust_main = qsearchs('cust_main',$opt{'search'}) or die "Could not find customer"; @@ -68,7 +69,7 @@ my $post_search_hook = sub { $summary_text ); - $cgi->param('html_body', + $cgi->param('body', '

' . $opt{'conf'}->config('company_name') . ' statement of charges and payments for ' . @@ -78,7 +79,7 @@ my $post_search_hook = sub { 'history' => [ $cust_main->payment_history( map { - $_ => parse_datetime($cgi->param($_)) + $_ => parse_datetime(scalar($cgi->param($_))) } qw( start_date end_date ), ),