Hello Community, I have this custom print format. Its working well but I would like to list accumulated customer loyalty point and customer outstanding balance. When I pull the field “loyalty_points” Its printing zero. The customers have already earned some points
indent preformatted text by 4 spaces
{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead) -%}
{% if letter_head and not no_letterhead %}
<div class="letter-head">{{ letter_head }}</div>
{% endif %}
{%- if doc.meta.is_submittable and doc.docstatus==0-%}
<div class="alert alert-info text-center">
<h4 style="margin: 0px;">{{ _("PROFORMA") }}</h4></div>
{%- endif -%}
{%- if doc.meta.is_submittable and doc.docstatus==2-%}
<div class="alert alert-danger text-center">
<h4 style="margin: 0px;">{{ _("CANCELLED") }}</h4></div>
{%- endif -%}
{% if max_pages > 1 %}
<p class="text-right">{{ _("Page #{0} of {1}").format(page_num, max_pages) }}</p>
{% endif %}
{%- endmacro -%}
{{ add_header(0,1,doc,letter_head, no_letterhead) }}
Customer Details | Invoice#: {{doc.name}} Details | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ doc.customer }} {{ doc.address_display or '' }} |
INVOICE #: {{doc.name}} {% set u = frappe.get_doc("User", frappe.user) %} INVOICE DATE: {{ doc.get_formatted("posting_date") or '' }} DUE DATE: {{ doc.get_formatted("due_date") or '' }} PREPARED BY :{{ u.first_name }} {{ u.last_name }} {{frappe.session.user}}
{%- for row in doc.items -%}
{%- endfor -%}
{{ row.sales_person }}
|