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