{% macro display_balance(opening_balance, currency) %} {% if opening_balance < 0 %} {{ - opening_balance|currencyformat(currency.code) }} Cr {% elif opening_balance > 0 %} {{ opening_balance|currencyformat(currency.code) }} Dr {% else %} {{ opening_balance|currencyformat(currency.code) }} {% endif %} {% endmacro %} {% block main %}
{% block header_logo %} {% endblock %}
{% block header_title %}Account Statement{% endblock %}
{% block header_content scoped %}
Party:
{{ party.name }}
Date Range:
{{ data['start_date']|dateformat }} - {{ data['end_date']|dateformat }}
{% endblock %}

{% block table scoped %} {% set amount_format = data['amount_format'] %} {% if amount_format == 'cr/dr' %} {% elif amount_format == '+/-' %} {% endif %} {% set opening_balance = party.get_opening_balance_on(data['start_date']) %} {% if consider_maturity_date %} {% endif %} {% for line in move_lines %} {% if amount_format == 'cr/dr' %} {% elif amount_format == '+/-' %} {% endif %} {% endfor %} {% if not move_lines %} {% endif %} {% if amount_format == 'cr/dr' %} {% endif %} {% if consider_maturity_date %} {% for line in get_move_lines_maturing(party, data['start_date'], data['end_date']) %} {% if amount_format == 'cr/dr' %} {% elif amount_format == '+/-' %} {% endif %} {% else %} {% endfor %} {% endif %}
Date Maturity Date Account Origin/DescriptionDebit CreditAmountBalance
Opening Balance {{ display_balance(opening_balance, company.currency) }}
Opening Balance(Mature) {{ party.get_opening_balance_on(data['start_date'])|currencyformat(company.currency.code) }}
{{ line.date|dateformat }} {{ line.maturity_date|dateformat }} {{ line.account.rec_name }} {{ line.origin_details() or '' }} {% if line.description or line.move_description %} {% if line.origin %}
{% endif %}{{ line.description or line.move_description }} {% endif %}
{% if line.debit %} {{ line.debit|currencyformat(line.account.currency.code) }} {% endif %} {% if line.credit %} {{ line.credit|currencyformat(line.account.currency.code) }} {% endif %} {% if line.debit %} - {{ line.debit|currencyformat(line.account.currency.code) }} {% elif line.credit %} + {{ line.credit|currencyformat(line.account.currency.code) }} {% endif %} {% set opening_balance = opening_balance + line.debit - line.credit %} {% if opening_balance %} {{ display_balance(opening_balance, company.currency) }} {% endif %}
{{ move_lines|sum(attribute='debit')|currencyformat(company.currency.code) }} {{ move_lines|sum(attribute='credit')|currencyformat(company.currency.code) }}
Closing Balance {% set closing_balance = party.get_balance_on(data['end_date']) %} {{ display_balance(closing_balance, company.currency) }}
Lines maturing in this period
{{ line.date|dateformat }} {{ line.maturity_date|dateformat }} {{ line.account.rec_name }} {{ line.origin_details() or '' }} {% if line.description or line.move_description %} {% if line.origin %}
{% endif %}{{ line.description or line.move_description }} {% endif %}
{% if line.debit %} {{ line.debit|currencyformat(line.account.currency.code) }} {% endif %} {% if line.credit %} {{ line.credit|currencyformat(line.account.currency.code) }} {% endif %} {% if line.debit %} - {{ line.debit|currencyformat(line.account.currency.code) }} {% elif line.credit %} + {{ line.credit|currencyformat(line.account.currency.code) }} {% endif %}
{% endblock %}
{% endblock %}