Massendruck: Option "beidseitig" auch beim Drucken aus Rechnungsberichten
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Wed, 5 Feb 2020 14:38:32 +0000 (15:38 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Wed, 5 Feb 2020 14:38:32 +0000 (15:38 +0100)
SL/Controller/MassInvoiceCreatePrint.pm
js/kivi.MassInvoiceCreatePrint.js
templates/webpages/ar/ar_transactions_bottom.html
templates/webpages/mass_invoice_create_print_from_do/list_invoices.html

index 78e7859..aab6373 100644 (file)
@@ -113,7 +113,7 @@ sub action_print {
     return $self->redirect_to(action => 'list_invoices');
   }
 
-  $self->download_or_print_documents(printer_id => $::form->{printer_id}, invoices => \@invoices);
+  $self->download_or_print_documents(printer_id => $::form->{printer_id}, invoices => \@invoices, bothsided => $::form->{bothsided});
 }
 
 sub action_create_print_all_start {
@@ -295,7 +295,7 @@ sub download_or_print_documents {
       });
 
     @pdf_file_names = $self->create_pdfs(%pdf_params);
-    my $merged_pdf  = $self->merge_pdfs(file_names => \@pdf_file_names);
+    my $merged_pdf  = $self->merge_pdfs(file_names => \@pdf_file_names, bothsided => $params{bothsided});
     unlink @pdf_file_names;
 
     if (!$params{printer_id}) {
index 93fa162..20ecde0 100644 (file)
@@ -104,6 +104,7 @@ namespace('kivi.MassInvoiceCreatePrint', function(ns) {
     $('#print_options').dialog('close');
 
     $('#printer_id').val($('#print_options_printer_id').val());
+    $('#bothsided').val($('#print_options_bothsided').prop('checked') ? 1 : 0);
     $('#action').val('MassInvoiceCreatePrint/print');
 
     $('#report_form').submit();
index bb939a5..e24771b 100644 (file)
@@ -2,6 +2,7 @@
 
   [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %]
   [% L.hidden_tag("printer_id") %]
+  [% L.hidden_tag("bothsided") %]
  </form>
 
  <form method="post" action="ar.pl" id="create_new_form">
 
 [% IF ALL_PRINTERS.size %]
  <div id="print_options" class="hidden">
+   <p>
+     [% LxERP.t8("Print both sided") %]:
+     [% L.checkbox_tag('', id="print_options_bothsided") %]
+   </p>
   <p>
   [% LxERP.t8("Print destination") %]:
   [% SET  printers = [ { description=LxERP.t8("Download PDF, do not print") } ] ;
index bc88963..c382a5c 100644 (file)
 
   [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %]
   [% L.hidden_tag("printer_id") %]
+  [% L.hidden_tag("bothsided") %]
  </form>
 
  [% IF SELF.printers.size %]
   <div id="print_options" class="hidden">
+   <p>
+     [% LxERP.t8("Print both sided") %]:
+     [% L.checkbox_tag('', id="print_options_bothsided") %]
+   </p>
    <p>
     [% LxERP.t8("Print destination") %]:
     [% SET  printers = [ { description=LxERP.t8("Download PDF, do not print") } ] ;