-
- $create_params{variables}->{$_} = $variables{$_} for keys %variables;
-
- $invoice->flatten_to_form($create_params{variables}, format_amounts => 1);
- $create_params{variables}->prepare_for_printing;
-
- push @pdf_file_names, $ctrl->create_pdf(%create_params);
-
- # copy file to webdav folder
- if ($::instance_conf->get_webdav_documents) {
- my $webdav = SL::Webdav->new(
- type => 'invoice',
- number => $invoice->invnumber,
- );
- my $webdav_file = SL::Webdav::File->new(
- webdav => $webdav,
- filename => t8('Invoice') . '_' . $invoice->invnumber . '.pdf',
- );
- eval {
- $webdav_file->store(file => $pdf_file_names[-1]);
- 1;
- } or do {
- push @{ $data->{print_errors} }, { id => $invoice->id, number => $invoice->invnumber, message => $@ };
- }
- }
-