1ab516e6f429d56c02cc85bef8c92d9eb92bd701
[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
15  <p><div class="listtop">[% title %]: [% HTML.escape(export.ids.join(', ')) %]</div></p>
16
17  <form action="sepa.pl" method="post">
18   <input type="hidden" name="action" value="dispatcher">
19
20   <p>
21    <table>
22     <tr>
23      [%- IF show_post_payments_button %]
24       <th class="listheading" align="center"><input type="checkbox" id="select_all"></th>
25      [%- END %]
26      <th class="listheading">[% 'Invoice' | $T8 %]</th>
27      <th class="listheading">[%- IF is_vendor %][% 'Vendor' | $T8 %][%- ELSE %][%- LxERP.t8('Customer') %][%- END %]</th>
28      [%- IF is_vendor %]
29       <th class="listheading" colspan="2">[% 'Source bank account' | $T8 %]</th>
30       <th class="listheading" colspan="2">[% 'Target bank account' | $T8 %]</th>
31      [%- ELSE %]
32       <th class="listheading" colspan="2">[% 'Target bank account' | $T8 %]</th>
33       <th class="listheading" colspan="2">[% 'Source bank account' | $T8 %]</th>
34      [%- END %]
35      <th class="listheading" align="right">[% 'Amount' | $T8 %]</th>
36      <th class="listheading">[% 'Reference' | $T8 %]</th>
37      <th class="listheading" align="right">[% 'Requested execution date' | $T8 %]</th>
38      <th class="listheading" align="right">[% 'Execution date' | $T8 %]</th>
39     </tr>
40     <tr>
41      <th class="listheading" colspan="[% IF show_post_payments_button %]3[% ELSE %]2[% END %]">&nbsp;</th>
42      <th class="listheading">[% 'IBAN' | $T8 %]</th>
43      <th class="listheading">[% 'BIC' | $T8 %]</th>
44      <th class="listheading">[% 'IBAN' | $T8 %]</th>
45      <th class="listheading">[% 'BIC' | $T8 %]</th>
46      [%- IF show_post_payments_button %]
47       <th class="listheading" colspan="3">&nbsp;</th>
48       <th class="listheading">
49         [% L.date_tag('set_all_execution_date') %]
50       </th>
51      [%- ELSE %]
52       <th class="listheading" colspan="4">&nbsp;</th>
53      [%- END %]
54     </tr>
55
56     [%- FOREACH item = export.items %]
57      <tr class="listrow[% loop.count % 2 %]">
58       [%- IF show_post_payments_button %]
59        <input type="hidden" name="items[+].id" value="[% HTML.escape(item.id) %]">
60        <input type="hidden" name="items[].sepa_export_id" value="[% HTML.escape(item.sepa_export_id) %]">
61        <td align="center">
62         [%- UNLESS item.executed %]
63         <input type="checkbox" name="items[].selected" value="1">
64         [%- END %]
65        </td>
66       [%- END %]
67       <td>
68        <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>
69       </td>
70       <td>[% HTML.escape(item.vc_name) %]</td>
71       <td>[% HTML.escape(item.our_iban) %]</td>
72       <td>[% HTML.escape(item.our_bic) %]</td>
73       <td>[% HTML.escape(item.vc_iban) %]</td>
74       <td>[% HTML.escape(item.vc_bic) %]</td>
75       <td align="right">[% HTML.escape(LxERP.format_amount(item.amount, 2)) %]</td>
76       <td>[% HTML.escape(item.reference) %]</td>
77       <td align="right">[% HTML.escape(item.requested_execution_date) %]</td>
78       <td align="right" nowrap>
79        [%- IF item.executed %]
80         [% HTML.escape(item.execution_date) %]
81        [%- ELSIF item.export_closed %]
82         [% 'not executed' | $T8 %]
83        [%- ELSE %]
84          [% L.date_tag('items[].execution_date', item.requested_execution_date || current_date) %]
85        [%- END %]
86       </td>
87      </tr>
88     [%- END %]
89    </table>
90   </p>
91
92   <p><hr></p>
93
94   [%- IF show_post_payments_button %]
95   <p>
96    <input type="submit" class="submit" name="action_bank_transfer_post_payments" value="[% 'Post payments' | $T8 %]">
97   </p>
98
99   <script type="text/javascript" src="js/jquery.js"></script>
100   <script type="text/javascript">
101    <!--
102     function set_all_execution_date_fields() {
103       var new_date = $('#set_all_execution_date').attr('value');
104       $('INPUT[name="items[].execution_date"]').each(function() {
105         $(this).attr('value', new_date);
106       });
107     }
108
109     $(document).ready(function() {
110       $("#select_all").click(function() {
111         var checked = $(this).attr('checked');
112         $('INPUT[name="items[].selected"]').each(function() {
113           $(this).attr('checked', checked);
114         });
115       });
116     });
117      -->
118   </script>
119
120   [%- ELSE %]
121   <p>
122    <input type="submit" class="submit" name="action_bank_transfer_payment_list_as_pdf" value="[% 'Payment list as PDF' | $T8 %]">
123   </p>
124
125    [%- FOREACH item = export.items %]
126     [%- IF item.executed %]
127      <input type="hidden" name="items[+].id" value="[% HTML.escape(item.id) %]">
128      <input type="hidden" name="items[].export_id" value="[% HTML.escape(item.export_id) %]">
129     [%- END %]
130    [%- END %]
131   [%- END %]
132
133      <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
134  </form>
135