{%- from "templates/print_formats/standard_macros.html" import add_header -%}
{% 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) }}
{% for entries in gl %} {% if entries.credit == 0.0 %} {% endif %} {% endfor %} {% for entries in gl %} {% if entries.debit == 0.0 %} {% endif %} {% endfor %}
Account Party Type Party Amount
Debit
{{ entries.account }} {{ entries.party_type }} {{ entries.party }} {{ entries.debit }}
Total (debit) {{ gl | sum(attribute='debit') }}
Credit
{{ entries.account }} {{ entries.party_type }} {{ entries.party }} {{ entries.credit }}
Total (credit) {{ gl | sum(attribute='credit') }}
Narration: {{ gl[0].remarks }}