Merge branch 'master' of ssh://git-jbueren@lx-office.linet-services.de/~/lx-office-erp
[kivitendo-erp.git] / templates / webpages / sepa / bank_transfer_edit.html
1 [%- USE T8 %]
2 [% USE HTML %]
3 [% USE LxERP %]
4 [% IF vc == 'vendor' %]
5  [% SET is_vendor = 1 %]
6  [% SET arap = 'ap' %]
7  [% SET iris = 'ir' %]
8 [% ELSE %]
9  [% SET is_vendor = 0 %]
10  [% SET arap = 'ar' %]
11  [% SET iris = 'is' %]
12 [%- END %]
13 <body>
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        <input name="set_all_execution_date" id="set_all_execution_date" size="11">
50        <input type="button" name="set_all_execution_date_trigger" id="set_all_execution_date_trigger" value="?">
51       </th>
52      [%- ELSE %]
53       <th class="listheading" colspan="4">&nbsp;</th>
54      [%- END %]
55     </tr>
56
57     [%- FOREACH item = export.items %]
58      <tr class="listrow[% loop.count % 2 %]">
59       [%- IF show_post_payments_button %]
60        <input type="hidden" name="items[+].id" value="[% HTML.escape(item.id) %]">
61        <input type="hidden" name="items[].sepa_export_id" value="[% HTML.escape(item.sepa_export_id) %]">
62        <td align="center">
63         [%- UNLESS item.executed %]
64         <input type="checkbox" name="items[].selected" value="1">
65         [%- END %]
66        </td>
67       [%- END %]
68       <td>
69        <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>
70       </td>
71       <td>[% HTML.escape(item.vc_name) %]</td>
72       <td>[% HTML.escape(item.our_iban) %]</td>
73       <td>[% HTML.escape(item.our_bic) %]</td>
74       <td>[% HTML.escape(item.vc_iban) %]</td>
75       <td>[% HTML.escape(item.vc_bic) %]</td>
76       <td align="right">[% HTML.escape(LxERP.format_amount(item.amount, 2)) %]</td>
77       <td>[% HTML.escape(item.reference) %]</td>
78       <td align="right">[% HTML.escape(item.requested_execution_date) %]</td>
79       <td align="right" nowrap>
80        [%- IF item.executed %]
81         [% HTML.escape(item.execution_date) %]
82        [%- ELSIF item.export_closed %]
83         [% 'not executed' | $T8 %]
84        [%- ELSE %]
85         <input name="items[].execution_date" id="execution_date_[% loop.count %]" size="11"
86                value="[% IF item.requested_execution_date %][% HTML.escape(item.requested_execution_date) %][% ELSE %][% HTML.escape(current_date) %][% END %]">
87         <input type="button" name="execution_date_[% loop.count %]_trigger" id="execution_date_[% loop.count %]_trigger" value="?">
88        [%- END %]
89       </td>
90      </tr>
91     [%- END %]
92    </table>
93   </p>
94
95   <p><hr></p>
96
97   [%- IF show_post_payments_button %]
98   <p>
99    <input type="submit" class="submit" name="action_bank_transfer_post_payments" value="[% 'Post payments' | $T8 %]">
100   </p>
101
102   <script type="text/javascript" src="js/jquery.js"></script>
103   <script type="text/javascript">
104    <!--
105     function set_all_execution_date_fields() {
106       var new_date = $('#set_all_execution_date').attr('value');
107       $('INPUT[name="items[].execution_date"]').each(function() {
108         $(this).attr('value', new_date);
109       });
110     }
111
112     $(document).ready(function() {
113       $("#select_all").click(function() {
114         var checked = $(this).attr('checked');
115         $('INPUT[name="items[].selected"]').each(function() {
116           $(this).attr('checked', checked);
117         });
118       });
119
120       [%- IF show_post_payments_button %]
121        Calendar.setup({ inputField : "set_all_execution_date",
122                         ifFormat   : "[% myconfig_jsc_dateformat %]",
123                         align      : "BL",
124                         button     : "set_all_execution_date_trigger",
125                         onUpdate   : set_all_execution_date_fields });
126
127        [%- FOREACH item = export.items %]
128         [%- IF !item.executed %]
129          Calendar.setup({ inputField : "execution_date_[% loop.count %]",
130                           ifFormat   : "[% myconfig_jsc_dateformat %]",
131                           align      : "BL",
132                           button     : "execution_date_[% loop.count %]_trigger" });
133         [%- END %]
134        [%- END %]
135       [%- END %]
136     });
137      -->
138   </script>
139
140   [%- ELSE %]
141   <p>
142    <input type="submit" class="submit" name="action_bank_transfer_payment_list_as_pdf" value="[% 'Payment list as PDF' | $T8 %]">
143   </p>
144
145    [%- FOREACH item = export.items %]
146     [%- IF item.executed %]
147      <input type="hidden" name="items[+].id" value="[% HTML.escape(item.id) %]">
148      <input type="hidden" name="items[].export_id" value="[% HTML.escape(item.export_id) %]">
149     [%- END %]
150    [%- END %]
151   [%- END %]
152
153      <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
154  </form>
155
156 </body>
157 </html>