Rechnungen: Massenausdruck aus alter Rechnungssuche heraus
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 1 Apr 2016 08:34:41 +0000 (10:34 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 1 Apr 2016 08:51:12 +0000 (10:51 +0200)
bin/mozilla/ar.pl
templates/webpages/ar/ar_transactions_bottom.html
templates/webpages/ar/ar_transactions_header.html [new file with mode: 0644]

index 28c8efb..54e8010 100644 (file)
@@ -931,7 +931,7 @@ sub ar_transactions {
   my $report = SL::ReportGenerator->new(\%myconfig, $form);
 
   @columns =
-    qw(transdate id type invnumber ordnumber cusordnumber name netamount tax amount paid
+    qw(ids transdate id type invnumber ordnumber cusordnumber name netamount tax amount paid
        datepaid due duedate transaction_description notes salesman employee shippingpoint shipvia
        marge_total marge_percent globalprojectnumber customernumber country ustid taxzone payment_terms charts customertype direct_debit dunning_description);
 
@@ -949,6 +949,7 @@ sub ar_transactions {
   $href = build_std_url('action=ar_transactions', grep { $form->{$_} } @hidden_variables);
 
   my %column_defs = (
+    'ids'                     => { raw_data => $::request->presenter->checkbox_tag("", id => "check_all", checkall => "[data-checkall=1]"), align => 'center' },
     'transdate'               => { 'text' => $locale->text('Date'), },
     'id'                      => { 'text' => $locale->text('ID'), },
     'type'                    => { 'text' => $locale->text('Type'), },
@@ -994,6 +995,8 @@ sub ar_transactions {
   $form->{"l_type"} = "Y";
   map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns;
 
+  $column_defs{ids}->{visible} = 'HTML';
+
   $report->set_columns(%column_defs);
   $report->set_column_order(@columns);
 
@@ -1057,7 +1060,10 @@ sub ar_transactions {
     push @options, $locale->text('Closed');
   }
 
+  $form->{ALL_PRINTERS} = SL::DB::Manager::Printer->get_all_sorted;
+
   $report->set_options('top_info_text'        => join("\n", @options),
+                       'raw_top_info_text'    => $form->parse_html_template('ar/ar_transactions_header'),
                        'raw_bottom_info_text' => $form->parse_html_template('ar/ar_transactions_bottom'),
                        'output_format'        => 'HTML',
                        'title'                => $form->{title},
@@ -1115,6 +1121,12 @@ sub ar_transactions {
     $row->{invnumber}->{link} = build_std_url("script=" . ($ar->{invoice} ? 'is.pl' : 'ar.pl'), 'action=edit')
       . "&id=" . E($ar->{id}) . "&callback=${callback}";
 
+    $row->{ids} = {
+      raw_data =>  $::request->presenter->checkbox_tag("id[]", value => $ar->{id}, "data-checkall" => 1),
+      valign   => 'center',
+      align    => 'center',
+    };
+
     my $row_set = [ $row ];
 
     if (($form->{l_subtotal} eq 'Y')
index ad631f3..d2c0cdc 100644 (file)
@@ -1,4 +1,21 @@
-[% USE T8 %][% USE HTML %] <form method="post" action="dispatcher.pl?M=ar">
+[% USE T8 %][% USE HTML %][%- USE LxERP -%][%- USE L -%]
+
+  [% IF ALL_PRINTERS.size %]
+   <p>
+    [% LxERP.t8("Print destination") %]:
+    [% SET  printers = [ { description=LxERP.t8("Download PDF, do not print") } ] ;
+       CALL printers.import(ALL_PRINTERS);
+       L.select_tag("printer_id", printers, title_key="description", default=printer_id) %]
+   </p>
+  [% END %]
+
+  <p>
+   [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %]
+   [% L.submit_tag("action_print", LxERP.t8("Print")) %]
+  </p>
+ </form>
+
+ <form method="post" action="dispatcher.pl?M=ar">
 
   <input name="callback" type="hidden" value="[% callback %]">
 
@@ -8,4 +25,3 @@
   <input class="submit" type="submit" name="A_sales_invoice" value="[%- 'Sales Invoice' | $T8 %]">
 
  </form>
-
diff --git a/templates/webpages/ar/ar_transactions_header.html b/templates/webpages/ar/ar_transactions_header.html
new file mode 100644 (file)
index 0000000..a583aa9
--- /dev/null
@@ -0,0 +1 @@
+<form method="post" action="controller.pl">