diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js index 2f0b7862a82..30abad528bf 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js @@ -245,19 +245,21 @@ frappe.ui.form.on("Request for Quotation",{ ] }); - dialog.fields_dict['supplier'].df.onchange = () => { - var supplier = dialog.get_value('supplier'); - frm.call('get_supplier_email_preview', {supplier: supplier}).then(result => { + dialog.fields_dict["supplier"].df.onchange = () => { + frm.call("get_supplier_email_preview", { + supplier: dialog.get_value("supplier"), + }).then(({ message }) => { dialog.fields_dict.email_preview.$wrapper.empty(); - dialog.fields_dict.email_preview.$wrapper.append(result.message); + dialog.fields_dict.email_preview.$wrapper.append( + message.message + ); + dialog.set_value("subject", message.subject); }); - - } + }; dialog.fields_dict.note.$wrapper.append(`
This is a preview of the email to be sent. A PDF of the document will automatically be attached with the email.
`); - dialog.set_value("subject", frm.doc.subject); dialog.show(); } }) diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json index c16abb2f41b..fbfc1ac1693 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json @@ -20,11 +20,10 @@ "items_section", "items", "supplier_response_section", - "salutation", - "subject", - "col_break_email_1", "email_template", "preview", + "col_break_email_1", + "html_llwp", "send_attached_files", "sec_break_email_2", "message_for_supplier", @@ -237,23 +236,6 @@ "print_hide": 1, "read_only": 1 }, - { - "fetch_from": "email_template.subject", - "fetch_if_empty": 1, - "fieldname": "subject", - "fieldtype": "Data", - "label": "Subject", - "print_hide": 1 - }, - { - "description": "Select a greeting for the receiver. E.g. Mr., Ms., etc.", - "fieldname": "salutation", - "fieldtype": "Link", - "label": "Salutation", - "no_copy": 1, - "options": "Salutation", - "print_hide": 1 - }, { "fieldname": "col_break_email_1", "fieldtype": "Column Break" @@ -287,6 +269,14 @@ "fieldtype": "Data", "label": "Named Place" }, + { + "fieldname": "html_llwp", + "fieldtype": "HTML", + "options": "In your Email Template, you can use the following special variables:\n
\n{{ update_password_link }}: A link where your supplier can set a new password to log into your portal.\n {{ portal_link }}: A link to this RFQ in your supplier portal.\n {{ supplier_name }}: The company name of your supplier.\n {{ contact.salutation }} {{ contact.last_name }}: The contact person of your supplier.\n {{ user_fullname }}: Your full name.\n Apart from these, you can access all values in this RFQ, like {{ message_for_supplier }} or {{ terms }}.
{{ supplier_salutation if supplier_salutation else ''}} {{ supplier_name }},
-{{ message }}
-{{_("The Request for Quotation can be accessed by clicking on the following button")}}:
-{{_("Please click on the following button to set your new password")}}:
- - {{_("Set Password") }} - -
- {{_("Regards")}},
- {{ user_fullname }}
-