From d6838f77443e2ef69364556e186a3ec5aa244fe3 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 1 Apr 2016 10:34:41 +0200 Subject: [PATCH] Rechnungen: Massenausdruck aus alter Rechnungssuche heraus --- bin/mozilla/ar.pl | 14 ++++++++++++- .../webpages/ar/ar_transactions_bottom.html | 20 +++++++++++++++++-- .../webpages/ar/ar_transactions_header.html | 1 + 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 templates/webpages/ar/ar_transactions_header.html diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 28c8efbab..54e80106d 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -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') diff --git a/templates/webpages/ar/ar_transactions_bottom.html b/templates/webpages/ar/ar_transactions_bottom.html index ad631f3f3..d2c0cdc1c 100644 --- a/templates/webpages/ar/ar_transactions_bottom.html +++ b/templates/webpages/ar/ar_transactions_bottom.html @@ -1,4 +1,21 @@ -[% USE T8 %][% USE HTML %]
+[% USE T8 %][% USE HTML %][%- USE LxERP -%][%- USE L -%] + + [% IF ALL_PRINTERS.size %] +

+ [% 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) %] +

+ [% END %] + +

+ [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %] + [% L.submit_tag("action_print", LxERP.t8("Print")) %] +

+
+ +
@@ -8,4 +25,3 @@
- diff --git a/templates/webpages/ar/ar_transactions_header.html b/templates/webpages/ar/ar_transactions_header.html new file mode 100644 index 000000000..a583aa92a --- /dev/null +++ b/templates/webpages/ar/ar_transactions_header.html @@ -0,0 +1 @@ +
-- 2.20.1