[%- USE HTML %] [%- USE L %] [%- USE T8 %] [%- USE LxERP %][%- USE P -%]

[% title | html %]

[%- INCLUDE 'common/flash.html' %]
[% L.hidden_tag('id', id) %] [% L.hidden_tag('sort', sort) %] [% L.hidden_tag('closedto', closedto) %] [% L.hidden_tag('locked', locked) %] [% L.hidden_tag('title', title_str) %] [% L.hidden_tag('follow_up_trans_id_1', id) %] [% L.hidden_tag('follow_up_trans_type_1', 'ar_transaction') %] [% L.hidden_tag('follow_up_trans_info_1', follow_up_trans_info) %] [% L.hidden_tag('follow_up_rowcount', 1) %] [%- IF saved_message %]

[% saved_message | html %]

[% END %]
[% L.hidden_tag('rowcount', rowcount) %]
[%- IF max_dunning_level || invoice_obj.dunning_config_id %] [%- END %] [%- IF invoice_obj.sepa_exports.as_list.size %] [%- END %] [% L.hidden_tag('defaultcurrency', defaultcurrency) %] [% L.hidden_tag('fxgain_accno', fxgain_accno) %] [% L.hidden_tag('fxloss_accno', fxloss_accno) %] [% L.hidden_tag('forex', forex) %] [% IF show_exch %] [% END %] [% IF ALL_DEPARTMENTS %] [% END %]
[% 'Customer' | $T8 %] [% P.customer_vendor.picker("customer_id", customer_id, type="customer", style="width: 330px", class=(initial_focus == 'customer_id' ? "initial_focus" : ""), onchange="\$('#update_button').click()") %] [% L.button_tag("show_vc_details('customer')", LxERP.t8('Details (one letter abbreviation)')) %] [% L.hidden_tag("previous_customer_id", customer_id) %] [% L.hidden_tag('terms', terms) %]
[% LxERP.t8("Dunning status") %] [% IF invoice_obj.dunning_config_id %] [% LxERP.t8("This invoice's dunning level: #1", invoice_obj.dunning_config.dunning_description) %] [% IF max_dunning_level %]
[% END %] [% END %] [% IF max_dunning_level %] [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %]
[% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
[% END %]
[% LxERP.t8("Credit Limit") %] [% LxERP.format_amount(creditlimit, 0) %][% L.hidden_tag('creditlimit', LxERP.format_amount(creditlimit, 0)) %]; [% LxERP.t8("Remaining") %] [% LxERP.format_amount(creditremaining, 0) %][% L.hidden_tag('creditremaining', LxERP.format_amount(creditremaining, 0)) %]
[% LxERP.t8("SEPA exports") %] [% FOREACH export = invoice_obj.sepa_exports.as_list %] [% HTML.escape(export.id) %] [% UNLESS loop.last %], [% END %] [% END %]
[% 'Currency' | $T8 %] [% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %][% 'Exchangerate' | $T8 %] [%- IF forex %][% L.hidden_tag('exchangerate', LxERP.format_amount(exchangerate, 5, 1)) %][% LxERP.format_amount(exchangerate, 5, 1) %][%- ELSE %][% L.input_tag('exchangerate', LxERP.format_amount(exchangerate, 5, 1), size=10) %][%- END %]
[% 'Department' | $T8 %] [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = 'width:334px') %]
[% 'Transaction description' | $T8 %] [% L.input_tag("transaction_description", transaction_description, style="width:330px", "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]
[% L.checkbox_tag('taxincluded', checked=taxincluded) %]
[% L.checkbox_tag('direct_debit', checked=direct_debit) %]
[% 'Salesperson' | $T8 %] [% P.select_tag("employee_id", employees, default=employee_id, title_key='safe_name') %]
[% 'Invoice Number' | $T8 %]
[% 'Order Number' | $T8 %]
[% 'Invoice Date' | $T8 %] [% L.date_tag('transdate', transdate) %]
[% 'Due Date' | $T8 %] [% L.date_tag('duedate', duedate) %]
[% LxERP.t8('Tax point') %] [% L.date_tag('tax_point', tax_point, id='tax_point') %]
[% 'Delivery Date' | $T8 %] [% L.date_tag('deliverydate', deliverydate) %]
[% 'Project Number' | $T8 %] [% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = 1, onChange = "document.getElementById('update_button').click();") %]
[%- FOREACH row IN transactions %] [%- END %]
[% 'Account' | $T8 %] [% 'Amount' | $T8 %] [% 'Tax' | $T8 %] [% 'Taxkey' | $T8 %] [% 'Project' | $T8 %]
[% row.selectAR_amount %] [% L.input_tag('amount_' _ loop.count, LxERP.format_amount(row.amount, 2)) %] [% L.hidden_tag('tax_' _ loop.count, LxERP.format_tax(row.tax, 2)) %][% LxERP.format_amount(row.tax, 2) | html %] [% row.taxchart %] [% L.select_tag('project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.project_id, with_empty = 1) %]

[% P.chart.picker("AR_chart_id", AR_chart_id, style="width: 400px", type="AR") %] [% LxERP.format_amount(invtotal, 2) | html %]
[% 'Notes' | $T8 %] [% 'Notes for customer' | $T8 %]
[%- IF show_exch %] [%- END %] [%- FOREACH row IN payments %] [%- IF show_exch %] [%- END %] [%- END %]
[% 'Incoming Payments' | $T8 %]
[% 'Date' | $T8 %] [% 'Source' | $T8 %] [% 'Memo' | $T8 %] [% 'Amount' | $T8 %] [% 'Exch' | $T8 %][% 'Account' | $T8 %] [% 'Project Number' | $T8 %]
[%- IF row.changeable %] [% L.date_tag('datepaid_' _ loop.count, row.datepaid ? row.datepaid : today) %] [%- ELSE %] [% row.datepaid | html %][% L.hidden_tag('datepaid_' _ loop.count, row.datepaid) %] [%- END %] [%- IF row.changeable %] [%- ELSE %] [% row.source | html %] [%- END %] [%- IF row.changeable %] [%- ELSE %] [% row.memo | html %] [%- END %] [%- IF row.changeable %] [%- ELSE %] [% row.paid | html %] [%- END %] [% IF row.changeable && loop.last && paid_missing > 0 %] [% END %] [%- IF row.forex || !row.changeable%] [%- LxERP.format_amount(row.exchangerate, 5, 1) -%] [%- ELSE %] [%- END %] [%- IF row.changeable %] [% row.selectAR_paid %] [%- ELSE %] [% row.AR_paid | html %] [%- END %] [%- IF row.changeable %] [% L.select_tag('paid_project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.paid_project_id, with_empty=1) %] [%- ELSE %] [% project_labels.${row.paid_project_id} | html %] [%- END %]
[% 'Total' | $T8 %] [% LxERP.format_amount(totalpaid, 2) | html %]
[% 'Missing amount' | $T8 %] [% LxERP.format_amount(paid_missing, 2) | html %]