From c77669f3d185585d14b4e2bd2c9a390ba0184689 Mon Sep 17 00:00:00 2001 From: ShashaQin Date: Tue, 9 Feb 2016 16:46:41 +0800 Subject: [PATCH] Update item_table_description.html --- .../includes/item_table_description.html | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/erpnext/templates/print_formats/includes/item_table_description.html b/erpnext/templates/print_formats/includes/item_table_description.html index 116523ca044..e7fcb65aa9c 100644 --- a/erpnext/templates/print_formats/includes/item_table_description.html +++ b/erpnext/templates/print_formats/includes/item_table_description.html @@ -1,11 +1,15 @@ +{%- set std_fields = ("item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom", "uom") -%} +{%- set customised_print_preview = frappe.utils.cint(frappe.db.get_value("Features Setup", None, "customised_print_preview")) -%} + {% if doc.in_format_data("image") and doc.get("image") and not doc.is_print_hide("image")-%}
{%- endif %}
+ {% if doc.in_format_data("item_code") and not doc.is_print_hide("item_code") -%} -
{{ doc.item_code }}
+
{{ doc.item_code }}
{%- endif %} {% if (doc.in_format_data("item_name") and not doc.is_print_hide("item_name") and (not doc.in_format_data("item_code") or doc.is_print_hide("item_code") @@ -21,5 +25,14 @@ )) -%}

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

- {%- endif %} + {%- endif %} + {% if (customised_print_preview == 1) -%} + {%- for field in doc.hide_in_print_layout -%} + {%- if (field not in std_fields) and + (doc.get(field) not in (None, "", 0)) -%} +
{{ doc.meta.get_label(field) }}: + {{ doc.get_formatted(field) }}
+ {%- endif -%} + {%- endfor -%} + {%- endif %}