]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/rp.pl
Parser für besondere Zeichen in special_chars umgeschrieben.
[mfinanz.git] / bin / mozilla / rp.pl
index 7fef683c31ada2b453e54a27a45d3daf5c90d0d1..8004e920ac93cb7c3fa3b8b4c0e77e02e269ee54 100644 (file)
@@ -91,6 +91,8 @@ require "bin/mozilla/reportgenerator.pl";
 # $locale->text('Non-taxable Sales')
 # $locale->text('Non-taxable Purchases')
 
+# $form->parse_html_template('rp/html_report_susa')
+
 my $rp_access_map = {
   'projects'         => 'report',
   'ar_aging'         => 'general_ledger',
@@ -1417,10 +1419,11 @@ sub generate_trial_balance {
   $report->set_options('output_format'        => 'HTML',
                        'title'                => $form->{title},
                        'attachment_basename'  => $attachment_basename . strftime('_%Y%m%d', localtime time),
+                       'html_template'        => 'rp/html_report_susa',
+                       'pdf_template'         => 'rp/html_report_susa',
     );
   $report->set_options_from_form();
-  # $form->parse_html_template('report_generator/html_report_susa', $variables));
-  $form->{report_template} = 'report_generator/html_report_susa';
+
   # add sort and escape callback, this one we use for the add sub
   $form->{callback} = $href .= "&sort=$form->{sort}";
 
@@ -1981,19 +1984,6 @@ sub print_form {
 
   $auth->assert('general_ledger');
 
-  my %replacements =
-    (
-     "ä" => "ae", "ö" => "oe", "ü" => "ue",
-     "Ä" => "Ae", "Ö" => "Oe", "Ü" => "Ue",
-     "ß" => "ss",
-     " " => "_"
-    );
-
-  foreach my $key (keys %replacements) {
-    my $new_key = SL::Iconv::convert("ISO-8859-15", $dbcharset, $key);
-    $replacements{$new_key} = $replacements{$key} if $new_key ne $key;
-  }
-
   $form->{statementdate} = $locale->date(\%myconfig, $form->{todate}, 1);
 
   $form->{templates} = "$myconfig{templates}";
@@ -2072,8 +2062,8 @@ sub print_form {
             $form->format_amount(\%myconfig, $form->{"${_}total"}, 2)
         } (c0, c30, c60, c90, "");
 
-        $form->{attachment_filename} = $locale->text("Statement") . "_$form->{todate}.$attachment_suffix";
-        map({ $form->{attachment_filename} =~ s/$_/$replacements{$_}/g; } keys(%replacements));
+        $form->{attachment_filename} =  $locale->quote_special_chars('filenames', $locale->text("Statement") . "_$form->{todate}.$attachment_suffix");
+        $form->{attachment_filename} =~ s/\s+/_/g;
 
         $form->parse_template(\%myconfig, $userspath);