diff --git a/erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.html b/erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.html
index 7cc20b6e912..ae0a0dbb77a 100644
--- a/erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.html
+++ b/erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.html
@@ -208,18 +208,15 @@ print_heading_template=None) -%}
+ {% set item_naming_by = frappe.db.get_single_value("Stock Settings", "item_naming_by") %}
-
-
-
-
-
-
-
- | {{ _("No") }} |
+ {{ _("No") }} |
{{ _("Item") }} |
+ {% if item_naming_by != "Item Code" %}
+ {{ _("Item Code") }} |
+ {% endif %}
{{ _("Quantity") }} |
{{ _("Rate") }} |
{{ _("Amount") }} |
@@ -239,10 +236,8 @@ print_heading_template=None) -%}
alt="{{ item.item_name }}"
style="
border-radius: 6px;
- max-height: 24px;
- min-height: 24px;
- max-width: 24px;
- min-width: 24px;
+ height: 24px;
+ width: 24px !important;
margin-right: 8px;
vertical-align: middle;
"
@@ -258,6 +253,9 @@ print_heading_template=None) -%}
+ {% if item_naming_by != "Item Code" %}
+ {{ item.item_code }} |
+ {% endif %}
{{ item.get_formatted("qty", 0) }} {{ item.uom }} |
{{ item.get_formatted("net_rate", doc) }} |
diff --git a/erpnext/accounts/print_format/sales_invoice_print_format/sales_invoice_print_format.html b/erpnext/accounts/print_format/sales_invoice_print_format/sales_invoice_print_format.html
index f5143157a95..e11d8c97d69 100644
--- a/erpnext/accounts/print_format/sales_invoice_print_format/sales_invoice_print_format.html
+++ b/erpnext/accounts/print_format/sales_invoice_print_format/sales_invoice_print_format.html
@@ -236,18 +236,15 @@ print_heading_template=None) -%}
+ {% set item_naming_by = frappe.db.get_single_value("Stock Settings", "item_naming_by") %}