From 8d0b826840ad7a0229a1482b4a08ef835a4b6945 Mon Sep 17 00:00:00 2001 From: Ben Cornwell-Mott Date: Fri, 9 Sep 2016 08:00:54 -0700 Subject: [PATCH] Added supplier quotation filter for Quoted Item Comparison --- .../quoted_item_comparison.js | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.js b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.js index 0f44baacaf..9b0b243718 100644 --- a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.js +++ b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.js @@ -4,12 +4,43 @@ frappe.query_reports["Quoted Item Comparison"] = { "filters": [ { + "fieldname":"supplier_quotation", + "label": __("Supplier Quotation"), + "fieldtype": "Link", + "options": "Supplier Quotation", + "default": "", + "get_query": function() { + return { + filters: {"docstatus": ["<",2]} + } + } + + + },{ "fieldname":"item", "label": __("Item"), "fieldtype": "Link", "options": "Item", - "default": "" - + "default": "", + "reqd": 1, + "get_query": function() { + var quote = frappe.query_report_filters_by_name.supplier_quotation.get_value(); + if (quote != "") + { + return { + query: "erpnext.buying.doctype.quality_inspection.quality_inspection.item_query", + filters: { + "from": "Supplier Quotation Item", + "parent": quote + } + } + } + else{ + return{ + filters: {"disabled":0} + } + } + } } ], onload: function(report) {