Auftrags-Controller: generate_attachment_filename beim Erzeugen des PDFs nehmen
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Wed, 11 Nov 2015 12:10:59 +0000 (13:10 +0100)
committerG. Richardson <information@kivitendo-premium.de>
Mon, 16 Nov 2015 15:15:59 +0000 (16:15 +0100)
SL/Controller/Order.pm

index aaa31cc..6f42213 100644 (file)
@@ -125,9 +125,14 @@ sub action_create_pdf {
   my $key = join('_', Time::HiRes::gettimeofday(), int rand 1000000000000);
   $::auth->set_session_value("Order::create_pdf-${key}" => $sfile->file_name);
 
-  $::form->{formname}  = $self->type;
-  $::form->{language} = 'de';
-  my $pdf_filename =  $::form->get_formname_translation . '_' . $self->order->ordnumber . '.pdf';
+  my $form = Form->new;
+  $form->{ordnumber} = $self->order->ordnumber;
+  $form->{formname}  = $self->type;
+  $form->{type}      = $self->type;
+  $form->{language}  = 'de';
+  $form->{format}    = 'pdf';
+
+  my $pdf_filename = $form->generate_attachment_filename();
 
   $self->js
     ->run('download_pdf', $pdf_filename, $key)