[%- USE P -%][%- USE HTML -%][%- USE LxERP -%]
[% SELECT_OPTIONS = invoice.get_payment_select_options_for_bank_transaction(bt_id) %]
[% is_skonto_pt = SELECT_OPTIONS.1.selected %]
[% formatted_skonto_amount = LxERP.format_amount(invoice.skonto_amount, 2) %]
[% formatted_skonto_amount_selected = is_skonto_pt ? formatted_skonto_amount : LxERP.format_amount(0, 2) %]
[% P.hidden_tag("invoice_ids." _ bt_id _ "[]", invoice.id) %]
[% P.hidden_tag("skonto_pt." _ bt_id _ "." _ invoice.id _ "", is_skonto_pt) %]
[% LxERP.t8("Invno.") %]: [% HTML.escape(invoice.invnumber) %]
[% LxERP.t8("Open amount") %]: [% LxERP.format_amount(invoice.open_amount, 2) %]
[% P.select_tag("invoice_skontos." _ bt_id _ "[]", SELECT_OPTIONS, value_key="payment_type", title_key="display", onChange="kivi.BankTransaction.update_skonto(this, " _ bt_id _ ", " _ invoice.id _ ", '$formatted_skonto_amount')" ) %]
[% LxERP.t8("Skonto amount") %]: [% P.input_tag("free_skonto_amount." _ bt_id _ "." _ invoice.id _ "", "$formatted_skonto_amount_selected", default=0, style=style, disabled=1, size=4, class='numeric', onblur="kivi.BankTransaction.update_invoice_amount(" _ bt_id _ ", 0, this)") %]
[% IF invoice.forex %]
[% LxERP.t8("Curr") %]: [% HTML.escape(invoice.currency.name) %]
[% daily_exchangerate = invoice.get_exchangerate_for_bank_transaction(bt_id) %]
[% formatted_daily_exchangerate = daily_exchangerate ? LxERP.format_amount(daily_exchangerate, 5) : LxERP.format_amount(1, 5) %]
[% UNLESS daily_exchangerate %][% LxERP.t8("new") %] [% END %][% LxERP.t8("default exchange rate") %]: [% P.input_tag("exchangerate_" _ bt_id _ "_" _ invoice.id , "$formatted_daily_exchangerate", style=style, disabled=0, size=4, class='numeric') %]
[% P.hidden_tag("currency_id_" _ bt_id _ "_" _ invoice.id, invoice.currency.id) %]
[% IF invoice.invoice_type == 'ap_transaction' || invoice.invoice_type == 'purchase_invoice' || invoice.invoice_type == 'credit_note' %]
[% P.checkbox_tag("book_fx_bank_fees_" _ bt_id _ "_" _ invoice.id, value=1, checked="1") %] [% LxERP.t8("Bank Fee Booking") %]
[% END %]
[% END %]
[% P.link_tag("#", "x", onclick="kivi.BankTransaction.delete_invoice(" _ bt_id _ "," _ invoice.id _ ")") %]