Mahnung per Mail: auch Rechnung über Mahngebühren anhängen
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Tue, 16 Mar 2021 15:29:11 +0000 (16:29 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Wed, 17 Mar 2021 15:48:18 +0000 (16:48 +0100)
Der Mailer erwartet den Pfad für das Attachment mit dem key "path",
nicht "filename".
Zudem übersetzten Anhang-Namen verwenden.

SL/DN.pm

index 460d231..deeff63 100644 (file)
--- a/SL/DN.pm
+++ b/SL/DN.pm
@@ -1102,7 +1102,8 @@ sub print_invoice_for_fees {
 
   map { delete $form->{$_} } grep /^[a-z_]+_\d+$/, keys %{ $form };
 
-  $form->{attachment_filename} = $form->get_formname_translation('dunning_invoice') . "_${dunning_id}.pdf";
+  my $attachment_filename      = $form->get_formname_translation('dunning_invoice') . "_${dunning_id}.pdf";
+  $form->{attachment_filename} = $attachment_filename;
   $form->{attachment_type}     = "dunning";
   $form->{attachment_id}       = $form->{invoice_id};
   $form->parse_template($myconfig);
@@ -1110,8 +1111,8 @@ sub print_invoice_for_fees {
   restore_form($saved_form);
 
   push @{ $form->{DUNNING_PDFS} }, $filename;
-  push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'filename' => "${spool}/$filename",
-                                           'name'     => "dunning_invoice_${dunning_id}.pdf" };
+  push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'path' => "${spool}/$filename",
+                                           'name' => $attachment_filename };
 
   $main::lxdebug->leave_sub();
 }