3 [% USE HTML %][% USE LxERP %]
4 [% IF vc == 'vendor' %]
5 [% SET is_vendor = 1 %]
9 [% SET is_vendor = 0 %]
14 [%- IF error_message %]
15 <p><div class="message_error">[% error_message %]</div></p>
18 <p><div class="listtop">[% title %]</div></p>
20 <form action="sepa.pl" method="post" id="form">
23 [% 'Please select the source bank account for the transfers:' | $T8 %]
25 [% 'Please select the destination bank account for the collections:' | $T8 %]
28 [% L.select_tag('bank_account',
30 title_key='displayable_name',
31 default=bank_account.id,
40 [% 'Please Check the bank information for each vendor:' | $T8 %]
42 [% 'Please Check the bank information for each customer:' | $T8 %]
47 <th class="listheading">[%- IF is_vendor %][% 'Vendor' | $T8 %][%- ELSE %][%- LxERP.t8('Customer') %][%- END %]</th>
48 <th class="listheading">[% 'IBAN' | $T8 %]</th>
49 <th class="listheading">[% 'BIC' | $T8 %]</th>
50 <th class="listheading">[% 'Bank' | $T8 %]</th>
51 [% IF vc == 'customer' %]
52 <th class="listheading">[% 'Mandator ID' | $T8 %]</th>
53 <th class="listheading">[% 'Mandate Date of Signature' | $T8 %]</th>
57 [%- FOREACH vbi = VC_BANK_INFO %]
58 <tr class="listrow[% loop.count % 1 %]">
60 <input type="hidden" name="vc_bank_info[+].id" value="[% HTML.escape(vbi.id) %]">
61 <input type="hidden" name="vc_bank_info[].name" value="[% HTML.escape(vbi.name) %]">
62 [% HTML.escape(vbi.name) %]
64 <td><input name="vc_bank_info[].iban" size="34" value="[% HTML.escape(vbi.iban.substr(0, 34)) %]" maxlength="34"></td>
65 <td><input name="vc_bank_info[].bic" size="20" value="[% HTML.escape(vbi.bic.substr(0, 20)) %]" maxlength="20"></td>
66 <td><input name="vc_bank_info[].bank" size="30" value="[% HTML.escape(vbi.bank) %]"></td>
67 [% IF vc == 'customer' %]
68 <td><input name="vc_bank_info[].mandator_id" size="30" value="[% HTML.escape(vbi.mandator_id) %]"></td>
69 <td>[% L.date_tag("vc_bank_info[].mandate_date_of_signature", vbi.mandate_date_of_signature) %]</td>
77 3. [% 'Enter the requested execution date or leave empty for the quickest possible execution:' | $T8 %]
81 <th class="listheading">[%- IF is_vendor %][% 'Vendor' | $T8 %][%- ELSE %][%- LxERP.t8('Customer') %][%- END %]</th>
82 <th class="listheading">[% 'Invoice' | $T8 %]</th>
83 <th class="listheading" align="right">[% 'Amount' | $T8 %]</th>
84 <th class="listheading" align="right">[% 'Open amount' | $T8 %]</th>
85 <th class="listheading">[% 'Purpose' | $T8 %]</th>
86 <th class="listheading" align="right">[%- IF is_vendor %][% 'Bank transfer amount' | $T8 %][%- ELSE %][%- LxERP.t8('Bank collection amount') %][%- END %]</th>
87 <th class="listheading" align="right">[% LxERP.t8('Payment type') %]</th>
88 <th class="listheading" align="right">[% LxERP.t8('Skonto information') %]</th>
89 <th class="listheading">[% 'Execution date' | $T8 %]</th>
92 [%- FOREACH bank_transfer = BANK_TRANSFERS %]
93 <input type="hidden" name="bank_transfers[+].[% arap %]_id" value="[% HTML.escape(bank_transfer.id) %]">
94 <input type="hidden" name="bank_transfers[].vc_id" value="[% HTML.escape(bank_transfer.vc_id) %]">
95 <input type="hidden" name="bank_transfers[].selected" value="1">
96 <input type="hidden" id="amount_less_skonto_[% loop.count %]" name="amount_less_skonto_[% loop.count %]" value="[% LxERP.format_amount(bank_transfer.amount_less_skonto, 2) %]">
97 <input type="hidden" id="skonto_amount_[% loop.count %]" name="skonto_amount_[% loop.count %]" value="[% LxERP.format_amount(bank_transfer.skonto_amount, 2) %]">
98 <input type="hidden" id="invoice_open_amount_[% loop.count %]" name="invoice_open_amount_[% loop.count %]" value="[% LxERP.format_amount(bank_transfer.open_amount, 2) %]">
100 <tr class="listrow[% loop.count % 2 %]">
102 [%- IF loop.first || (previous_vcname != bank_transfer.vcname) %]
103 <a href="controller.pl?action=CustomerVendor/edit&db=[% vc %]&id=[% HTML.url(bank_transfer.vc_id) %]&callback=[% HTML.url('sepa.pl?action=bank_transfer_add&vc=' _ vc) %]">
104 [%- GET HTML.escape(bank_transfer.vcname);
105 SET previous_vcname = bank_transfer.vcname; -%]
111 <a href="[% IF bank_transfer.invoice %][% iris %][% ELSE %][% arap %][% END %].pl?action=edit&id=[% HTML.escape(bank_transfer.id) %]">
112 [% HTML.escape(bank_transfer.invnumber) %]
116 <td align="right">[% LxERP.format_amount(bank_transfer.invoice_amount, -2) %]</td>
117 <td align="right">[% LxERP.format_amount(bank_transfer.open_amount, -2) %]</td>
119 <input name="bank_transfers[].reference" value="[% HTML.escape(bank_transfer.reference.substr(0, 140)) %]" size="40" maxlength="140">
121 <td align="right"><input id=[% loop.count %] name="bank_transfers[].amount" value="[% LxERP.format_amount(bank_transfer.amount, -2) %]" style="text-align: right" size="12"></td>
123 [% L.select_tag('bank_transfers[].payment_type', bank_transfer.payment_select_options, value_key => 'payment_type', title_key => 'display', id => 'payment_type_' _ loop.count, class => 'type_target' ) %]
125 <td align="left" [%- IF bank_transfer.within_skonto_period %]style="background-color: LightGreen"[%- END %]>[%- IF bank_transfer.skonto_amount %] [% LxERP.format_amount(bank_transfer.percent_skonto, 2) %] % = [% LxERP.format_amount(bank_transfer.skonto_amount, 2) %] € [% 'until' | $T8 %] [% bank_transfer.skonto_date %] [% END %]</td>
127 [% L.date_tag('bank_transfers[].requested_execution_date', bank_transfer.recommended_execution_date) %]
135 [% 'Sum open amount' | $T8 %]: [% LxERP.format_amount(total_trans, -2) %]
138 <input type="hidden" name="vc" value="[%- HTML.escape(vc) %]">
139 <input type="hidden" name="confirmation" value="1">
142 <script type="text/javascript">
143 $( ".type_target" ).change(function() {
144 type_id = $(this).attr('id');
145 var id = type_id.match(/\d*$/);
146 // alert("found id " + id);
147 if ( $(this).val() == "without_skonto" ) {
148 $('#' + id).val( $('#invoice_open_amount_' + id).val() );
149 } else if ( $(this).val() == "difference_as_skonto" ) {
150 $('#' + id).val( $('#invoice_open_amount_' + id).val() );
151 } else if ( $(this).val() == "with_skonto_pt" ) {
152 $('#' + id).val( $('#amount_less_skonto_' + id).val() );