Condition In Print format

Hello guys

I added a print format for sales invoices and set it as default.

Now I want to add a bottom line to the print format only for foreign customer customers

On the sales invoice, in the address and contact part get the customer’s country.

When country != “India”, I want to add the line to print format “SUPPLY MEANT FOR EXPORT UNDER BOND OR LETTER OF UNDERTAKING WITHOUT PAYMENT OF INTEGRATED TAX”

else print nothing.

Is there an option?
Please help me with this.

Use jinja in the print format.

Hi @jinsy,

If you use a custom print format built-in Jinja then apply it.

If a customer has an address and defined country then apply conditions like:

{% if frappe.db.get_value("Address",doc.customer_address,'country') != "India" %}

SUPPLY MEANT FOR EXPORT UNDER BOND OR LETTER OF UNDERTAKING WITHOUT PAYMENT OF INTEGRATED TAX

{% endif %}

Thanks.

2 Likes

Hello @NCP

Thanks…It is working :grinning: