X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ee75e5986c75b6cf9886bf315e83d05ae210add0..39b80fd29481037c6a376bd5517d7d50c9ff431d:/SL/BackgroundJob/MassRecordCreationAndPrinting.pm diff --git a/SL/BackgroundJob/MassRecordCreationAndPrinting.pm b/SL/BackgroundJob/MassRecordCreationAndPrinting.pm index bd8783849..e4c75b812 100644 --- a/SL/BackgroundJob/MassRecordCreationAndPrinting.pm +++ b/SL/BackgroundJob/MassRecordCreationAndPrinting.pm @@ -185,16 +185,10 @@ sub print_pdfs { foreach my $local_printer_id ($printer_id, $copy_printer_id) { next unless $local_printer_id; - my $printer = SL::DB::Printer->new(id => $local_printer_id)->load; - my $command = SL::Template::create(type => 'ShellCommand', form => Form->new(''))->parse($printer->printer_command); - if (!open $out, '|-', $command) { - push @{ $data->{print_errors} }, { message => $::locale->text('Could not execute printer command: #1', $!) }; - $job_obj->update_attributes(data_as_hash => $data); - return; - } - binmode $out; - print $out $self->{merged_pdf}; - close $out; + SL::DB::Printer + ->new(id => $local_printer_id) + ->load + ->print_document(content => $self->{merged_pdf}); } }