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

[% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %] [% title %]

[% INCLUDE 'common/flash.html' %]
[% L.hidden_tag('zugferd_session_file', zugferd_session_file) %] [% P.hidden_tag('convert_from_oe_id', convert_from_oe_id) %] [% IF !id %] [% L.hidden_tag('form_validity_token', form_validity_token) %] [% END %] [% L.hidden_tag('email_journal_id', email_journal_id) %] [% L.hidden_tag('email_attachment_id', email_attachment_id) %] [% L.hidden_tag('workflow_email_journal_id', workflow_email_journal_id) %] [% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %] [% L.hidden_tag('workflow_email_callback', workflow_email_callback) %] [% FOREACH i IN [1..paidaccounts] %] [% temp = "acc_trans_id_"_ i %] [% temp = "gldate_"_ i %] [% END %] [% IF ( saved_message ) %]

[% saved_message | html %]

[% END %]
[% IF id AND INSTANCE_CONF.get_doc_storage %]
[% END %]
[% IF email_attachment_id || workflow_email_attachment_id%]
[% BLOCK panel_1; P.email_journal.attachment_preview( email_attachment_id || workflow_email_attachment_id, style="height:600px" ); END; INCLUDE 'common/toggle_panel.html' block_name='panel_1' button_closed = LxERP.t8('Show Attachment') button_open = LxERP.t8('Hide Attachment') ; %]
[% END %]
[% IF invoice_obj.sepa_exports.as_list.size %] [% END %] [% IF ( defaultcurrency && (currency != defaultcurrency) ) %] [% END %] [% IF ALL_DEPARTMENTS %] [% END %]
[% 'Vendor & Order' | $T8 %]
[% 'Vendor' | $T8 %] [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", show_details="1") %] [% L.hidden_tag("previous_vendor_id", vendor_id) %]
[% LxERP.t8("Credit Limit") %] [% creditlimit | html %], [% LxERP.t8("Remaining") %] [% creditremaining | html %]
[% LxERP.t8("SEPA exports") %] [% FOREACH export = invoice_obj.sepa_exports.as_list %] [% HTML.escape(export.id) %] [% UNLESS loop.last %], [% END %] [% END %]
[% 'Currency' | $T8 %] [%- IF readonly %] [% HTML.escape(currency) %] [% L.hidden_tag("currency", currency) %] [%- ELSE %] [% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name", class="wi-lightwide") %] [%- END %]
[% 'Exchangerate' | $T8 %] [%- IF readonly %] [% LxERP.format_amount(exchangerate, 5) %] [% L.hidden_tag("exchangerate", LxERP.format_amount(exchangerate, 5)) %] [%- ELSE %] [% L.input_tag("exchangerate", LxERP.format_amount(exchangerate), class="wi-lightwide") %] [%- END %] [% IF record_forex %][% 'record exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %] [% L.hidden_tag("record_forex", record_forex) %]
[% 'Department' | $T8 %] [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, class='wi-lightwide') %]
[% 'Transaction description' | $T8 %] [% L.input_tag("transaction_description", transaction_description, class="wi-lightwide", "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]
[% L.checkbox_tag('taxincluded', checked=taxincluded, label=LxERP.t8('Tax Included')) %]
[% L.checkbox_tag('direct_debit', checked=direct_debit, label=LxERP.t8('direct debit')) %]
[% 'Notes' | $T8 %]
[% L.textarea_tag("notes", HTML.escape(notes), rows=textarea_rows, readonly=readonly, class="wi-wide") %]
[% 'Internal Notes' | $T8 %] [% L.textarea_tag("intnotes", HTML.escape(intnotes), rows=textarea_rows, readonly=readonly, class="wi-wide") %]
[% 'Payment Terms' | $T8 %] [% L.select_tag('payment_id', payment_terms, default=payment_id, title_key='description', with_empty=1, class="wi-wide", onchange="kivi.SalesPurchase.set_duedate_on_reference_date_change('transdate')") %]
[% 'Numbers & Dates' | $T8 %]
[% 'Invoice Number' | $T8 %] [% L.input_tag("invnumber", invnumber, size="11", readonly=readonly) %]
[% 'Order Number' | $T8 %] [% L.input_tag("ordnumber", ordnumber, size="11", readonly=readonly) %]
[% 'Invoice Date' | $T8 %] [% L.date_tag('transdate', transdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("transdate")') %]
[% 'Due Date' | $T8 %] [% L.date_tag('duedate', duedate) %]
[% 'Tax point' | $T8 %] [% L.date_tag('tax_point', tax_point, id='tax_point') %]
[% 'Delivery Date' | $T8 %] [% L.date_tag('deliverydate', deliverydate) %]
[% 'Project Number' | $T8 %] [% P.project.picker('globalproject_id', globalproject_id, onchange="document.getElementById('update_button').click();") %]
[% FOREACH i IN [1..rowcount] %] [% END %]
[% 'Transactions' | $T8 %]
[% 'Account' | $T8 %] [% 'Amount' | $T8 %] [% 'Tax' | $T8 %] [% 'Taxkey' | $T8 %] [% 'Project' | $T8 %]
[% SET selected_chart_id = "AP_amount_chart_id_"_ i %] [% P.chart.picker("AP_amount_chart_id_" _ i, $selected_chart_id, type="AP_amount", invalid=0, disabled=readonly, class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %] [% L.hidden_tag("previous_AP_amount_chart_id_" _ i, $selected_chart_id) %] [% temp_r = "tax_reverse_"_ i %] [% IF ($temp_r) %] [% $temp_r | html %]     [% temp_c = "tax_charge_"_ i %][% $temp_c | html %] [% ELSE %] [% temp = "tax_"_ i %][% $temp | html %] [% END %] [% temp = 'selected_taxchart_'_ i %] [% taxcharts = 'taxcharts_' _ i %] [% L.select_tag('taxchart_'_ i, $taxcharts, value_title_sub = \taxchart_value_title_sub, default = $temp, class='wi-lightwide') %] [% temp = "project_id_"_ i %] [% P.project.picker(temp, loop.last ? globalproject_id : $temp) %]
[% P.chart.picker('AP_chart_id', AP_chart_id, type="AP", class="wi-wider") %] [% invtotal | html %]
[% UNLESS no_payment_bookings %] [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %] [% END %] [% FOREACH i IN [1..paidaccounts] %] [% temp = "paidaccount_changeable_"_ i %] [% changeable = $temp %] [% temp = "datepaid_"_ i %] [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %] [% END %] [% END %] [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %] [% END %] [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %] [% END %]
[% 'Payments' | $T8 %]
[% 'Date' | $T8 %] [% 'Source' | $T8 %] [% 'Memo' | $T8 %] [% 'Amount' | $T8 %] [% 'Exch' | $T8 %][% 'Account' | $T8 %] [% 'Project Number' | $T8 %]
[% IF( changeable ) %] [% L.date_tag(temp, $temp ? $temp : today) %] [% ELSE %] [% $temp | html %] [% END %] [% temp = "source_"_ i %] [% IF( changeable ) %] [% ELSE %] [% $temp | html %] [% END %] [% temp = "memo_"_ i %] [% IF( changeable ) %] [% ELSE %] [% $temp | html %] [% END %] [% temp = "paid_"_ i %] [% IF( changeable ) %] [% ELSE %] [% $temp | html %] [% defaultcurrency %] [% END %] [% IF changeable && loop.last && paid_missing > 0 %] [% END %] [% temp = "exchangerate_"_ i %] [% temp_forex = "forex_"_ i %] [% SET defaultcurrency_paid = 'defaultcurrency_paid_' _ i %] [% SET record_forex = 'record_forex_' _ i %] [% IF( $temp_forex || !changeable ) %] [% $temp | html %] = [% LxERP.format_amount($defaultcurrency_paid,2) %] [% defaultcurrency %]
[% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %] [% ELSE %] [% END %]
[% temp = "AP_paid_"_ i %] [% readonly = "AP_paid_readonly_desc_"_ i %] [% IF( changeable ) %] [% L.select_tag(temp, ALL_CHARTS_AP_paid, value_title_sub = \AP_paid_value_title_sub, default = ($temp || accno_arap)) %] [% ELSE %] [% $readonly | html %] [% END %] [% temp = "paid_project_id_"_ i %] [% IF( changeable ) %] [% P.project.picker(temp, $temp) %] [% ELSE %] [% temp = "label"_ temp %] [% $temp | html %] [% END %]
[% 'Total' | $T8 %] [% LxERP.format_amount(totalpaid, 2) | html %] [% currency %] [% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]
[% 'Missing amount' | $T8 %] [% LxERP.format_amount(paid_missing, 2) | html %] [% currency %]
[% END %]
[% PROCESS 'webdav/_list.html' %]
[% LxERP.t8('Loading...') %]