{% if letter_head %}
{{ letter_head.content }}

{% endif %}

{{ _("STATEMENTS OF ACCOUNTS") }}

{{ _("Customer: ") }} {{filters.party[0] }}
{{ _("Date: ") }} {{ frappe.format(filters.from_date, 'Date')}} {{ _("to") }} {{ frappe.format(filters.to_date, 'Date')}}

{% for row in data %} {% if(row.posting_date) %} {% else %} {% endif %} {% endfor %}
{{ _("Date") }} {{ _("Reference") }} {{ _("Remarks") }} {{ _("Debit") }} {{ _("Credit") }} {{ _("Balance (Dr - Cr)") }}
{{ frappe.format(row.posting_date, 'Date') }} {{ row.voucher_type }}
{{ row.voucher_no }}
{% if not (filters.party or filters.account) %} {{ row.party or row.account }}
{% endif %} {{ _("Against") }}: {{ row.against }}
{{ _("Remarks") }}: {{ row.remarks }} {% if row.bill_no %}
{{ _("Supplier Invoice No") }}: {{ row.bill_no }} {% endif %}
{{ frappe.utils.fmt_money(row.debit, currency=filters.presentation_currency) }} {{ frappe.utils.fmt_money(row.credit, currency=filters.presentation_currency) }} {{ frappe.format(row.account, {fieldtype: "Link"}) or " " }} {{ row.get('account', '') and frappe.utils.fmt_money(row.debit, currency=filters.presentation_currency) }} {{ row.get('account', '') and frappe.utils.fmt_money(row.credit, currency=filters.presentation_currency) }} {{ frappe.utils.fmt_money(row.balance, currency=filters.presentation_currency) }}

{% if ageing %}

{{ _("Ageing Report based on ") }} {{ ageing.ageing_based_on }} {{ _("up to " ) }} {{ frappe.format(filters.to_date, 'Date')}}

30 Days 60 Days 90 Days 120 Days
{{ frappe.utils.fmt_money(ageing.range1, currency=filters.presentation_currency) }} {{ frappe.utils.fmt_money(ageing.range2, currency=filters.presentation_currency) }} {{ frappe.utils.fmt_money(ageing.range3, currency=filters.presentation_currency) }} {{ frappe.utils.fmt_money(ageing.range4, currency=filters.presentation_currency) }}
{% endif %} {% if terms_and_conditions %}
{{ terms_and_conditions }}
{% endif %}