RT#42394: paycvv during cust_payby replace (v4+ only) [fixed paycvv removal]
[freeside.git] / httemplate / misc / email-customer-statement.html
index df95d7f..39c99e5 100644 (file)
@@ -34,14 +34,14 @@ my $alternate_form = sub {
       qw( start_date end_date )
     ),
     '</TABLE>',
-    '<INPUT TYPE="hidden" NAME="action" VALUE="preview">',
+    '<INPUT TYPE="hidden" NAME="preview" VALUE="1">',
     '<INPUT TYPE="submit" VALUE="Preview notice">',
   );
 };
 
 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";
 
@@ -69,7 +69,7 @@ my $post_search_hook = sub {
     $summary_text
   );
 
-  $cgi->param('html_body',
+  $cgi->param('body',
     '<P>' .
     $opt{'conf'}->config('company_name') . 
     ' statement of charges and payments for ' .
@@ -79,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 ),
         ),