{%- from "templates/print_formats/standard_macros.html" import print_value -%} {%- set std_fields = ("item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom", "uom") -%} {%- set visible_columns = get_visible_columns(doc.get(df.fieldname), table_meta) -%} {%- set hide_rate = data[0].meta.is_print_hide("rate") if data|length else False-%} {%- set hide_amount = data[0].meta.is_print_hide("amount") if data|length else False-%} {% if data|length -%} {% if not hide_rate -%} {%- endif %} {% if not hide_amount -%} {%- endif %} {%- endif %} {%- for row in data -%} {% if not hide_rate -%}{%- endif %} {% if not hide_amount -%}{%- endif %} {%- endfor -%}
{{ _("Sr") }} {{ _("Item") }} {{ _(data[0].meta.get_label("qty")) }}{{ _(data[0].meta.get_label("rate")) }}{{ _(data[0].meta.get_label("amount")) }}
{{ row.idx }} {% if not row.meta.is_print_hide("item_code") -%}
{{ row.item_code }}
{%- endif %} {% if (not row.meta.is_print_hide("item_name") and (row.meta.is_print_hide("item_code") or row.item_code != row.item_name)) -%}
{{ row.get_formatted("item_name") }}
{%- endif %} {% if (not row.meta.is_print_hide("description") and row.description and ((row.meta.is_print_hide("item_code") and row.meta.is_print_hide("item_name")) or not (row.item_code == row.item_name == row.description))) -%}

{{ row.get_formatted("description") }}

{%- endif %} {%- for field in visible_columns -%} {%- if (field.fieldname not in std_fields) and (row[field.fieldname] not in (None, "", 0)) -%}
{{ _(field.label) }}: {{ row.get_formatted(field.fieldname, doc) }}
{%- endif -%} {%- endfor -%}
{{ row.get_formatted("qty", doc) }}
{{ row.uom or row.stock_uom }}
{{ row.get_formatted("rate", doc) }}{{ row.get_formatted("amount", doc) }}