From 1adbf90d8c51c44035b48d23f55ab8109eb43deb Mon Sep 17 00:00:00 2001 From: khushi8112 Date: Tue, 9 Sep 2025 18:58:45 +0530 Subject: [PATCH] fix: css changes in letterhead --- .../sales_invoice_print_format.html | 4 ++-- erpnext/fixtures/letter_head.json | 8 ++++---- erpnext/hooks.py | 8 +++++++- 3 files changed, 13 insertions(+), 7 deletions(-) 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 65bfd93c2be..6a9b5f24564 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 @@ -148,12 +148,12 @@ print_heading_template=None) -%} {% if letter_head and not no_letterhead %} font-style: normal; font-weight: 420; line-height: 21px; - padding: 12px; + padding: 5px; letter-spacing: 0.14px; } - +
{{ _("Customer Name") }}: {{doc.customer_name }} diff --git a/erpnext/fixtures/letter_head.json b/erpnext/fixtures/letter_head.json index 4b9e7d9cc46..b956a8c64e3 100644 --- a/erpnext/fixtures/letter_head.json +++ b/erpnext/fixtures/letter_head.json @@ -1,7 +1,7 @@ [ { "align": "Left", - "content": "\n\n
\n
\n
\n {% if frappe.db.get_value(\"Company\", doc.company, \"logo_for_printing\") %}\n \n {% endif %}\n
\n
\n
{{ doc.company }}
\n {% set company_address = frappe.get_all(\n \"Dynamic Link\",\n fields=[\"parent\"],\n filters={\n \"link_doctype\": \"Company\",\n \"link_name\": doc.company,\n \"parenttype\": \"Address\"\n },\n limit=1\n ) %}\n \n {% if company_address %}\n {% set address = frappe.get_doc(\"Address\", company_address[0].parent) %}\n {{ address.address_line1 or \"\" }}
\n {% if address.address_line2 %}{{ address.address_line2 }}
{% endif %}\n {{ address.city or \"\" }} {{ address.state or \"\" }} {{ address.pincode or \"\" }} {{ address.country or \"\" }}
\n {% endif %}\n
\n
\n\n
\n {% set website = frappe.db.get_value(\"Company\", doc.company, \"website\") %}\n {% set email = frappe.db.get_value(\"Company\", doc.company, \"email\") %}\n {% set phone_no = frappe.db.get_value(\"Company\", doc.company, \"phone_no\") %}\n {% set pan = frappe.db.get_value(\"Company\", doc.company, \"pan\") %}\n\n {% if website %}\n
\n
{{ _(\"Website:\") }}
\n
{{ website }}

\n
\n {% endif %}\n {% if email %}\n
\n
{{ _(\"Email:\") }}
\n
{{ email }}

\n
\n {% endif %}\n {% if phone_no %}\n
\n
{{ _(\"Contact:\") }}
\n
{{ phone_no }}

\n
\n {% endif %}\n {% if pan %}\n
\n
{{ _(\"PAN:\") }}
\n
{{ pan }}

\n
\n {% endif %}\n
\n
\n", + "content": "\n\n
\n
\n
\n {% if frappe.db.get_value(\"Company\", doc.company, \"company_logo\") %}\n \n {% endif %}\n
\n
\n
{{ doc.company }}
\n {% set company_address = frappe.get_all(\n \"Dynamic Link\",\n fields=[\"parent\"],\n filters={\n \"link_doctype\": \"Company\",\n \"link_name\": doc.company,\n \"parenttype\": \"Address\"\n },\n limit=1\n ) %}\n \n {% if company_address %}\n {% set address = frappe.get_doc(\"Address\", company_address[0].parent) %}\n {{ address.address_line1 or \"\" }}
\n {% if address.address_line2 %}{{ address.address_line2 }}
{% endif %}\n {{ address.city or \"\" }} {{ address.state or \"\" }} {{ address.pincode or \"\" }} {{ address.country or \"\" }}
\n {% endif %}\n
\n
\n\n
\n {% set website = frappe.db.get_value(\"Company\", doc.company, \"website\") %}\n {% set email = frappe.db.get_value(\"Company\", doc.company, \"email\") %}\n {% set phone_no = frappe.db.get_value(\"Company\", doc.company, \"phone_no\") %}\n {% set pan = frappe.db.get_value(\"Company\", doc.company, \"pan\") %}\n\n {% if website %}\n
\n
{{ _(\"Website:\") }}
\n
{{ website }}

\n
\n {% endif %}\n {% if email %}\n
\n
{{ _(\"Email:\") }}
\n
{{ email }}

\n
\n {% endif %}\n {% if phone_no %}\n
\n
{{ _(\"Contact:\") }}
\n
{{ phone_no }}

\n
\n {% endif %}\n {% if pan %}\n
\n
{{ _(\"PAN:\") }}
\n
{{ pan }}

\n
\n {% endif %}\n
\n
\n", "disabled": 0, "docstatus": 0, "doctype": "Letter Head", @@ -18,13 +18,13 @@ "image_width": 0.0, "is_default": 0, "letter_head_name": "Sales Invoice Letter Head", - "modified": "2025-09-09 14:31:07.209406", + "modified": "2025-09-09 18:25:09.704061", "name": "Sales Invoice Letter Head", "source": "HTML" }, { "align": "Left", - "content": "\n\n
\n
\n
\n {% if frappe.db.get_value(\"Company\", doc.company, \"logo_for_printing\") %}\n \n {% endif %}\n
\n
\n
\n {{ _(\"Sales Invoice\") }}\n
\n
\n {{ doc.name }}\n
\n
\n
\n
\n
\n
{{ doc.company }}
\n {% set company_address = frappe.get_all(\n \"Dynamic Link\",\n fields=[\"parent\"],\n filters={\n \"link_doctype\": \"Company\",\n \"link_name\": doc.company,\n \"parenttype\": \"Address\"\n },\n limit=1\n ) %}\n \n {% if company_address %}\n {% set address = frappe.get_doc(\"Address\", company_address[0].parent) %}\n {{ address.address_line1 or \"\" }}
\n {% if address.address_line2 %}{{ address.address_line2 }}
{% endif %}\n {{ address.city or \"\" }} {{ address.state or \"\" }} {{ address.pincode or \"\" }} {{ address.country or \"\" }}
\n {% endif %}\n
\n\n
\n {% set website = frappe.db.get_value(\"Company\", doc.company, \"website\") %}\n {% set email = frappe.db.get_value(\"Company\", doc.company, \"email\") %}\n {% set phone_no = frappe.db.get_value(\"Company\", doc.company, \"phone_no\") %}\n {% set pan = frappe.db.get_value(\"Company\", doc.company, \"pan\") %}\n \n {% if website %}\n
\n
{{ _(\"Website:\") }}
\n
{{ website }}

\n
\n {% endif %}\n {% if email %}\n
\n
{{ _(\"Email:\") }}
\n
{{ email }}

\n
\n {% endif %}\n {% if phone_no %}\n
\n
{{ _(\"Contact:\") }}
\n
{{ phone_no }}

\n
\n {% endif %}\n {% if pan %}\n
\n
{{ _(\"PAN:\") }}
\n
{{ pan }}

\n
\n {% endif %}\n
\n
\n
\n", + "content": "\n\n
\n
\n
\n {% if frappe.db.get_value(\"Company\", doc.company, \"company_logo\") %}\n \n {% endif %}\n
\n
\n
\n {{ _(\"Sales Invoice\") }}\n
\n
\n {{ doc.name }}\n
\n
\n
\n
\n
\n
{{ doc.company }}
\n \n {% set company_address = frappe.get_all(\n \"Dynamic Link\",\n fields=[\"parent\"],\n filters={\n \"link_doctype\": \"Company\",\n \"link_name\": doc.company,\n \"parenttype\": \"Address\"\n },\n limit=1\n ) %}\n \n {% if company_address %}\n {% set address = frappe.get_doc(\"Address\", company_address[0].parent) %}\n {{ address.address_line1 or \"\" }}
\n {% if address.address_line2 %}{{ address.address_line2 }}
{% endif %}\n {{ address.city or \"\" }} {{ address.state or \"\" }} {{ address.pincode or \"\" }} {{ address.country or \"\" }}
\n {% endif %}\n
\n
\n\n
\n {% set website = frappe.db.get_value(\"Company\", doc.company, \"website\") %}\n {% set email = frappe.db.get_value(\"Company\", doc.company, \"email\") %}\n {% set phone_no = frappe.db.get_value(\"Company\", doc.company, \"phone_no\") %}\n {% set pan = frappe.db.get_value(\"Company\", doc.company, \"pan\") %}\n \n {% if website %}\n
\n
{{ _(\"Website:\") }}
\n
{{ website }}

\n
\n {% endif %}\n {% if email %}\n
\n
{{ _(\"Email:\") }}
\n
{{ email }}

\n
\n {% endif %}\n {% if phone_no %}\n
\n
{{ _(\"Contact:\") }}
\n
{{ phone_no }}

\n
\n {% endif %}\n {% if pan %}\n
\n
{{ _(\"PAN:\") }}
\n
{{ pan }}

\n
\n {% endif %}\n
\n
\n
\n", "disabled": 0, "docstatus": 0, "doctype": "Letter Head", @@ -41,7 +41,7 @@ "image_width": 0.0, "is_default": 1, "letter_head_name": "Print Format Letter Head", - "modified": "2025-09-09 14:31:07.204974", + "modified": "2025-09-09 18:11:28.309162", "name": "Print Format Letter Head", "source": "HTML" } diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 540fd6c36c4..213efd9a0f6 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -600,7 +600,13 @@ user_privacy_documents = [ }, ] -fixtures = ["Letter Head"] +fixtures = [ + { + "dt": "Letter Head", + "filters": [["name", "in", ["Sales Invoice Letter Head", "Print Format Letter Head"]]], + } +] + # ERPNext doctypes for Global Search global_search_doctypes = {