{% set gl = frappe.get_list(doctype="GL Entry", fields=["account", "party_type", "party", "debit", "credit", "remarks"], filters={"voucher_type": doc.doctype, "voucher_no": doc.name}) %}
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
and doc.set("select_print_heading", _("Journal Entry")) -%}{%- endif -%}
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
| Voucher No: | {{ doc.name }} |
| Date: | {{ frappe.utils.format_date(doc.creation) }} |
| Account |
Party Type |
Party |
Amount |
| Debit |
{% for entries in gl %}
{% if entries.credit == 0.0 %}
| {{ entries.account }} |
{{ entries.party_type }} |
{{ entries.party }} |
{{ entries.debit }} |
{% endif %}
{% endfor %}
| Total (debit) |
{{ gl | sum(attribute='debit') }} |
| Credit |
{% for entries in gl %}
{% if entries.debit == 0.0 %}
| {{ entries.account }} |
{{ entries.party_type }} |
{{ entries.party }} |
{{ entries.credit }} |
{% endif %}
{% endfor %}
| Total (credit) |
{{ gl | sum(attribute='credit') }} |
| Narration: {{ gl[0].remarks }} |