X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FBackgroundJob%2FMassRecordCreationAndPrinting.pm;h=bd878384974408b5d779d7bbefe92f96c0eac066;hb=2215a7f923a1b5653a835fad7fea0d5512f7db36;hp=e14e13190e3b494f5189a3d927df740f999a02d1;hpb=b74a00e5100336d13d1536870721796474599a08;p=kivitendo-erp.git diff --git a/SL/BackgroundJob/MassRecordCreationAndPrinting.pm b/SL/BackgroundJob/MassRecordCreationAndPrinting.pm index e14e13190..bd8783849 100644 --- a/SL/BackgroundJob/MassRecordCreationAndPrinting.pm +++ b/SL/BackgroundJob/MassRecordCreationAndPrinting.pm @@ -30,6 +30,7 @@ use constant DONE => 3; # conversion_errors => [ { id => 124, number => 'A981723', message => "Stuff went boom" }, ], # print_errors => [ { id => 234, number => 'L87123123', message => "Printer is out of coffee" }, ], # pdf_file_name => 'qweqwe.pdf', +# session_id => $::auth->get_session_id, # }; sub create_invoices { @@ -101,8 +102,13 @@ sub convert_invoices_to_pdf { template => $ctrl->find_template(name => 'invoice', printer_id => $printer_id), variables => Form->new(''), return => 'file_name', + variable_content_types => { longdescription => 'html', + partnotes => 'html', + notes => 'html',} ); + + $create_params{variables}->{$_} = $variables{$_} for keys %variables; $invoice->flatten_to_form($create_params{variables}, format_amounts => 1); @@ -148,7 +154,7 @@ sub convert_invoices_to_pdf { if (!$printer_id) { my $file_name = 'mass_invoice' . $job_obj->id . '.pdf'; - my $sfile = SL::SessionFile->new($file_name, mode => 'w'); + my $sfile = SL::SessionFile->new($file_name, mode => 'w', session_id => $data->{session_id}); $sfile->fh->print($self->{merged_pdf}); $sfile->fh->close;