From 39097c7fbe963c5df9c5df4a1166266993efad61 Mon Sep 17 00:00:00 2001 From: Zlash65 Date: Mon, 7 May 2018 14:54:25 +0530 Subject: [PATCH] codacy fix --- .../purchase_analytics/purchase_analytics.js | 11 ++++++----- .../doctype/supplier_group/supplier_group.js | 16 ++++++++-------- .../supplier_group/supplier_group_tree.js | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.js b/erpnext/buying/page/purchase_analytics/purchase_analytics.js index b503113837..06764a3c60 100644 --- a/erpnext/buying/page/purchase_analytics/purchase_analytics.js +++ b/erpnext/buying/page/purchase_analytics/purchase_analytics.js @@ -130,14 +130,15 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({ if(!this.data || me.item_type != me.tree_type) { + var items; if(me.tree_type=='Supplier') { - var items = frappe.report_dump.data["Supplier"]; - } if(me.tree_type=='Supplier Group') { - var items = this.prepare_tree("Supplier", "Supplier Group"); + items = frappe.report_dump.data["Supplier"]; + } else if(me.tree_type=='Supplier Group') { + items = this.prepare_tree("Supplier", "Supplier Group"); } else if(me.tree_type=="Item Group") { - var items = this.prepare_tree("Item", "Item Group"); + items = this.prepare_tree("Item", "Item Group"); } else if(me.tree_type=="Item") { - var items = frappe.report_dump.data["Item"]; + items = frappe.report_dump.data["Item"]; } me.item_type = me.tree_type diff --git a/erpnext/setup/doctype/supplier_group/supplier_group.js b/erpnext/setup/doctype/supplier_group/supplier_group.js index ea92726e2a..ac5bda6e2c 100644 --- a/erpnext/setup/doctype/supplier_group/supplier_group.js +++ b/erpnext/setup/doctype/supplier_group/supplier_group.js @@ -4,7 +4,7 @@ cur_frm.cscript.refresh = function(doc) { cur_frm.set_intro(doc.__islocal ? "" : __("There is nothing to edit.")); cur_frm.cscript.set_root_readonly(doc); -} +}; cur_frm.cscript.set_root_readonly = function(doc) { // read-only for root customer group @@ -14,16 +14,16 @@ cur_frm.cscript.set_root_readonly = function(doc) { } else { cur_frm.set_intro(null); } -} +}; -//get query select Customer Group -cur_frm.fields_dict['parent_supplier_group'].get_query = function(doc,cdt,cdn) { +// get query select Customer Group +cur_frm.fields_dict['parent_supplier_group'].get_query = function() { return { filters: { 'is_group': 1 } - } -} + }; +}; cur_frm.fields_dict['accounts'].grid.get_field('account').get_query = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; @@ -33,5 +33,5 @@ cur_frm.fields_dict['accounts'].grid.get_field('account').get_query = function(d 'company': d.company, "is_group": 0 } - } -} + }; +}; diff --git a/erpnext/setup/doctype/supplier_group/supplier_group_tree.js b/erpnext/setup/doctype/supplier_group/supplier_group_tree.js index 24328bdd5a..73926992e8 100644 --- a/erpnext/setup/doctype/supplier_group/supplier_group_tree.js +++ b/erpnext/setup/doctype/supplier_group/supplier_group_tree.js @@ -1,3 +1,3 @@ frappe.treeview_settings["Supplier Group"] = { ignore_fields:["parent_supplier_group"] -} \ No newline at end of file +}; \ No newline at end of file