$::form->{printer_id} ||= $self->default_printer_id;
+ $self->setup_list_invoices_action_bar(num_rows => scalar(@{ $self->invoice_models->get }));
+
$self->render('mass_invoice_create_print_from_do/list_invoices',
title => $::locale->text('Open invoice'),
noshow => $show,
$self->{filter_summary} = join ', ', @filter_strings;
}
+
+sub setup_list_invoices_action_bar {
+ my ($self, %params) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Search'),
+ submit => [ '#search_form', { action => 'MassInvoiceCreatePrint/list_invoices' } ],
+ accesskey => 'enter',
+ ],
+ action => [
+ t8('Reset'),
+ call => [ 'kivi.Project.reset_search_form' ],
+ ],
+ action => [
+ $::locale->text('Print'),
+ call => [ 'kivi.MassInvoiceCreatePrint.showMassPrintOptionsOrDownloadDirectly' ],
+ disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef,
+ ],
+ );
+ }
+}
+
1;
__END__
return true;
};
+
+ this.resetSearchForm = function() {
+ $("#filter_table input").val("");
+ };
});
$(kivi.MassInvoiceCreatePrint.setup);
[%- USE L %][%- USE LxERP %][%- USE HTML %]
<div>
- <form action="controller.pl" method="post">
+ <form action="controller.pl" method="post" id="search_form">
<div class="filter_toggle" [% IF noshow == 0 %]style="display:none"[% END %]>
<a href="#" onClick="javascript:$('.filter_toggle').toggle()">[% LxERP.t8('Show Filter') %]</a>
[% SELF.filter_summary %]
</tr>
</table>
- [% L.hidden_tag('action', 'MassInvoiceCreatePrint/dispatch') %]
+ [% L.hidden_tag('action', 'MassInvoiceCreatePrint/' _ LIST_ACTION, id='filter_action') %]
[% L.hidden_tag('sort_by', FORM.sort_by) %]
[% L.hidden_tag('sort_dir', FORM.sort_dir) %]
[% L.hidden_tag('page', FORM.page) %]
- [% L.submit_tag(LIST_ACTION, LxERP.t8('Continue'))%]
-
- <a href="#" onClick="javascript:$('#filter_table input,#filter_table select').val('');">[% LxERP.t8('Reset') %]</a>
-
</div>
</form>
[%- INCLUDE "common/flash.html" %]
-[% LIST_ACTION = 'action_list_invoices' %]
-[%- PROCESS 'mass_invoice_create_print_from_do/_filter.html' filter=SELF.filter %]
+[% LIST_ACTION = 'list_invoices' %]
+[%- PROCESS 'mass_invoice_create_print_from_do/_filter.html' filter=SELF.invoice_models.filtered.laundered %]
[% IF noshow == 1 %]
[% invoices = SELF.invoice_models.get;
</p>
[%- ELSE %]
- <form method="post" action="controller.pl">
+ <form method="post" action="controller.pl" id="report_form">
<table width="100%">
<thead>
<tr class="listheading">
[% L.paginate_controls %]
[% END %]
- <hr size="3" noshade>
+ [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %]
+ [% L.hidden_tag("printer_id") %]
+ </form>
- [% IF SELF.printers.size %]
+ [% IF SELF.printers.size %]
+ <div id="print_options" class="hidden">
<p>
[% LxERP.t8("Print destination") %]:
[% SET printers = [ { description=LxERP.t8("Download PDF, do not print") } ] ;
CALL printers.import(SELF.printers);
- L.select_tag("printer_id", printers, title_key="description", default=FORM.printer_id) %]
+ L.select_tag("", printers, id="print_options_printer_id", title_key="description", default=FORM.printer_id) %]
</p>
- [% END %]
- <p>
- [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %]
- [% L.submit_tag("action_print", LxERP.t8("Print")) %]
- </p>
- </form>
+ <p>
+ [% L.button_tag("kivi.MassInvoiceCreatePrint.massPrint()", LxERP.t8('Print')) %]
+ </p>
+ </div>
+ [% END %]
[%- END %]
[%- END %]
[%- INCLUDE "common/flash.html" %]
-[% LIST_ACTION = 'action_list_sales_delivery_orders' %]
+[% LIST_ACTION = 'list_sales_delivery_orders' %]
[% SET MODELS = SELF.sales_delivery_order_models;
dummy = MODELS.finalize %]