diff --git a/erpnext/accounts/letterhead/letterhead_plain.html b/erpnext/accounts/letterhead/letterhead_plain.html new file mode 100644 index 00000000000..54845f3e401 --- /dev/null +++ b/erpnext/accounts/letterhead/letterhead_plain.html @@ -0,0 +1,122 @@ + + + + + + + + + + + + +
+
+ {% set company_logo = frappe.db.get_value("Company", doc.company, "company_logo") %} + {% if company_logo %} + Company Logo + {% endif %} +
+
+
+ {{ doc.company }} +
+ {% set company_address = frappe.get_all( + "Dynamic Link", + fields=["parent"], + filters={ + "link_doctype": "Company", + "link_name": doc.company, + "parenttype": "Address" + }, + limit=1 + ) %} + {% if company_address %} + {% set address = frappe.get_doc("Address", company_address[0].parent) %} + {{ address.address_line1 or "" }}
+ {% if address.address_line2 %} + {{ address.address_line2 }}
+ {% endif %} + {{ address.city or "" }} {{ address.state or "" }} {{ address.pincode or "" }} {{ address.country or "" }} + {% endif %} +
+ {% set website = frappe.db.get_value("Company", doc.company, "website") %} + {% set email = frappe.db.get_value("Company", doc.company, "email") %} + {% set phone_no = frappe.db.get_value("Company", doc.company, "phone_no") %} + +
+ {{ _("Invoice:") }} + {{ doc.name }} +
+ {% if website %} +
+ {{ _("Website:") }} + {{ website }} +
+ {% endif %} + {% if email %} +
+ {{ _("Email:") }} + {{ email }} +
+ {% endif %} + {% if phone_no %} +
+ {{ _("Contact:") }} + {{ phone_no }} +
+ {% endif %} +
diff --git a/erpnext/accounts/letterhead/letterhead_with_background_colour.html b/erpnext/accounts/letterhead/letterhead_with_background_colour.html new file mode 100644 index 00000000000..f9c001482f4 --- /dev/null +++ b/erpnext/accounts/letterhead/letterhead_with_background_colour.html @@ -0,0 +1,124 @@ + + + + + + + + +
+ {% set company_logo = frappe.db.get_value("Company", doc.company, "company_logo") %} + {% if company_logo %} + + {% endif %} +
{{ doc.company }}
+
+ {% set company_address = frappe.get_all( + "Dynamic Link", + fields=["parent"], + filters={ + "link_doctype": "Company", + "link_name": doc.company, + "parenttype": "Address" + }, + limit=1 + ) %} + {% if company_address %} + {% set address = frappe.get_doc("Address", company_address[0].parent) %} + {{ address.address_line1 or "" }}
+ {% if address.address_line2 %}{{ address.address_line2 }}
{% endif %} + {{ address.city or "" }} {{ address.state or "" }} {{ address.pincode or "" }} {{ address.country or "" }}
+ {% endif %} +
+
+
+
{{ _("Sales Invoice") }}
+
{{ doc.name }}
+
+
+
+ {% set website = frappe.db.get_value("Company", doc.company, "website") %} + {% set email = frappe.db.get_value("Company", doc.company, "email") %} + {% set phone_no = frappe.db.get_value("Company", doc.company, "phone_no") %} + + {% if website %} +
{{ _("Website:") }}{{ website }}
+ {% endif %} + {% if email %} +
{{ _("Email:") }}{{ email }}
+ {% endif %} + {% if phone_no %} +
{{ _("Contact:") }}{{ phone_no }}
+ {% endif %} +
+
diff --git a/erpnext/fixtures/letter_head.json b/erpnext/fixtures/letter_head.json deleted file mode 100644 index 100762fca8b..00000000000 --- a/erpnext/fixtures/letter_head.json +++ /dev/null @@ -1,48 +0,0 @@ -[ - { - "align": "Left", - "content": "\n\n\n \n \n \n\n \n\n \n \n \n
\n
\n {% set company_logo = frappe.db.get_value(\"Company\", doc.company, \"company_logo\") %}\n {% if company_logo %}\n \"Company\n {% endif %}\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 {% if company_address %}\n {% set address = frappe.get_doc(\"Address\", company_address[0].parent) %}\n {{ address.address_line1 or \"\" }}
\n {% if address.address_line2 %}\n {{ address.address_line2 }}
\n {% endif %}\n {{ address.city or \"\" }} {{ address.state or \"\" }} {{ address.pincode or \"\" }} {{ address.country or \"\" }}\n {% endif %}\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\n
\n {{ _(\"Invoice:\") }}\n {{ doc.name }}\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
\n", - "disabled": 0, - "docstatus": 0, - "doctype": "Letter Head", - "footer": null, - "footer_align": "Left", - "footer_image": null, - "footer_image_height": 0.0, - "footer_image_width": 0.0, - "footer_script": null, - "footer_source": "HTML", - "header_script": null, - "image": null, - "image_height": 0.0, - "image_width": 0.0, - "is_default": 0, - "letter_head_name": "Sales Invoice Letter Head", - "modified": "2025-09-19 14:10:13.265409", - "name": "Sales Invoice Letter Head", - "source": "HTML" - }, - { - "align": "Left", - "content": "\n\n\n \n \n\n \n \n
\n {% set company_logo = frappe.db.get_value(\"Company\", doc.company, \"company_logo\") %}\n {% if company_logo %}\n
\n \n
\n {% endif %}\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 {% 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
{{ _(\"Sales Invoice\") }}
\n
{{ doc.name }}
\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 \n {% if website %}\n
{{ _(\"Website:\") }}{{ website }}
\n {% endif %}\n {% if email %}\n
{{ _(\"Email:\") }}{{ email }}
\n {% endif %}\n {% if phone_no %}\n
{{ _(\"Contact:\") }}{{ phone_no }}
\n {% endif %}\n
\n
\n", - "disabled": 0, - "docstatus": 0, - "doctype": "Letter Head", - "footer": null, - "footer_align": "Left", - "footer_image": null, - "footer_image_height": 0.0, - "footer_image_width": 0.0, - "footer_script": null, - "footer_source": "HTML", - "header_script": null, - "image": null, - "image_height": 0.0, - "image_width": 0.0, - "is_default": 0, - "letter_head_name": "Print Format Letter Head", - "modified": "2025-09-19 13:59:22.029272", - "name": "Print Format Letter Head", - "source": "HTML" - } -] \ No newline at end of file diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 213efd9a0f6..234dcc6eac1 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -600,13 +600,6 @@ user_privacy_documents = [ }, ] -fixtures = [ - { - "dt": "Letter Head", - "filters": [["name", "in", ["Sales Invoice Letter Head", "Print Format Letter Head"]]], - } -] - # ERPNext doctypes for Global Search global_search_doctypes = {