SEPA: Button »Zahlungsliste als PDF« nicht anzeigen, wenn nichts ausgeführt wurde
[kivitendo-erp.git] / templates / webpages / sepa / bank_transfer_edit.html
1 [%- USE T8 %]
2 [% USE HTML %]
3 [% USE LxERP %]
4 [%- USE L %]
5 [% IF vc == 'vendor' %]
6  [% SET is_vendor = 1 %]
7  [% SET arap = 'ap' %]
8  [% SET iris = 'ir' %]
9 [% ELSE %]
10  [% SET is_vendor = 0 %]
11  [% SET arap = 'ar' %]
12  [% SET iris = 'is' %]
13 [%- END %]
14 <h1>[% title %]: [% HTML.escape(export.ids.join(', ')) %]</h1>
15
16  <form action="sepa.pl" method="post">
17   <input type="hidden" name="action" value="dispatcher">
18
19   <p>
20    <table>
21     <tr>
22      [%- IF show_post_payments_button %]
23       <th class="listheading" align="center"><input type="checkbox" id="select_all"></th>
24      [%- END %]
25      <th class="listheading">[% 'Invoice' | $T8 %]</th>
26      <th class="listheading">[%- IF is_vendor %][% 'Vendor' | $T8 %][%- ELSE %][%- LxERP.t8('Customer') %][%- END %]</th>
27      [%- IF is_vendor %]
28       <th class="listheading" colspan="2">[% 'Source bank account' | $T8 %]</th>
29       <th class="listheading" colspan="2">[% 'Target bank account' | $T8 %]</th>
30      [%- ELSE %]
31       <th class="listheading" colspan="2">[% 'Target bank account' | $T8 %]</th>
32       <th class="listheading" colspan="2">[% 'Source bank account' | $T8 %]</th>
33      [%- END %]
34      <th class="listheading" align="right">[% 'Amount' | $T8 %]</th>
35      <th class="listheading" align="right">[% 'Skonto amount' | $T8 %]</th>
36      <th class="listheading" align="right">[% 'Payment type' | $T8 %]</th>
37      [% IF vc == 'customer' %]
38       <th class="listheading" align="right">[% 'Mandator ID' | $T8 %]</th>
39      [%- END %]
40      <th class="listheading">[% 'Reference' | $T8 %]</th>
41      <th class="listheading" align="right">[% 'Requested execution date' | $T8 %]</th>
42      <th class="listheading" align="right">[% 'Execution date' | $T8 %]</th>
43     </tr>
44     <tr>
45      <th class="listheading" colspan="[% IF show_post_payments_button %]3[% ELSE %]2[% END %]">&nbsp;</th>
46      <th class="listheading">[% 'IBAN' | $T8 %]</th>
47      <th class="listheading">[% 'BIC' | $T8 %]</th>
48      <th class="listheading">[% 'IBAN' | $T8 %]</th>
49      <th class="listheading">[% 'BIC' | $T8 %]</th>
50      [%- IF show_post_payments_button %]
51       <th class="listheading" colspan="[% IF vc == 'customer' %]6[% ELSE %]5[% END %]">&nbsp;</th>
52       <th class="listheading">
53         [% L.date_tag('set_all_execution_date', '', onchange='set_all_execution_date_fields(this);') %]
54       </th>
55      [%- ELSE %]
56       <th class="listheading" colspan="4">&nbsp;</th>
57      [%- END %]
58     </tr>
59
60     [%- FOREACH item = export.items %]
61      <tr class="listrow[% loop.count % 2 %]">
62       [%- IF show_post_payments_button %]
63        <input type="hidden" name="items[+].id" value="[% HTML.escape(item.id) %]">
64        <input type="hidden" name="items[].sepa_export_id" value="[% HTML.escape(item.sepa_export_id) %]">
65        <td align="center">
66         [%- UNLESS item.executed %]
67         <input type="checkbox" name="items[].selected" value="1">
68         [%- END %]
69        </td>
70       [%- END %]
71       <td>
72        <a href="[% IF item.invoice %][% iris %][% ELSE %][% arap %][% END %].pl?action=edit&type=invoice&id=[% IF is_vendor %][% HTML.url(item.ap_id) %][% ELSE %][% HTML.url(item.ar_id) %][% END %]">[% HTML.escape(item.invnumber) %]</a>
73       </td>
74       <td>[% HTML.escape(item.vc_name) %]</td>
75       <td>[% HTML.escape(item.our_iban) %]</td>
76       <td>[% HTML.escape(item.our_bic) %]</td>
77       <td>[% HTML.escape(item.vc_iban) %]</td>
78       <td>[% HTML.escape(item.vc_bic) %]</td>
79       <td align="right">[% HTML.escape(LxERP.format_amount(item.amount, 2)) %]</td>
80       <td align="right">[% HTML.escape(LxERP.format_amount(item.skonto_amount, 2)) %]</td>
81       <td align="right">[% item.payment_type | $T8 %]</td>
82       [% IF vc == 'customer' %]
83        <td>[% HTML.escape(item.mandator_id) %]</td>
84       [%- END %]
85       <td>[% HTML.escape(item.reference) %]</td>
86       <td align="right">[% HTML.escape(item.requested_execution_date) %]</td>
87       <td align="right" nowrap>
88        [%- IF item.executed %]
89         [% HTML.escape(item.execution_date) %]
90        [%- ELSIF item.export_closed %]
91         [% 'not executed' | $T8 %]
92        [%- ELSE %]
93          [% L.date_tag('items[].execution_date', item.requested_execution_date || current_date) %]
94        [%- END %]
95       </td>
96      </tr>
97     [%- END %]
98    </table>
99   </p>
100
101   <p><hr></p>
102
103   [%- IF show_post_payments_button %]
104   <p>
105    <input type="submit" class="submit" name="action_bank_transfer_post_payments" value="[% 'Post payments' | $T8 %]">
106   </p>
107
108   <script type="text/javascript">
109    <!--
110     function set_all_execution_date_fields(input) {
111       var new_date = $(input).val();
112       $('INPUT[name="items[].execution_date"]').each(function() {
113         $(this).val(new_date);
114       });
115     }
116
117     $(function() {
118       $("#select_all").checkall('INPUT[name="items[].selected"]');
119     });
120      -->
121   </script>
122
123   [%- ELSE %]
124    [%- SET has_executed = 0;
125        FOREACH item = export.items;
126          IF item.executed;
127            SET has_executed = 1;
128          END ;
129        END ;
130        IF has_executed %]
131   <p>
132    <input type="submit" class="submit" name="action_bank_transfer_payment_list_as_pdf" value="[% 'Payment list as PDF' | $T8 %]">
133   </p>
134
135    [%- FOREACH item = export.items %]
136     [%- IF item.executed %]
137      <input type="hidden" name="items[+].id" value="[% HTML.escape(item.id) %]">
138      <input type="hidden" name="items[].export_id" value="[% HTML.escape(item.export_id) %]">
139     [%- END %]
140    [%- END %]
141   [%- END %]
142   [% END %]
143
144      <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
145  </form>