diff --git a/erpnext/regional/italy/e-invoice.xml b/erpnext/regional/italy/e-invoice.xml
index c789808fab..912b7899d6 100644
--- a/erpnext/regional/italy/e-invoice.xml
+++ b/erpnext/regional/italy/e-invoice.xml
@@ -95,13 +95,13 @@
{{ doc.customer_data.last_name }}
{%- else %}
- {%- if doc.customer_data.fiscal_code %}
- {{ doc.customer_data.fiscal_code }}
- {%- endif %}
{{ doc.customer_address_data.country_code }}
{{ doc.tax_id | replace("IT","") }}
+ {%- if doc.customer_data.fiscal_code %}
+ {{ doc.customer_data.fiscal_code }}
+ {%- endif %}
{{ doc.customer_name }}