Payment Confirmation Email Alert

It will work only when part is selected on payment entry form, if its selected on onload (ie. if payment entry is being made from invoice) you need to set it on onload event like below. I have kept it default as "Payment Receipt, and changing it onload if pyment type is “Pay”

frappe.ui.form.on('Payment Entry', 'onload', function(frm){
    if(frm.doc.__islocal && frm.doc.payment_type== "Pay"){
			frm.set_value('print_heading', "Payment Advice");
		}
});