X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FOrder.pm;h=8ed5b3326c43fb03dc396357eb04df4d450aec64;hb=2e16031bfdf0e7225c83d4253a7caeee3b1e6905;hp=5b225a277ce00bb0535d8871c19739d1c9c20dcf;hpb=e86c1c2a39bd3287319a134b0889a933ffc50b9e;p=kivitendo-erp.git diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 5b225a277..8ed5b3326 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -182,20 +182,10 @@ sub action_print { } elsif ($media eq 'printer') { # printer my $printer_id = $::form->{print_options}->{printer_id}; - my $printer; - $printer = SL::DB::Printer->new(id => $printer_id)->load if $printer_id; - if (!$printer) { - return $self->js->flash('error', t8('Printer not found.'))->render; - } - - my $command = SL::Template::create(type => 'ShellCommand', form => Form->new(''))->parse($printer->printer_command); - - for my $i (1 .. $copies) { - open my $out, '|-', $command or die $!; - binmode $out; - print $out $pdf; - close $out; - } + SL::DB::Printer->new(id => $printer_id)->load->print_document( + copies => $copies, + content => $pdf, + ); $self->js->flash('info', t8('The PDF has been printed')); } @@ -998,3 +988,93 @@ sub _purchase_order_type { } 1; + +__END__ + +=encoding utf-8 + +=head1 NAME + +SL::Controller::Order - controller for orders + +=head1 TODO + +=over 2 + +=item * + +testing + + +=item * + +currency + + +=item * + +customer/vendor details ('D'-button) + + +=item * + +credit limit + + +=item * + +more workflows (save as new / invoice) + + +=item * + +price sources: little symbols showing better price / better discount + + +=item * + +custom shipto address + + +=item * + +periodic invoices + + +=item * + +more details on second row (marge, ...) + + +=item * + +language / part translations + + +=item * + +access rights + + +=item * + +preset salesman from customer + + +=item * + +display weights + + +=item * + +force project if enabled in client config + + +=back + +=head1 AUTHOR + +Bernd Bleßmann Ebernd@kivitendo-premium.deE + +=cut