How to choose a print format

How to choose a print option in ERPNext based on the company’s country?

@neha you can create one single print format and it changes depending on the company’s country

i have created 2 print format 1 for india and other for uae i want to set the indian print format when the company’s country is india and vice versa for Uae.is it possible?

@neha are you using custom print format using html ?

yes …

@neha put both of them in same print format . and depending on country show block and hide the other .
for example :

{%set country=frappe.db.get_value("Company",doc.company,"country")%}
{% if country=="India"%}
<div> this is format for india </div>
{% elif country=="UAE" %}
<div>this is format for uae</div>
{% else %}
<div>this is format for other countries</div>
{% endif %}

you will have 1 print format , and will changes depending on the country.

2 Likes

its working!Thank you