package import w/bulk phone number ranges, RT#39127
[freeside.git] / httemplate / misc / email-customer-statement.html
index 65660f1..20430f5 100644 (file)
@@ -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
@@ -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 ),
         ),