ERPNext, How to include Company details to Letter Head?

This is the HTML code, how can I set the company name and address inside the letter head HTML. Is it get the value from doctype?

@anon67314007 You have to create logo with company details or you can add static company details using html

Hi @anon67314007,

If you want to add the address with dynamically way then please check it.

{% set links = frappe.get_all('Dynamic Link', filters={'link_doctype': 'Company', 'link_name': doc.company, 'parenttype': 'Address'}, fields=['parent']) %}
{% if links %}
    {% set address = frappe.db.get_value('Address', links[0].parent, ['address_line1', 'address_line2', 'city', 'state', 'pincode', 'country', 'email_id', 'phone'], as_dict=True) %}
    {{ address.address_line1 }}<br>
    {% if address.address_line2 %}{{ address.address_line2 }}<br>{% endif %}
    {{ address.city }}<br>
    {{ address.state }} - {{ address.pincode }}<br>
    {{ address.country }}<br>
    {% if address.email_id %}Email: {{ address.email_id }}<br>{% endif %}
    {% if address.phone %}Phone: {{ address.phone }}{% endif %}
{% endif %}


I hope this helps!
1 Like