diff --git a/erpnext/accounts/letterhead/company_letterhead.html b/erpnext/accounts/letterhead/company_letterhead.html index f4b8db863f6..7cdf58cb6e0 100644 --- a/erpnext/accounts/letterhead/company_letterhead.html +++ b/erpnext/accounts/letterhead/company_letterhead.html @@ -1,108 +1,108 @@
|
-
- {% set company_logo = frappe.db.get_value("Company", doc.company, "company_logo") %}
- {% if company_logo %}
-
- |
+ ||||
|
+
+ {% set company_logo = frappe.db.get_value("Company", doc.company, "company_logo") %} {% if
+ company_logo %}
+
+ |
-
-
- {{ doc.company }}
-
- {% if doc.company_address %}
- {% set company_address = frappe.db.get_value("Address", doc.company_address, ["address_line1", "address_line2", "city", "state", "pincode", "country"], as_dict=True) %}
+ |
+ {{ doc.company }}
+ {% if doc.company_address %} {% set company_address = frappe.db.get_value("Address",
+ doc.company_address, ["address_line1", "address_line2", "city", "state", "pincode",
+ "country"], as_dict=True) %} {% elif doc.billing_address %} {% set company_address =
+ frappe.db.get_value("Address", doc.billing_address, ["address_line1", "address_line2", "city",
+ "state", "pincode", "country"], as_dict=True) %} {% endif %} {% if company_address %} {{
+ company_address.address_line1 or "" }}+ {% if company_address.address_line2 %} {{ company_address.address_line2 }} + {% endif %} {{ company_address.city or "" }}, {{ company_address.state or "" }} {{ + company_address.pincode or "" }}, {{ company_address.country or ""}} + {% endif %} + |
- {{ company_address.get("address_line1") or "" }}+ {% 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") %} - |
- {% set company_details = frappe.db.get_value("Company", doc.company, ["website", "email", "phone_no"], as_dict=True) %}
-
-
- {{ _("Invoice:") }}
- {{ doc.name }}
-
- {% if company_details.website %}
-
- {{ _("Website:") }}
- {{ company_details.website }}
-
- {% endif %}
- {% if company_details.email %}
-
- {{ _("Email:") }}
- {{ company_details.email }}
-
- {% endif %}
- {% if company_details.phone_no %}
-
- {{ _("Contact:") }}
- {{ company_details.phone_no }}
-
- {% endif %}
- |
-
| \n\t\t\t\t\t{{ _(\"Customer Name\") }}: {{doc.customer_name }}\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t{{ _(\"Payment Due Date\") }}: {{\n\t\t\t\t\tfrappe.utils.format_date(doc.due_date) }}\n\t\t\t\t | \n\t\t\t
| {{ _(\"Invoice Number\") }}: {{ doc.name }} | \n\t\t\t\t\n\t\t\t\t\t{{ _(\"Invoice Date\") }}: {{\n\t\t\t\t\tfrappe.utils.format_date(doc.posting_date) }}\n\t\t\t\t | \n\t\t\t
| {{ _(\"Bill From\") }}: \n\t\t\t\t\t{% if doc.company_address %}\n {% set company_address = frappe.db.get_value(\"Address\", doc.company_address, [\"address_line1\", \"address_line2\", \"city\", \"state\", \"pincode\", \"country\"], as_dict=True) %}\n {{ doc.company }} \n {{ company_address.get(\"address_line1\") or \"\" }} \n {% if company_address.get(\"address_line2\") %}{{ company_address.get(\"address_line2\") }} {% endif %}\n {{ company_address.get(\"city\") or \"\" }}, {{ company_address.get(\"state\") or \"\" }} {{ company_address.get(\"pincode\") or \"\" }}, {{ company_address.get(\"country\") or \"\" }} \n {% endif %}\n\t\t\t\t | \n\t\t\t\t{{ _(\"Bill To\") }}: \n\t\t\t\t {% if doc.customer_address %}\n\t\t\t\t\t\t{% set customer_address = frappe.db.get_value(\"Address\", doc.customer_address, [\"address_line1\", \"address_line2\", \"city\", \"state\", \"pincode\", \"country\"], as_dict=True) %}\n {{ doc.customer_name }} \n\t\t\t\t\t\t{{ customer_address.address_line1 or \"\" }} \n\t\t\t\t\t\t{% if customer_address.address_line2 %}{{ customer_address.address_line2 }} {% endif %}\n\t\t\t\t\t\t{{ customer_address.city or \"\" }} {{ customer_address.state or \"\" }} {{ customer_address.pincode or \"\" }} {{ customer_address.country or \"\" }} \n\t\t\t\t\t{% endif %}\n\t\t\t\t | \n\t\t\t
| {{ _(\"No\") }} | \n\t\t\t\t\t{{ _(\"Item\") }} | \n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t{{ _(\"Item Code\") }} | \n\t\t\t\t\t{% endif %}\n\t\t\t\t\t{{ _(\"Quantity\") }} | \n\t\t\t\t\t{{ _(\"Rate\") }} | \n\t\t\t\t\t{{ _(\"Amount\") }} | \n\t\t\t\t
| {{ loop.index }} | \n\t\t\t\t\t{{ item.item_name }} | \n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t{{ item.item_code }} | \n\t\t\t\t\t{% endif %}\n\t\t\t\t\t{{ item.get_formatted(\"qty\", 0) }} {{ item.uom }} | \n\t\t\t\t\t{{ item.get_formatted(\"net_rate\", doc) }} | \n\t\t\t\t\t\n\t\t\t\t\t\t{{ item.get_formatted(\"net_amount\", doc) }}\n\t\t\t\t\t | \n\t\t\t\t
| \n\t\t\t\t {{ _(\"Total in words\") }} \n\t\t\t\t{{ doc.in_words }} \n\t\t\t | \n\t\t\t\n\t\t\t\t \n\t\t\t | \n\t\t\t\n\t\t\t\t
| \n\t\t
| \n\t\t\t\t\t{{ _(\"Customer Name\") }}: {{doc.customer_name }}\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t{{ _(\"Payment Due Date\") }}: {{\n\t\t\t\t\tfrappe.utils.format_date(doc.due_date) }}\n\t\t\t\t | \n\t\t\t
| {{ _(\"Invoice Number\") }}: {{ doc.name }} | \n\t\t\t\t\n\t\t\t\t\t{{ _(\"Invoice Date\") }}: {{\n\t\t\t\t\tfrappe.utils.format_date(doc.posting_date) }}\n\t\t\t\t | \n\t\t\t
| {{ _(\"Bill From\") }}: \n\t\t\t\t\t{% if doc.company_address %}\n {% set company_address = frappe.db.get_value(\"Address\", doc.company_address, [\"address_line1\", \"address_line2\", \"city\", \"state\", \"pincode\", \"country\"], as_dict=True) %}\n {{ doc.company }} \n {{ company_address.get(\"address_line1\") or \"\" }} \n {% if company_address.get(\"address_line2\") %}{{ company_address.get(\"address_line2\") }} {% endif %}\n {{ company_address.get(\"city\") or \"\" }}, {{ company_address.get(\"state\") or \"\" }} {{ company_address.get(\"pincode\") or \"\" }}, {{ company_address.get(\"country\") or \"\" }} \n {% endif %}\n\t\t\t\t | \n\t\t\t\t{{ _(\"Bill To\") }}: \n\t\t\t\t {% if doc.customer_address %}\n\t\t\t\t\t\t{% set customer_address = frappe.db.get_value(\"Address\", doc.customer_address, [\"address_line1\", \"address_line2\", \"city\", \"state\", \"pincode\", \"country\"], as_dict=True) %}\n {{ doc.customer_name }} \n\t\t\t\t\t\t{{ customer_address.address_line1 or \"\" }} \n\t\t\t\t\t\t{% if customer_address.address_line2 %}{{ customer_address.address_line2 }} {% endif %}\n\t\t\t\t\t\t{{ customer_address.city or \"\" }} {{ customer_address.state or \"\" }} {{ customer_address.pincode or \"\" }} {{ customer_address.country or \"\" }} \n\t\t\t\t\t{% endif %}\n\t\t\t\t | \n\t\t\t
| {{ _(\"No\") }} | \n\t\t\t\t\t{{ _(\"Item\") }} | \n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t{{ _(\"Item Code\") }} | \n\t\t\t\t\t{% endif %}\n\t\t\t\t\t{{ _(\"Quantity\") }} | \n\t\t\t\t\t{{ _(\"Rate\") }} | \n\t\t\t\t\t{{ _(\"Amount\") }} | \n\t\t\t\t
| {{ loop.index }} | \n\t\t\t\t\t{{ item.item_name }} | \n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t{{ item.item_code }} | \n\t\t\t\t\t{% endif %}\n\t\t\t\t\t{{ item.get_formatted(\"qty\", 0) }} {{ item.uom }} | \n\t\t\t\t\t{{ item.get_formatted(\"net_rate\", doc) }} | \n\t\t\t\t\t\n\t\t\t\t\t\t{{ item.get_formatted(\"net_amount\", doc) }}\n\t\t\t\t\t | \n\t\t\t\t
| \n\t\t\t\t {{ _(\"Total in words\") }} \n\t\t\t\t{{ doc.in_words }} \n\t\t\t | \n\t\t\t\n\t\t\t\t \n\t\t\t | \n\t\t\t\n\t\t\t\t
| \n\t\t
| \n\t\t\t\t\t{{ _(\"Supplier Name\") }}: {{doc.supplier_name }}\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t{{ _(\"Required By\") }}: {{\n\t\t\t\t\tfrappe.utils.format_date(doc.schedule_date) }}\n\t\t\t\t | \n\t\t\t
| {{ _(\"Order Number\") }}: {{ doc.name }} | \n\t\t\t\t\n\t\t\t\t\t{{ _(\"Order Date\") }}: {{\n\t\t\t\t\tfrappe.utils.format_date(doc.transaction_date) }}\n\t\t\t\t | \n\t\t\t
| {{ _(\"Supplier Address\") }}: \n\t\t\t\t\t{% if doc.supplier_address %}\n\t\t\t\t\t\t{% set supplier_address = frappe.db.get_value(\"Address\", doc.supplier_address, [\"address_line1\", \"address_line2\", \"city\", \"state\", \"pincode\", \"country\"], as_dict=True) %}\n {{ doc.supplier_name }} \n\t\t\t\t\t\t{{ supplier_address.address_line1 or \"\" }} \n\t\t\t\t\t\t{% if supplier_address.address_line2 %}{{ supplier_address.address_line2 }} {% endif %}\n\t\t\t\t\t\t{{ supplier_address.city or \"\" }} {{ supplier_address.state or \"\" }} {{ supplier_address.pincode or \"\" }} {{ supplier_address.country or \"\" }} \n\t\t\t\t\t{% endif %}\n\t\t\t\t | \n\t\t\t\t{{ _(\"Company Address\") }}: \n {% if doc.billing_address %}\n {% set billing_address = frappe.db.get_value(\"Address\", doc.billing_address, [\"address_line1\", \"address_line2\", \"city\", \"state\", \"pincode\", \"country\"], as_dict=True) %}\n {{ doc.company }} \n {{ billing_address.get(\"address_line1\") or \"\" }} \n {% if billing_address.get(\"address_line2\") %}{{ billing_address.get(\"address_line2\") }} {% endif %}\n {{ billing_address.get(\"city\") or \"\" }}, {{ billing_address.get(\"state\") or \"\" }} {{ billing_address.get(\"pincode\") or \"\" }}, {{ billing_address.get(\"country\") or \"\" }} \n {% endif %}\n\t\t\t\t | \n\t\t\t
| {{ _(\"No\") }} | \n\t\t\t\t\t{{ _(\"Item\") }} | \n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t{{ _(\"Item Code\") }} | \n\t\t\t\t\t{% endif %}\n\t\t\t\t\t{{ _(\"Quantity\") }} | \n\t\t\t\t\t{{ _(\"Rate\") }} | \n\t\t\t\t\t{{ _(\"Amount\") }} | \n\t\t\t\t
| {{ loop.index }} | \n\t\t\t\t\t{{ item.item_name }} | \n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t{{ item.item_code }} | \n\t\t\t\t\t{% endif %}\n\t\t\t\t\t{{ item.get_formatted(\"qty\", 0) }} {{ item.uom }} | \n\t\t\t\t\t{{ item.get_formatted(\"net_rate\", doc) }} | \n\t\t\t\t\t\n\t\t\t\t\t\t{{ item.get_formatted(\"net_amount\", doc) }}\n\t\t\t\t\t | \n\t\t\t\t
| \n\t\t\t\t {{ _(\"Total in words\") }} \n\t\t\t\t{{ doc.in_words }} \n\t\t\t | \n\t\t\t\n\t\t\t\t \n\t\t\t | \n\t\t\t\n\t\t\t\t
| \n\t\t
| \n\t\t\t\t\t{{ _(\"Customer Name\") }}: {{doc.customer_name }}\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t{{ _(\"Payment Due Date\") }}: {{\n\t\t\t\t\tfrappe.utils.format_date(doc.due_date) }}\n\t\t\t\t | \n\t\t\t
| {{ _(\"Invoice Number\") }}: {{ doc.name }} | \n\t\t\t\t\n\t\t\t\t\t{{ _(\"Invoice Date\") }}: {{\n\t\t\t\t\tfrappe.utils.format_date(doc.posting_date) }}\n\t\t\t\t | \n\t\t\t
| {{ _(\"Bill From\") }}: \n\t\t\t\t\t{% if doc.company_address %}\n {% set company_address = frappe.db.get_value(\"Address\", doc.company_address, [\"address_line1\", \"address_line2\", \"city\", \"state\", \"pincode\", \"country\"], as_dict=True) %}\n {{ doc.company }} \n {{ company_address.get(\"address_line1\") or \"\" }} \n {% if company_address.get(\"address_line2\") %}{{ company_address.get(\"address_line2\") }} {% endif %}\n {{ company_address.get(\"city\") or \"\" }}, {{ company_address.get(\"state\") or \"\" }} {{ company_address.get(\"pincode\") or \"\" }}, {{ company_address.get(\"country\") or \"\" }} \n {% endif %}\n\t\t\t\t | \n\t\t\t\t{{ _(\"Bill To\") }}: \n\t\t\t\t {% if doc.customer_address %}\n\t\t\t\t\t\t{% set customer_address = frappe.db.get_value(\"Address\", doc.customer_address, [\"address_line1\", \"address_line2\", \"city\", \"state\", \"pincode\", \"country\"], as_dict=True) %}\n {{ doc.customer_name }} \n\t\t\t\t\t\t{{ customer_address.address_line1 or \"\" }} \n\t\t\t\t\t\t{% if customer_address.address_line2 %}{{ customer_address.address_line2 }} {% endif %}\n\t\t\t\t\t\t{{ customer_address.city or \"\" }} {{ customer_address.state or \"\" }} {{ customer_address.pincode or \"\" }} {{ customer_address.country or \"\" }} \n\t\t\t\t\t{% endif %}\n\t\t\t\t | \n\t\t\t
| {{ _(\"No\") }} | \n\t\t\t\t\t{{ _(\"Item\") }} | \n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t{{ _(\"Item Code\") }} | \n\t\t\t\t\t{% endif %}\n\t\t\t\t\t{{ _(\"Quantity\") }} | \n\t\t\t\t\t{{ _(\"Rate\") }} | \n\t\t\t\t\t{{ _(\"Amount\") }} | \n\t\t\t\t
| {{ loop.index }} | \n\t\t\t\t\t{{ item.item_name }} | \n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t{{ item.item_code }} | \n\t\t\t\t\t{% endif %}\n\t\t\t\t\t{{ item.get_formatted(\"qty\", 0) }} {{ item.uom }} | \n\t\t\t\t\t{{ item.get_formatted(\"net_rate\", doc) }} | \n\t\t\t\t\t\n\t\t\t\t\t\t{{ item.get_formatted(\"net_amount\", doc) }}\n\t\t\t\t\t | \n\t\t\t\t
| \n\t\t\t\t {{ _(\"Total in words\") }} \n\t\t\t\t{{ doc.in_words }} \n\t\t\t | \n\t\t\t\n\t\t\t\t \n\t\t\t | \n\t\t\t\n\t\t\t\t
| \n\t\t
| \n\t\t\t\t\t{{ _(\"Customer Name\") }}: {{doc.customer_name }}\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t{{ _(\"Status\") }}: {{ doc.status }}\n\t\t\t\t | \n\t\t\t
| {{ _(\"Delivery Note\") }}: {{ doc.name }} | \n\t\t\t\t\n\t\t\t\t\t{{ _(\"Date\") }}: {{\n\t\t\t\t\tfrappe.utils.format_date(doc.posting_date) }}\n\t\t\t\t | \n\t\t\t
| {{ _(\"Company Address\") }}: \n\t\t\t\t\t{% if doc.company_address %}\n {% set company_address = frappe.db.get_value(\"Address\", doc.company_address, [\"address_line1\", \"address_line2\", \"city\", \"state\", \"pincode\", \"country\"], as_dict=True) %}\n {{ doc.company }} \n {{ company_address.get(\"address_line1\") or \"\" }} \n {% if company_address.get(\"address_line2\") %}{{ company_address.get(\"address_line2\") }} {% endif %}\n {{ company_address.get(\"city\") or \"\" }}, {{ company_address.get(\"state\") or \"\" }} {{ company_address.get(\"pincode\") or \"\" }}, {{ company_address.get(\"country\") or \"\" }} \n {% endif %}\n\t\t\t\t | \n\t\t\t\t{{ _(\"Customer Address\") }}: \n\t\t\t\t {% if doc.customer_address %}\n\t\t\t\t\t\t{% set customer_address = frappe.db.get_value(\"Address\", doc.customer_address, [\"address_line1\", \"address_line2\", \"city\", \"state\", \"pincode\", \"country\"], as_dict=True) %}\n {{ doc.customer_name }} \n\t\t\t\t\t\t{{ customer_address.address_line1 or \"\" }} \n\t\t\t\t\t\t{% if customer_address.address_line2 %}{{ customer_address.address_line2 }} {% endif %}\n\t\t\t\t\t\t{{ customer_address.city or \"\" }} {{ customer_address.state or \"\" }} {{ customer_address.pincode or \"\" }} {{ customer_address.country or \"\" }} \n\t\t\t\t\t{% endif %}\n\t\t\t\t | \n\t\t\t
| {{ _(\"No\") }} | \n\t\t\t\t\t{{ _(\"Item\") }} | \n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t{{ _(\"Item Code\") }} | \n\t\t\t\t\t{% endif %}\n\t\t\t\t\t{{ _(\"Quantity\") }} | \n\t\t\t\t\t{{ _(\"Rate\") }} | \n\t\t\t\t\t{{ _(\"Amount\") }} | \n\t\t\t\t
| {{ loop.index }} | \n\t\t\t\t\t{{ item.item_name }} | \n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t{{ item.item_code }} | \n\t\t\t\t\t{% endif %}\n\t\t\t\t\t{{ item.get_formatted(\"qty\", 0) }} {{ item.uom }} | \n\t\t\t\t\t{{ item.get_formatted(\"net_rate\", doc) }} | \n\t\t\t\t\t\n\t\t\t\t\t\t{{ item.get_formatted(\"net_amount\", doc) }}\n\t\t\t\t\t | \n\t\t\t\t
| \n\t\t\t\t {{ _(\"Total in words\") }} \n\t\t\t\t{{ doc.in_words }} \n\t\t\t | \n\t\t\t\n\t\t\t\t \n\t\t\t | \n\t\t\t\n\t\t\t\t
| \n\t\t