fe2d44194090847b1716e44feaa9f8cb6532c393
[kivitendo-erp.git] / templates / webpages / sepa / bank_transfer_add.html
1 [%- USE T8 %]
2 [% USE HTML %][% USE LxERP %]
3 [% IF vc == 'vendor' %]
4  [% SET is_vendor = 1 %]
5  [% SET arap = 'ap' %]
6  [% SET iris = 'ir' %]
7 [% ELSE %]
8  [% SET is_vendor = 0 %]
9  [% SET arap = 'ar' %]
10  [% SET iris = 'is' %]
11 [%- END %]
12
13  <p><div class="listtop">[% title %]</div></p>
14
15  <form action="sepa.pl" method="post">
16   <p>
17    [%- IF is_vendor %]
18     [% 'Please select the source bank account for the transfers:' | $T8 %]
19    [%- ELSE %]
20     [% 'Please select the destination bank account for the collections:' | $T8 %]
21    [%- END %]
22    <br>
23    [%- INCLUDE generic/multibox.html
24          name      = 'bank_account.id',
25          DATA      = BANK_ACCOUNTS,
26          id_key    = 'id',
27          label_sub = 'bank_account_label',
28    -%]
29   </p>
30
31   <p>
32    <table border="0">
33     <tr>
34      <th class="listheading" align="center"><input type="checkbox" id="select_all"></th>
35      <th class="listheading">[% IF is_vendor %][% 'Vendor' | $T8 %][%- ELSE %][%- LxERP.t8('Customer') %][%- END %]</th>
36      <th class="listheading">[% 'Invoice' | $T8 %]</th>
37      <th class="listheading" align="right">[% 'Amount' | $T8 %]</th>
38      <th class="listheading" align="right">[% 'Open amount' | $T8 %]</th>
39      <th class="listheading" align="right">[% 'Due Date' | $T8 %]</th>
40      <th class="listheading">[% 'Purpose' | $T8 %]</th>
41      <th class="listheading" align="right">[% 'Bank transfer amount' | $T8 %]</th>
42     </tr>
43
44     [%- FOREACH invoice = INVOICES %]
45      <input type="hidden" name="bank_transfers[+].[% arap %]_id" value="[% HTML.escape(invoice.id) %]">
46
47      <tr class="listrow[% loop.count % 2 %]">
48       <td align="center">
49        [%- IF invoice.vc_bank_info_ok %]
50         <input type="checkbox" name="bank_transfers[].selected" value="1"[% IF invoice.checked %] checked[% END %]>
51        [%- END %]
52       </td>
53       <td>
54        [%- IF loop.first || (previous_vcname != invoice.vcname) %]
55         <a href="controller.pl?action=CustomerVendor/edit&db=[% vc %]&id=[% HTML.url(invoice.vc_id) %]&callback=[% HTML.url('sepa.pl?action=bank_transfer_add&vc=' _ vc) %]">
56          [%- GET HTML.escape(invoice.vcname);
57              SET previous_vcname = invoice.vcname;
58              IF !invoice.vc_bank_info_ok;
59                GET ' <sup>(1)</sup>';
60                SET show_vc_bank_info_footnote = '1';
61              END; -%]
62         </a>
63        [%- END -%]
64       </td>
65
66       <td>
67        <a href="[% IF invoice.invoice %][% iris %][% ELSE %][% arap %][% END %].pl?action=edit&id=[% HTML.escape(invoice.id) %]">
68         [% HTML.escape(invoice.invnumber) %]
69        </a>
70       </td>
71
72       <td align="right">[% LxERP.format_amount(invoice.invoice_amount, -2) %]</td>
73       <td align="right">[% LxERP.format_amount(invoice.open_amount, -2) %]</td>
74       <td align="right">[% invoice.duedate %]</td>
75       <td>
76        [%- SET reference = invoice.reference_prefix _ invoice.invnumber %]
77        <input name="bank_transfers[].reference" value="[% HTML.escape(reference.substr(0, 140)) %]" maxlength="140" size="60">
78       </td>
79       <td align="right">
80        <input name="bank_transfers[].amount" value="[% LxERP.format_amount(invoice.invoice_amount, -2) %]" style="text-align: right" size="12">
81       </td>
82      </tr>
83     [%- END %]
84    </table>
85   </p>
86
87   [%- IF show_vc_bank_info_footnote %]
88    <p>
89     <sup>(1)</sup>
90     [%- IF is_vendor %]
91      [%- 'No bank information has been entered in this vendor\'s master data entry. You cannot create bank transfers unless you enter bank information.' | $T8 %]
92     [%- ELSE %]
93      [%- 'No bank information has been entered in this customer\'s master data entry. You cannot create bank collections unless you enter bank information.' | $T8 %]
94     [%- END %]
95    </p>
96   [%- END %]
97
98   <p>
99    <input type="submit" class="submit" name="action_bank_transfer_create" value="[% 'Step 2' | $T8 %]">
100   </p>
101
102   <input type="hidden" name="action" value="dispatcher">
103   <input type="hidden" name="vc" value="[%- HTML.escape(vc) %]">
104  </form>
105
106  <script type="text/javascript">
107   <!--
108     $(function() {
109       $("#select_all").checkall('INPUT[name="bank_transfers[].selected"]');
110     });
111     -->
112  </script>