From: Moritz Bunkus Date: Wed, 18 Apr 2007 13:03:01 +0000 (+0000) Subject: Beim Verschicken von Sammelrechnungen per Email einen besseren Namen für den Dateianh... X-Git-Tag: release-2.4.3^2~493 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d2e805cac9546036c5fe186b74ccecf3151b1e8b;p=kivitendo-erp.git Beim Verschicken von Sammelrechnungen per Email einen besseren Namen für den Dateianhang wählen. --- diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 8156df08d..152db9572 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -2003,21 +2003,33 @@ sub print { sub print_form { $lxdebug->enter_sub(); + my %replacements = + ( + "ä" => "ae", "ö" => "oe", "ü" => "ue", + "Ä" => "Ae", "Ö" => "Oe", "Ü" => "Ue", + "ß" => "ss", + " " => "_" + ); + $form->{statementdate} = $locale->date(\%myconfig, $form->{todate}, 1); $form->{templates} = "$myconfig{templates}"; - $form->{IN} = "$form->{type}.html"; - + my $suffix = "html"; + my $attachment_suffix = "html"; if ($form->{format} eq 'postscript') { $form->{postscript} = 1; - $form->{IN} =~ s/html$/tex/; - } - if ($form->{format} eq 'pdf') { + $suffix = "tex"; + $attachment_suffix = "ps"; + } elsif ($form->{format} eq 'pdf') { $form->{pdf} = 1; - $form->{IN} =~ s/html$/tex/; + $suffix = "tex"; + $attachment_suffix = "pdf"; } + $form->{IN} = "$form->{type}.$suffix"; + + # Save $form->{email} because it will be overwritten. $form->{EMAIL_RECIPIENT} = $form->{email}; @@ -2077,6 +2089,9 @@ 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->parse_template(\%myconfig, $userspath); }