Skip to content

Commit

Permalink
feat: request_for_quotation
Browse files Browse the repository at this point in the history
- Show supplier name if supplier ID is not equal to supplier name

(cherry picked from commit b226e7d)
  • Loading branch information
ahmadpak authored and mergify[bot] committed May 13, 2022
1 parent 1ecbf33 commit db4e264
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ frappe.ui.form.on("Request for Quotation",{
if (frm.doc.docstatus === 1) {

frm.add_custom_button(__('Supplier Quotation'),
function(){ frm.trigger("make_suppplier_quotation") }, __("Create"));
function(){ frm.trigger("make_supplier_quotation") }, __("Create"));


frm.add_custom_button(__("Send Emails to Suppliers"), function() {
Expand Down Expand Up @@ -87,14 +87,20 @@ frappe.ui.form.on("Request for Quotation",{

},

make_suppplier_quotation: function(frm) {
make_supplier_quotation: function(frm) {
var doc = frm.doc;
var dialog = new frappe.ui.Dialog({
title: __("Create Supplier Quotation"),
fields: [
{ "fieldtype": "Select", "label": __("Supplier"),
"fieldname": "supplier",
"options": doc.suppliers.map(d => d.supplier),
"options": doc.suppliers.map(d => {
if (d.supplier !== d.supplier_name){
return `${d.supplier_name} [${d.supplier}]`
}else {
return d.supplier
}
}),
"reqd": 1,
"default": doc.suppliers.length === 1 ? doc.suppliers[0].supplier_name : "" },
],
Expand Down

0 comments on commit db4e264

Please sign in to comment.