{%= __(report.report_name) %}

{% if (filters.customer_name) { %} {%= filters.customer_name %} {% } else { %} {%= filters.customer || filters.supplier %} {% } %}

{% if (filters.tax_id) { %} {%= __("Tax Id: ")%} {%= filters.tax_id %} {% } %}
{%= __(filters.ageing_based_on) %} {%= __("Until") %} {%= frappe.datetime.str_to_user(filters.report_date) %}
{% if(filters.payment_terms) { %} {%= __("Payment Terms") %}: {%= filters.payment_terms %} {% } %}
{% if(filters.credit_limit) { %} {%= __("Credit Limit") %}: {%= format_currency(filters.credit_limit) %} {% } %}
{% if(filters.show_pdc_in_print) { %} {% var balance_row = data.slice(-1).pop(); var range1 = report.columns[11].label; var range2 = report.columns[12].label; var range3 = report.columns[13].label; var range4 = report.columns[14].label; var range5 = report.columns[15].label; var range6 = report.columns[16].label; %} {% if(balance_row) { %}
(Amount in {%= data[0][__("currency")] || "" %})
{%= __(" ") %} {%= __(range1) %} {%= __(range2) %} {%= __(range3) %} {%= __(range4) %} {%= __(range5) %} {%= __(range6) %} {%= __("Total") %}
{%= __("Total Outstanding") %} {%= format_number(balance_row[range1], null, 2) %} {%= format_currency(balance_row[range2]) %} {%= format_currency(balance_row[range3]) %} {%= format_currency(balance_row[range4]) %} {%= format_currency(balance_row[range5]) %} {%= format_currency(balance_row[range6]) %} {%= format_currency(flt(balance_row[("outstanding_amount")]), data[data.length-1]["currency"]) %}
{%= __("PDC/LC") %} {%= format_currency(flt(balance_row[("pdc/lc_amount")]), data[data.length-1]["currency"]) %}
{% } %} {% } %} {% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %} {% if(report.report_name === "Accounts Receivable" && filters.show_sales_person_in_print) { %} {% } else { %} {% } %} {% if(!filters.show_pdc_in_print) { %} {% } %} {% if(!filters.show_pdc_in_print) { %} {% } %} {% if(filters.show_pdc_in_print) { %} {% if(report.report_name === "Accounts Receivable") { %} {% } %} {% } %} {% } else { %} {% } %} {% for(var i=0, l=data.length; i {% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %} {% if(data[i][__("Customer")] || data[i][__("Supplier")]) { %} {% if(report.report_name === "Accounts Receivable" && filters.show_sales_person_in_print) { %} {% } %} {% if(!filters.show_pdc_in_print) { %} {% } %} {% if(!filters.show_pdc_in_print) { %} {% } %} {% if(filters.show_pdc_in_print) { %} {% if(report.report_name === "Accounts Receivable") { %} {% } %} {% } %} {% } else { %} {% if(!filters.show_pdc_in_print) { %} {% } %} {% if(report.report_name === "Accounts Receivable" && filters.show_sales_person_in_print) { %} {% } %} {% if(!filters.show_pdc_in_print) { %} {% } %} {% if(filters.show_pdc_in_print) { %} {% if(report.report_name === "Accounts Receivable") { %} {% } %} {% } %} {% } %} {% } else { %} {% if(data[i][__("Customer")] || data[i][__("Supplier")]|| " ") { %} {% if((data[i][__("Customer")] || data[i][__("Supplier")]) != __("'Total'")) { %} {% } else { %} {% } %} {% } %} {% } %} {% } %}
{%= __("Date") %} {%= __("Age (Days)") %}{%= __("Reference") %} {%= __("Sales Person") %}{%= __("Reference") %}{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %}{%= __("Invoiced Amount") %}{%= __("Paid Amount") %} {%= report.report_name === "Accounts Receivable" ? __('Credit Note') : __('Debit Note') %}{%= __("Outstanding Amount") %}{%= __("Customer LPO No.") %}{%= __("PDC/LC Ref") %} {%= __("PDC/LC Amount") %} {%= __("Remaining Balance") %}{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %} {%= __("Total Invoiced Amount") %} {%= __("Total Paid Amount") %} {%= report.report_name === "Accounts Receivable Summary" ? __('Credit Note Amount') : __('Debit Note Amount') %} {%= __("Total Outstanding Amount") %}
{%= frappe.datetime.str_to_user(data[i]["posting_date"]) %} {%= data[i][__("Age (Days)")] %} {% if(!filters.show_pdc_in_print) { %} {%= data[i]["voucher_type"] %}
{% } %} {%= data[i]["voucher_no"] %}
{%= data[i]["sales_person"] %} {% if(!(filters.customer || filters.supplier)) { %} {%= data[i][__("Customer")] || data[i][__("Supplier")] %} {% if(data[i][__("Customer Name")] && data[i][__("Customer Name")] != data[i][__("Customer")]) { %}
{%= data[i][__("Customer Name")] %} {% } else if(data[i][__("Supplier Name")] != data[i][__("Supplier")]) { %}
{%= data[i][__("Supplier Name")] %} {% } %} {% } %}
{% if data[i][__("Remarks")] %} {%= __("Remarks") %}: {%= data[i][__("Remarks")] %} {% } %}
{%= format_currency(data[i]["invoiced_amount"], data[i]["currency"]) %} {%= format_currency(data[i]["paid_amount"], data[i]["currency"]) %} {%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["credit_note"], data[i]["currency"]) : format_currency(data[i]["debit_note"], data[i]["currency"]) %} {%= format_currency(data[i]["outstanding_amount"], data[i]["currency"]) %} {%= data[i]["po_no"] %}{%= data[i][("pdc/lc_ref")] %} {%= format_currency(data[i][("pdc/lc_amount")], data[i]["currency"]) %} {%= format_currency(data[i][("remaining_balance")], data[i]["currency"]) %} {%= __("Total") %} {%= format_currency(data[i]["invoiced_amount"], data[i]["currency"] ) %} {%= format_currency(data[i]["paid_amount"], data[i]["currency"]) %} {%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["credit_note"], data[i]["currency"]) : format_currency(data[i]["debit_note"], data[i]["currency"]) %} {%= format_currency(data[i]["outstanding_amount"], data[i]["currency"]) %} {%= data[i][__("Customer LPO")] %}{%= data[i][("pdc/lc_ref")] %} {%= format_currency(data[i][("pdc/lc_amount")], data[i]["currency"]) %} {%= format_currency(data[i][("remaining_balance")], data[i]["currency"]) %} {% if(!(filters.customer || filters.supplier)) { %} {%= data[i][__("Customer")] || data[i][__("Supplier")] %} {% if(data[i][__("Customer Name")] && data[i][__("Customer Name")] != data[i][__("Customer")]) { %}
{%= data[i][__("Customer Name")] %} {% } else if(data[i][__("Supplier Name")] != data[i][__("Supplier")]) { %}
{%= data[i][__("Supplier Name")] %} {% } %} {% } %}
{%= __("Remarks") %}: {%= data[i][__("Remarks")] %}
{%= __("Total") %}{%= format_currency(data[i][("total_invoiced_amt")], data[i]["currency"]) %} {%= format_currency(data[i][("total_paid_amt")], data[i]["currency"]) %} {%= report.report_name === "Accounts Receivable Summary" ? format_currency(data[i][__("credit_note_amt")], data[i]["currency"]) : format_currency(data[i][__("debit_note_amt")], data[i]["currency"]) %} {%= format_currency(data[i][("total_outstanding_amt")], data[i]["currency"]) %}

{{ __("Printed On ") }}{%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}