Different letterheads for different Doctype PDF Print

Hi,

How do I assign different letter heads to different doctype/print format so that the PDF print of the doctype can have the correct letterhead. A company could have multiple locations/warehouses and based on that there could be a need to have different letterheads in the prints.

Thanks,
Palash

In most of the sales/purchase related doctypes, you’ll have a printing settings section where you can select the Letter Head manually.

In the same way, if the field is not present, just create a new link field for Letter Head. This selection will correspond to the one being shown in the print preview.

hey thanks for replying, but this is manual and can only be done when I am creating the document. Can I have it dynamic while printing for older documents also ?

Thanks,
Palash

What do you mean by dynamic?

As for older documents, you should be able to add a custom field with ‘Allow on Update’ checked.

As for updating the letter head values in old documents, should be possible with a script.

Hey @palashjhabak Have you tried custom script like this

frappe.ui.form.on('Purchase Order', {
	refresh(frm) {
           if(frm.doc.set_warehouse == "Warehouse Name"){
		frm.set_value("letter_head","Letterhead Name of the warehouse");
	}
});

Search for Custom Script and set it once for each doctype you want to print on different letterhead. Find the common factor used per doctype like above I used Cost Center which is defined on every

1 Like