{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead, footer, print_settings=None, print_heading_template=None) -%} {% if letter_head and not no_letterhead %}
{{ letter_head }}
{% endif %} {% if print_heading_template %} {{ frappe.render_template(print_heading_template, {"doc":doc}) }} {% else %} {% endif %} {%- if doc.meta.is_submittable and doc.docstatus==2-%}

{{ _("CANCELLED") }}

{%- endif -%} {%- endmacro -%} {% for page in layout %}
{{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead, footer, print_settings) }}
{% if print_settings.repeat_header_footer %} {% endif %}
{{ doc.customer }}
{{ doc.address_display }}
{{ _("Contact: ")+doc.contact_display if doc.contact_display else '' }}
{{ _("Mobile: ")+doc.contact_mobile if doc.contact_mobile else '' }}
{{ doc.name }}
{{ frappe.utils.format_date(doc.posting_date) }}
{{ frappe.utils.format_date(doc.due_date) }}
{% for item in doc.items %} {% endfor %}
{{ _("Sr") }} {{ _("Details") }} {{ _("Qty") }} {{ _("Rate") }} {{ _("Amount") }}
{{ loop.index }} {{ item.item_code }}: {{ item.item_name }} {% if (item.description != item.item_name) %}
{{ item.description }} {% endif %}
{{ item.get_formatted("qty", 0) }} {{ item.get_formatted("uom", 0) }} {{ item.get_formatted("net_rate", doc) }} {{ item.get_formatted("net_amount", doc) }}
{{ doc.in_words }}
{{ doc.status }}
{{ _("Sub Total") }}
{{ doc.get_formatted("net_total", doc) }}
{% for d in doc.taxes %} {% if d.tax_amount %}
{{ _(d.description) }}
{{ d.get_formatted("tax_amount") }}
{% endif %} {% endfor %}
{{ _("Total") }}
{{ doc.get_formatted("grand_total", doc) }}
{{ doc.terms if doc.terms else '' }}
{% endfor %}