c382a5cfb3c6287815f029e7ae4696a3d7a5b265
[kivitendo-erp.git] / templates / webpages / mass_invoice_create_print_from_do / list_invoices.html
1 [% USE HTML %][% USE L %][% USE LxERP %]
2
3 <h1>[% FORM.title %]</h1>
4
5 [%- INCLUDE "common/flash.html" %]
6
7 [% LIST_ACTION     = 'list_invoices' %]
8 [%- PROCESS 'mass_invoice_create_print_from_do/_filter.html' filter=SELF.invoice_models.filtered.laundered %]
9
10 [% IF noshow == 1 %]
11 [% invoices = SELF.invoice_models.get;
12    MODELS          = SELF.invoice_models %]
13 [%- IF !invoices.size %]
14  <p>
15   [%- LxERP.t8("There are currently no open invoices, or none matches your filter conditions.") %]
16  </p>
17 [%- ELSE %]
18
19  <form method="post" action="controller.pl" id="report_form">
20   <table width="100%">
21    <thead>
22     <tr class="listheading">
23      <th>[% L.checkbox_tag("", id="check_all", checkall="[data-checkall=1]") %]</th>
24      <th>[% L.sortable_table_header("transdate") %]</th>
25      <th>[% L.sortable_table_header("reqdate") %]</th>
26      <th>[% L.sortable_table_header("invnumber") %]</th>
27      <th>[% L.sortable_table_header("donumber") %]</th>
28      <th>[% L.sortable_table_header("customer") %]</th>
29      <th>[% LxERP.t8("Shipto") %]</th>
30     </tr>
31    </thead>
32
33    <tbody>
34     [%- FOREACH invoice = invoices %]
35      [% invoice_id = invoice.id
36         delivery_order    = invoice.delivery_order %]
37      <tr class="listrow">
38       <td>[% L.checkbox_tag('id[]', value=invoice.id, "data-checkall"=1, checked=selected_ids.$invoice_id) %]</td>
39       <td>[% HTML.escape(invoice.transdate_as_date) %]</td>
40       <td>[% HTML.escape(invoice.deliverydate_as_date) %]</td>
41       <td>[% L.link(SELF.url_for(controller="is.pl", action="edit", type="sales_invoice", id=invoice.id), invoice.invnumber) %]</td>
42       <td>
43        [% IF delivery_order %]
44         [% L.link(SELF.url_for(controller="do.pl", action="edit", id=delivery_order.id), delivery_order.donumber) %]
45        [% ELSE %]
46         [% HTML.escape(invoice.donumber) %]
47        [% END %]
48       </td>
49       <td>[% HTML.escape(invoice.customer.name) %]</td>
50       <td>[% HTML.escape(SELF.make_shipto_title(invoice.shipto || delivery_order.custom_shipto)) %]</td>
51      </tr>
52     [%- END %]
53    </tbody>
54   </table>
55
56   [% IF !SELF.invoice_ids.size %]
57    [% L.paginate_controls %]
58   [% END %]
59
60   [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %]
61   [% L.hidden_tag("printer_id") %]
62   [% L.hidden_tag("bothsided") %]
63  </form>
64
65  [% IF SELF.printers.size %]
66   <div id="print_options" class="hidden">
67    <p>
68      [% LxERP.t8("Print both sided") %]:
69      [% L.checkbox_tag('', id="print_options_bothsided") %]
70    </p>
71    <p>
72     [% LxERP.t8("Print destination") %]:
73     [% SET  printers = [ { description=LxERP.t8("Download PDF, do not print") } ] ;
74        CALL printers.import(SELF.printers);
75        L.select_tag("", printers, id="print_options_printer_id", title_key="description", default=FORM.printer_id) %]
76    </p>
77
78    <p>
79     [% L.button_tag("kivi.MassInvoiceCreatePrint.massPrint()", LxERP.t8('Print')) %]
80    </p>
81   </div>
82  [% END %]
83 [%- END %]
84 [%- END %]