From f6f503a1f658cabe031c9b7a62253844e862cfc3 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 19 Dec 2018 15:06:44 +0530 Subject: [PATCH 01/20] [Fix] Is fixed asset checkbox not checked if user duplicate the existing invoice --- erpnext/assets/doctype/asset/test_asset.py | 12 +++++++++++- erpnext/controllers/accounts_controller.py | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/erpnext/assets/doctype/asset/test_asset.py b/erpnext/assets/doctype/asset/test_asset.py index 76c46cff7a..de164762ff 100644 --- a/erpnext/assets/doctype/asset/test_asset.py +++ b/erpnext/assets/doctype/asset/test_asset.py @@ -49,7 +49,17 @@ class TestAsset(unittest.TestCase): self.assertFalse(frappe.db.get_value("GL Entry", {"voucher_type": "Purchase Invoice", "voucher_no": pi.name})) - + + def test_is_fixed_asset_set(self): + doc = frappe.new_doc('Purchase Invoice') + doc.supplier = '_Test Supplier' + doc.append('items', { + 'item_code': 'Macbook Pro', + 'qty': 1 + }) + + doc.set_missing_values() + self.assertEquals(doc.items[0].is_fixed_asset, 1) def test_schedule_for_straight_line_method(self): asset = frappe.get_doc("Asset", "Macbook Pro 1") diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 68f4f73147..97536e7e82 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -218,6 +218,9 @@ class AccountsController(TransactionBase): if stock_qty != len(get_serial_nos(item.get('serial_no'))): item.set(fieldname, value) + if self.doctype in ["Purchase Invoice", "Sales Invoice"] and item.meta.get_field('is_fixed_asset'): + item.set('is_fixed_asset', ret.get('is_fixed_asset', 0)) + if ret.get("pricing_rule"): # if user changed the discount percentage then set user's discount percentage ? item.set("discount_percentage", ret.get("discount_percentage")) From e2762df90be03f4829b23c827f2ba9a9b06804df Mon Sep 17 00:00:00 2001 From: scmmishra Date: Tue, 8 Jan 2019 17:38:28 +0530 Subject: [PATCH 02/20] Fix: Naming series not reflecting in leave application --- erpnext/hr/doctype/leave_application/leave_application.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/leave_application/leave_application.json b/erpnext/hr/doctype/leave_application/leave_application.json index 7afbc4da89..eaef60cb62 100644 --- a/erpnext/hr/doctype/leave_application/leave_application.json +++ b/erpnext/hr/doctype/leave_application/leave_application.json @@ -3,7 +3,7 @@ "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, - "autoname": "LAP/.#####", + "autoname": "naming_series:", "beta": 0, "creation": "2013-02-20 11:18:11", "custom": 0, @@ -796,7 +796,7 @@ "issingle": 0, "istable": 0, "max_attachments": 3, - "modified": "2017-06-13 14:28:52.426044", + "modified": "2019-01-08 17:35:10.795225", "modified_by": "Administrator", "module": "HR", "name": "Leave Application", From c8d632ddff37893216be4c795ce415f16269b958 Mon Sep 17 00:00:00 2001 From: Zlash65 Date: Tue, 22 Jan 2019 12:46:13 +0530 Subject: [PATCH 03/20] fix: add set query for payroll entry in JV --- .../doctype/journal_entry/journal_entry.js | 7 +++++++ erpnext/hr/doctype/payroll_entry/payroll_entry.py | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index 60c974f262..a37e7a03e0 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -145,6 +145,13 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({ }; } + // payroll entry + if(jvd.reference_type==="Payroll Entry") { + return { + query: "erpnext.hr.doctype.payroll_entry.payroll_entry.get_payroll_entries_for_jv", + }; + } + var out = { filters: [ [jvd.reference_type, "docstatus", "=", 1] diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.py b/erpnext/hr/doctype/payroll_entry/payroll_entry.py index c9d6290f26..0f2e5f4fa1 100644 --- a/erpnext/hr/doctype/payroll_entry/payroll_entry.py +++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.py @@ -525,3 +525,17 @@ def payroll_entry_has_bank_entries(name): response['submitted'] = 1 if bank_entries else 0 return response + +def get_payroll_entries_for_jv(doctype, txt, searchfield, start, page_len, filters): + print(doctype) + return frappe.db.sql(""" + select name from `tabPayroll Entry` + where `{key}` LIKE %(txt)s + and name not in + (select reference_name from `tabJournal Entry Account` + where reference_type="Payroll Entry") + order by name limit %(start)s, %(page_len)s""" + .format(key=searchfield), { + 'txt': "%%%s%%" % frappe.db.escape(txt), + 'start': start, 'page_len': page_len + }) From 270c4c2a87716b82cd8894fdcd536217b560e893 Mon Sep 17 00:00:00 2001 From: Zlash65 Date: Tue, 22 Jan 2019 12:47:25 +0530 Subject: [PATCH 04/20] fix: push party filter only if applicable --- .../accounts/doctype/journal_entry/journal_entry.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index a37e7a03e0..c0a9a965e2 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -175,9 +175,15 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({ out.filters.push([jvd.reference_type, "per_billed", "<", 100]); } - if(jvd.party_type && jvd.party) { - out.filters.push([jvd.reference_type, - (jvd.reference_type.indexOf("Sales")===0 ? "customer" : "supplier"), "=", jvd.party]); + var party_field = ""; + if(jvd.reference_type.indexOf("Sales")===0) { + var party_field = "customer"; + } else if (jvd.reference_type.indexOf("Purchase")===0) { + var party_field = "supplier"; + } + + if (party_field) { + out.filters.push([jvd.reference_type, party_field, "=", jvd.party]); } return out; From 141c543f9765b11df09fef4e57157b2aae5fd172 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 Jan 2019 12:14:55 +0530 Subject: [PATCH 05/20] Update journal_entry.js --- .../doctype/journal_entry/journal_entry.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index c0a9a965e2..0aa62d510c 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -174,16 +174,18 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({ out.filters.push([jvd.reference_type, "per_billed", "<", 100]); } + + if(jvd.party_type && jvd.party) { + var party_field = ""; + if(jvd.reference_type.indexOf("Sales")===0) { + var party_field = "customer"; + } else if (jvd.reference_type.indexOf("Purchase")===0) { + var party_field = "supplier"; + } - var party_field = ""; - if(jvd.reference_type.indexOf("Sales")===0) { - var party_field = "customer"; - } else if (jvd.reference_type.indexOf("Purchase")===0) { - var party_field = "supplier"; - } - - if (party_field) { - out.filters.push([jvd.reference_type, party_field, "=", jvd.party]); + if (party_field) { + out.filters.push([jvd.reference_type, party_field, "=", jvd.party]); + } } return out; From 06607fda4e4d5a55c8107e30de5568d7d522e8fa Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 Jan 2019 12:15:48 +0530 Subject: [PATCH 06/20] fix: removed print statement --- erpnext/hr/doctype/payroll_entry/payroll_entry.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.py b/erpnext/hr/doctype/payroll_entry/payroll_entry.py index 0f2e5f4fa1..734509592f 100644 --- a/erpnext/hr/doctype/payroll_entry/payroll_entry.py +++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.py @@ -527,7 +527,6 @@ def payroll_entry_has_bank_entries(name): return response def get_payroll_entries_for_jv(doctype, txt, searchfield, start, page_len, filters): - print(doctype) return frappe.db.sql(""" select name from `tabPayroll Entry` where `{key}` LIKE %(txt)s From 037d0f8ba6956ec099cddaa3746063f90cd674bd Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Wed, 23 Jan 2019 14:11:25 +0530 Subject: [PATCH 07/20] fix(buying): make supplier scorecard usable --- .../supplier_scorecard/supplier_scorecard.js | 101 +++++----------- .../supplier_scorecard.json | 67 ++++++----- .../supplier_scorecard/supplier_scorecard.py | 9 +- .../supplier_scorecard_criteria.json | 70 ++++++------ .../supplier_scorecard_criteria.py | 19 +-- .../supplier_scorecard_period.js | 10 +- .../supplier_scorecard_period.json | 42 ++++++- .../supplier_scorecard_period.py | 40 +++---- .../supplier_scorecard_scoring_criteria.json | 108 +++++++----------- .../supplier_scorecard_scoring_standing.json | 4 +- .../supplier_scorecard_scoring_variable.json | 104 ++++++----------- .../supplier_scorecard_standing.json | 4 +- .../supplier_scorecard_variable.json | 6 +- .../supplier_scorecard_variable.py | 7 -- 14 files changed, 244 insertions(+), 347 deletions(-) diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js index e7a704a28a..5f5f54b79f 100644 --- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js +++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js @@ -13,15 +13,23 @@ frappe.ui.form.on("Supplier Scorecard", { }, onload: function(frm) { if (frm.doc.__unsaved == 1) { - loadAllCriteria(frm); loadAllStandings(frm); } - }, - refresh: function(frm) { - if (frm.dashboard.hasOwnProperty('heatmap')) { - frm.dashboard.heatmap.setLegend([0,20,40,60,80,101],["#991600","#169900"]); - } + load_criteria: function(frm) { + frappe.call({ + method: "erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria.get_criteria_list", + callback: function(r) { + frm.set_value('criteria', []); + for (var i = 0; i < r.message.length; i++) + { + var row = frm.add_child("criteria"); + row.criteria_name = r.message[i].name; + frm.script_manager.trigger("criteria_name", row.doctype, row.name); + } + refresh_field("criteria"); + } + }); } }); @@ -29,8 +37,8 @@ frappe.ui.form.on("Supplier Scorecard", { frappe.ui.form.on("Supplier Scorecard Scoring Standing", { standing_name: function(frm, cdt, cdn) { - if (frm.doc.standing_name != undefined) { - var d = frappe.get_doc(cdt, cdn); + var d = frappe.get_doc(cdt, cdn); + if (d.standing_name) { return frm.call({ method: "erpnext.buying.doctype.supplier_scorecard_standing.supplier_scorecard_standing.get_scoring_standing", child: d, @@ -42,86 +50,29 @@ frappe.ui.form.on("Supplier Scorecard Scoring Standing", { } }); -frappe.ui.form.on("Supplier Scorecard Scoring Variable", { - - variable_label: function(frm, cdt, cdn) { - if (frm.doc.variable_label != undefined) { - var d = frappe.get_doc(cdt, cdn); - return frm.call({ - method: "erpnext.buying.doctype.supplier_scorecard_variable.supplier_scorecard_variable.get_scoring_variable", - child: d, - args: { - variable_label: d.variable_label - } - }); - } - } -}); - frappe.ui.form.on("Supplier Scorecard Scoring Criteria", { criteria_name: function(frm, cdt, cdn) { - if (frm.doc.criteria_name != undefined) { - var d = frappe.get_doc(cdt, cdn); - frm.call({ - method: "erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria.get_variables", + var d = frappe.get_doc(cdt, cdn); + if (d.criteria_name) { + return frm.call({ + method: "frappe.client.get", args: { - criteria_name: d.criteria_name + fieldname: "weight", + doctype: "Supplier Scorecard Criteria", + filters: {name: d.criteria_name} }, callback: function(r) { - for (var i = 0; i < r.message.length; i++) - { - var exists = false; - for (var j = 0; j < frm.doc.variables.length; j++) - { - if(!frm.doc.variables[j].hasOwnProperty("variable_label")) { - frm.get_field("variables").grid.grid_rows[j].remove(); - } - else if(frm.doc.variables[j].variable_label === r.message[i]) { - exists = true; - } - } - if (!exists){ - var new_row = frm.add_child("variables"); - new_row.variable_label = r.message[i]; - frm.script_manager.trigger("variable_label", new_row.doctype, new_row.name); - } - + if(r.message){ + d.weight = r.message.weight; + frm.refresh_field('criteria', 'weight'); } - refresh_field("variables"); - } - }); - return frm.call({ - method: "erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria.get_scoring_criteria", - child: d, - args: { - criteria_name: d.criteria_name } }); } } }); -var loadAllCriteria = function(frm) { - frappe.call({ - method: "erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria.get_criteria_list", - callback: function(r) { - for (var j = 0; j < frm.doc.criteria.length; j++) - { - if(!frm.doc.criteria[j].hasOwnProperty("criteria_name")) { - frm.get_field("criteria").grid.grid_rows[j].remove(); - } - } - for (var i = 0; i < r.message.length; i++) - { - var new_row = frm.add_child("criteria"); - new_row.criteria_name = r.message[i].name; - frm.script_manager.trigger("criteria_name", new_row.doctype, new_row.name); - } - refresh_field("criteria"); - } - }); -}; var loadAllStandings = function(frm) { frappe.call({ method: "erpnext.buying.doctype.supplier_scorecard_standing.supplier_scorecard_standing.get_standings_list", diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json index d7f24c9082..703ec3a0aa 100644 --- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json +++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json @@ -4,7 +4,7 @@ "allow_import": 0, "allow_rename": 0, "autoname": "field:supplier", - "beta": 1, + "beta": 0, "creation": "2017-05-29 01:40:54.786555", "custom": 0, "docstatus": 0, @@ -182,7 +182,7 @@ "label": "Evaluation Period", "length": 0, "no_copy": 0, - "options": "Per Month\nPer Week\nPer Year", + "options": "Per Week\nPer Month\nPer Year", "permlevel": 0, "precision": "", "print_hide": 0, @@ -318,6 +318,36 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "load_criteria", + "fieldtype": "Button", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Load All Criteria", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -349,37 +379,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "variables", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Supplier Variables", - "length": 0, - "no_copy": 0, - "options": "Supplier Scorecard Scoring Variable", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -662,7 +661,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-07-12 07:33:11.874949", + "modified": "2019-01-22 11:42:19.918990", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Scorecard", diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py index e13d22ab57..9e201e3192 100644 --- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py +++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py @@ -54,6 +54,7 @@ class SupplierScorecard(Document): `tabSupplier Scorecard Period` scp WHERE scp.scorecard = %(sc)s + AND scp.docstatus = 1 ORDER BY scp.end_date DESC""", {"sc": self.name}, as_dict=1) @@ -110,7 +111,8 @@ def get_timeline_data(doctype, name): FROM `tabSupplier Scorecard Period` sc WHERE - sc.scorecard = %(scs)s""", + sc.scorecard = %(scs)s + AND sc.docstatus = 1""", {"scs": scs.name}, as_dict=1) for sc in scorecards: @@ -162,6 +164,7 @@ def make_all_scorecards(docname): `tabSupplier Scorecard Period` scp WHERE scp.scorecard = %(sc)s + AND scp.docstatus = 1 AND ( (scp.start_date > %(end_date)s AND scp.end_date < %(start_date)s) @@ -170,12 +173,12 @@ def make_all_scorecards(docname): AND scp.end_date > %(start_date)s)) ORDER BY scp.end_date DESC""", - {"sc": docname, "start_date": start_date, "end_date": end_date, "supplier": supplier}, as_dict=1) + {"sc": docname, "start_date": start_date, "end_date": end_date}, as_dict=1) if len(scorecards) == 0: period_card = make_supplier_scorecard(docname, None) period_card.start_date = start_date period_card.end_date = end_date - period_card.save() + period_card.submit() scp_count = scp_count + 1 if start_date < first_start_date: first_start_date = start_date diff --git a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.json b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.json index 229c386120..2623585aea 100644 --- a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.json +++ b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.json @@ -4,7 +4,7 @@ "allow_import": 0, "allow_rename": 0, "autoname": "field:criteria_name", - "beta": 1, + "beta": 0, "creation": "2017-05-29 01:32:43.064891", "custom": 0, "docstatus": 0, @@ -43,36 +43,6 @@ "set_only_once": 0, "unique": 1 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "weight", - "fieldtype": "Percent", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Criteria Weight", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -87,7 +57,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 0, "label": "Max Score", "length": 0, @@ -114,10 +84,10 @@ "fieldtype": "Small Text", "hidden": 0, "ignore_user_permissions": 0, - "ignore_xss_filter": 0, + "ignore_xss_filter": 1, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 0, "label": "Criteria Formula", "length": 0, @@ -133,6 +103,36 @@ "search_index": 0, "set_only_once": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "weight", + "fieldtype": "Percent", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Criteria Weight", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 } ], "has_web_view": 0, @@ -145,7 +145,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-07-17 10:30:47.458285", + "modified": "2019-01-22 10:47:00.000822", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Scorecard Criteria", diff --git a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py index 8514022b78..b23d321a2a 100644 --- a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py +++ b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py @@ -36,15 +36,6 @@ class SupplierScorecardCriteria(Document): except Exception: frappe.throw(_("Error evaluating the criteria formula")) - - -@frappe.whitelist() -def get_scoring_criteria(criteria_name): - criteria = frappe.get_doc("Supplier Scorecard Criteria", criteria_name) - - return criteria - - @frappe.whitelist() def get_criteria_list(): criteria = frappe.db.sql(""" @@ -56,7 +47,6 @@ def get_criteria_list(): return criteria -@frappe.whitelist() def get_variables(criteria_name): criteria = frappe.get_doc("Supplier Scorecard Criteria", criteria_name) return _get_variables(criteria) @@ -69,21 +59,16 @@ def _get_variables(criteria): for dummy1, match in enumerate(mylist): for dummy2 in range(0, len(match.groups())): try: - #var = frappe.get_doc("Supplier Scorecard Variable", {'param_name' : d}) var = frappe.db.sql(""" SELECT - scv.name + scv.variable_label, scv.description, scv.param_name, scv.path FROM `tabSupplier Scorecard Variable` scv WHERE param_name=%(param)s""", - {'param':match.group(1)},)[0][0] + {'param':match.group(1)}, as_dict=1)[0] my_variables.append(var) except Exception: - # Ignore the ones where the variable can't be found frappe.throw(_('Unable to find variable: ') + str(match.group(1)), InvalidFormulaVariable) - #pass - - #frappe.msgprint(str(my_variables)) return my_variables diff --git a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js index c51e8ab2df..a4cdeb3195 100644 --- a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js +++ b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js @@ -6,9 +6,11 @@ frappe.ui.form.on("Supplier Scorecard Period", { onload: function(frm) { - frm.get_field("variables").grid.toggle_display("value", true); - frm.get_field("criteria").grid.toggle_display("score", true); - - + let criteria_grid = frm.get_field("criteria").grid; + criteria_grid.toggle_enable("criteria_name", false); + criteria_grid.toggle_enable("weight", false); + criteria_grid.toggle_display("max_score", true); + criteria_grid.toggle_display("formula", true); + criteria_grid.toggle_display("score", true); } }); diff --git a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.json b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.json index 0cf651454b..e76f614983 100644 --- a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.json +++ b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.json @@ -4,7 +4,7 @@ "allow_import": 0, "allow_rename": 0, "autoname": "naming_series:", - "beta": 1, + "beta": 0, "creation": "2017-05-30 00:38:18.773013", "custom": 0, "docstatus": 0, @@ -281,7 +281,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -346,6 +346,36 @@ "search_index": 0, "set_only_once": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "amended_from", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Amended From", + "length": 0, + "no_copy": 1, + "options": "Supplier Scorecard Period", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 } ], "has_web_view": 0, @@ -354,11 +384,11 @@ "idx": 0, "image_view": 0, "in_create": 1, - "is_submittable": 0, + "is_submittable": 1, "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-07-12 07:33:26.130861", + "modified": "2019-01-23 13:58:26.137770", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Scorecard Period", @@ -368,7 +398,7 @@ { "amend": 0, "apply_user_permissions": 0, - "cancel": 0, + "cancel": 1, "create": 1, "delete": 1, "email": 1, @@ -382,7 +412,7 @@ "role": "System Manager", "set_user_permissions": 0, "share": 1, - "submit": 0, + "submit": 1, "write": 1 } ], diff --git a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py index 90b65bd35a..4410431b54 100644 --- a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py +++ b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py @@ -8,6 +8,7 @@ from frappe import throw, _ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc import erpnext.buying.doctype.supplier_scorecard_variable.supplier_scorecard_variable as variable_functions +from erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria import get_variables class SupplierScorecardPeriod(Document): @@ -28,7 +29,6 @@ class SupplierScorecardPeriod(Document): def calculate_variables(self): for var in self.variables: - if '.' in var.path: method_to_call = import_string_path(var.path) var.value = method_to_call(self) @@ -39,14 +39,8 @@ class SupplierScorecardPeriod(Document): def calculate_criteria(self): - #Get the criteria for crit in self.criteria: - - #me = "" my_eval_statement = crit.formula.replace("\r", "").replace("\n", "") - #for let in my_eval_statement: - # me += let.encode('hex') + " " - #frappe.msgprint(me) for var in self.variables: if var.value: @@ -102,30 +96,28 @@ def import_string_path(path): return mod -def post_process(source, target): - pass - - @frappe.whitelist() def make_supplier_scorecard(source_name, target_doc=None): - #def update_item(obj, target, source_parent): - # target.qty = flt(obj.qty) - flt(obj.received_qty) - # target.stock_qty = (flt(obj.qty) - flt(obj.received_qty)) * flt(obj.conversion_factor) - # target.amount = (flt(obj.qty) - flt(obj.received_qty)) * flt(obj.rate) - # target.base_amount = (flt(obj.qty) - flt(obj.received_qty)) * \ - # flt(obj.rate) * flt(source_parent.conversion_rate) + def update_criteria_fields(obj, target, source_parent): + target.max_score, target.formula = frappe.db.get_value('Supplier Scorecard Criteria', + obj.criteria_name, ['max_score', 'formula']) + + def post_process(source, target): + variables = [] + for cr in target.criteria: + for var in get_variables(cr.criteria_name): + if var not in variables: + variables.append(var) + + target.extend('variables', variables) doc = get_mapped_doc("Supplier Scorecard", source_name, { "Supplier Scorecard": { "doctype": "Supplier Scorecard Period" }, - "Supplier Scorecard Scoring Variable": { - "doctype": "Supplier Scorecard Scoring Variable", - "add_if_empty": True - }, - "Supplier Scorecard Scoring Constraint": { - "doctype": "Supplier Scorecard Scoring Constraint", - "add_if_empty": True + "Supplier Scorecard Scoring Criteria": { + "doctype": "Supplier Scorecard Scoring Criteria", + "postprocess": update_criteria_fields, } }, target_doc, post_process) diff --git a/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json b/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json index 567738a6d0..5816856521 100644 --- a/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json +++ b/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json @@ -3,7 +3,7 @@ "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, - "beta": 1, + "beta": 0, "creation": "2017-05-29 01:32:17.988454", "custom": 0, "docstatus": 0, @@ -17,7 +17,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "columns": 3, + "columns": 5, "fieldname": "criteria_name", "fieldtype": "Link", "hidden": 0, @@ -43,14 +43,44 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 2, + "fieldname": "score", + "fieldtype": "Percent", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Score", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "section_break_2", - "fieldtype": "Section Break", + "fieldname": "column_break_4", + "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -90,6 +120,7 @@ "label": "Criteria Weight", "length": 0, "no_copy": 0, + "options": "", "permlevel": 0, "precision": "", "print_hide": 0, @@ -102,35 +133,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_4", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -140,7 +142,7 @@ "default": "100", "fieldname": "max_score", "fieldtype": "Float", - "hidden": 0, + "hidden": 1, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, @@ -154,7 +156,7 @@ "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, - "read_only": 0, + "read_only": 1, "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, @@ -199,7 +201,7 @@ "columns": 0, "fieldname": "formula", "fieldtype": "Small Text", - "hidden": 0, + "hidden": 1, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, @@ -213,37 +215,7 @@ "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "score", - "fieldtype": "Percent", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Score", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, + "read_only": 1, "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, @@ -262,7 +234,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-07-12 07:33:41.532361", + "modified": "2019-01-23 13:49:13.350095", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Scorecard Scoring Criteria", diff --git a/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.json b/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.json index 1fc04bb120..e8498efb5e 100644 --- a/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.json +++ b/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.json @@ -3,7 +3,7 @@ "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, - "beta": 1, + "beta": 0, "creation": "2017-05-29 01:36:22.697234", "custom": 0, "docstatus": 0, @@ -473,7 +473,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-07-12 07:33:20.615684", + "modified": "2019-01-22 10:47:41.146704", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Scorecard Scoring Standing", diff --git a/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.json b/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.json index f0e043e47a..5e4c5c1e3a 100644 --- a/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.json +++ b/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.json @@ -3,7 +3,7 @@ "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, - "beta": 1, + "beta": 0, "creation": "2017-05-29 01:30:06.105240", "custom": 0, "docstatus": 0, @@ -35,7 +35,7 @@ "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, - "read_only": 0, + "read_only": 1, "remember_last_selected_value": 0, "report_hide": 0, "reqd": 1, @@ -65,7 +65,37 @@ "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, - "read_only": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 2, + "fieldname": "value", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Value", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, @@ -73,36 +103,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "is_custom", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Custom?", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -111,7 +111,7 @@ "columns": 0, "fieldname": "param_name", "fieldtype": "Data", - "hidden": 0, + "hidden": 1, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, @@ -128,7 +128,7 @@ "read_only": 1, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -141,7 +141,7 @@ "columns": 0, "fieldname": "path", "fieldtype": "Data", - "hidden": 0, + "hidden": 1, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, @@ -158,36 +158,6 @@ "read_only": 1, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 2, - "fieldname": "value", - "fieldtype": "Float", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Value", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, "reqd": 0, "search_index": 0, "set_only_once": 0, @@ -204,7 +174,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-07-12 07:33:36.671502", + "modified": "2019-01-23 09:55:19.749828", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Scorecard Scoring Variable", diff --git a/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.json b/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.json index b61b4edd72..b57881a096 100644 --- a/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.json +++ b/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.json @@ -4,7 +4,7 @@ "allow_import": 0, "allow_rename": 0, "autoname": "field:standing_name", - "beta": 1, + "beta": 0, "creation": "2017-05-29 01:36:47.893639", "custom": 0, "docstatus": 0, @@ -385,7 +385,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-07-12 07:33:16.560273", + "modified": "2019-01-22 10:47:49.195421", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Scorecard Standing", diff --git a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.json b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.json index d24484025c..d372905297 100644 --- a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.json +++ b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.json @@ -4,7 +4,7 @@ "allow_import": 0, "allow_rename": 0, "autoname": "field:variable_label", - "beta": 1, + "beta": 0, "creation": "2017-05-29 01:30:34.688389", "custom": 0, "docstatus": 0, @@ -101,7 +101,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, - "unique": 0 + "unique": 1 }, { "allow_bulk_edit": 0, @@ -203,7 +203,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-07-12 07:33:31.395262", + "modified": "2019-01-23 09:39:59.866398", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Scorecard Variable", diff --git a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py index 17c911a000..37fdc5724f 100644 --- a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py +++ b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py @@ -27,13 +27,6 @@ class SupplierScorecardVariable(Document): if not hasattr(sys.modules[__name__], self.path): frappe.throw(_("Could not find path for " + self.path), VariablePathNotFound) - -@frappe.whitelist() -def get_scoring_variable(variable_label): - variable = frappe.get_doc("Supplier Scorecard Variable", variable_label) - - return variable - def get_total_workdays(scorecard): """ Gets the number of days in this period""" delta = getdate(scorecard.end_date) - getdate(scorecard.start_date) From 57d7c837aa55ccd1812c0c29d805cfc6955ce49f Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Wed, 23 Jan 2019 14:26:35 +0530 Subject: [PATCH 08/20] fix: supplier scorecard test --- .../test_supplier_scorecard.py | 62 +------------------ 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py b/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py index d64d3f683f..6e6eaed95d 100644 --- a/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py +++ b/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py @@ -21,12 +21,6 @@ class TestSupplierScorecard(unittest.TestCase): d.weight = 0 self.assertRaises(frappe.ValidationError,my_doc.insert) - def test_missing_variable(self): - delete_test_scorecards() - my_doc = make_supplier_scorecard() - del my_doc.variables - self.assertRaises(frappe.ValidationError,my_doc.insert) - def make_supplier_scorecard(): my_doc = frappe.get_doc(valid_scorecard[0]) @@ -118,56 +112,6 @@ valid_scorecard = [ } ], "prevent_pos":0, - "variables": [ - { - "param_name":"cost_of_on_time_shipments", - "doctype":"Supplier Scorecard Scoring Variable", - "parenttype":"Supplier Scorecard", - "variable_label":"Cost of On Time Shipments", - "path":"get_cost_of_on_time_shipments", - "parentfield":"variables" - }, - { - "param_name":"tot_cost_shipments", - "doctype":"Supplier Scorecard Scoring Variable", - "parenttype":"Supplier Scorecard", - "variable_label":"Total Cost of Shipments", - "path":"get_total_cost_of_shipments", - "parentfield":"variables" - }, - { - "param_name":"tot_days_late", - "doctype":"Supplier Scorecard Scoring Variable", - "parenttype":"Supplier Scorecard", - "variable_label":"Total Days Late", - "path":"get_total_days_late", - "parentfield":"variables" - }, - { - "param_name":"total_working_days", - "doctype":"Supplier Scorecard Scoring Variable", - "parenttype":"Supplier Scorecard", - "variable_label":"Total Working Days", - "path":"get_total_workdays", - "parentfield":"variables" - }, - { - "param_name":"on_time_shipment_num", - "doctype":"Supplier Scorecard Scoring Variable", - "parenttype":"Supplier Scorecard", - "variable_label":"# of On Time Shipments", - "path":"get_on_time_shipments", - "parentfield":"variables" - }, - { - "param_name":"total_shipments", - "doctype":"Supplier Scorecard Scoring Variable", - "parenttype":"Supplier Scorecard", - "variable_label":"Total Shipments", - "path":"get_total_shipments", - "parentfield":"variables" - } - ], "period":"Per Month", "doctype":"Supplier Scorecard", "warn_pos":0, @@ -177,14 +121,12 @@ valid_scorecard = [ { "weight":100.0, "doctype":"Supplier Scorecard Scoring Criteria", - "formula":"(({cost_of_on_time_shipments} / {tot_cost_shipments}) if {tot_cost_shipments} > 0 else 1 )* 100 ", - "criteria_name":"Delivery", - "max_score":100.0, + "criteria_name":"Delivery" } ], "supplier":"_Test Supplier", "name":"_Test Supplier", - "weighting_function":"{total_score} * max( 0, min ( 1 , (12 - {period_number}) / 12) )", + "weighting_function":"{total_score} * max( 0, min ( 1 , (12 - {period_number}) / 12) )" } ] From 9aeabce3d3e1148dfdd43daa174f88cbaae22742 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Wed, 23 Jan 2019 16:01:19 +0530 Subject: [PATCH 09/20] fix: trailing whitespace, duplication & more --- .../supplier_scorecard.json | 1298 ++++++++--------- .../supplier_scorecard_criteria.py | 1 - .../supplier_scorecard_period.py | 45 +- .../supplier_scorecard_scoring_criteria.json | 466 +++--- 4 files changed, 898 insertions(+), 912 deletions(-) diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json index 703ec3a0aa..95dc7518f6 100644 --- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json +++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json @@ -1,700 +1,700 @@ { - "allow_copy": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "autoname": "field:supplier", - "beta": 0, - "creation": "2017-05-29 01:40:54.786555", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, - "engine": "InnoDB", + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "field:supplier", + "beta": 0, + "creation": "2017-05-29 01:40:54.786555", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", "fields": [ { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "supplier", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Supplier", - "length": 0, - "no_copy": 0, - "options": "Supplier", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "supplier", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Supplier", + "length": 0, + "no_copy": 0, + "options": "Supplier", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "supplier_score", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Supplier Score", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "supplier_score", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Supplier Score", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "indicator_color", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Indicator Color", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "indicator_color", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Indicator Color", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "status", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Status", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "status", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Status", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_2", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "Per Month", - "fieldname": "period", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Evaluation Period", - "length": 0, - "no_copy": 0, - "options": "Per Week\nPer Month\nPer Year", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "Per Month", + "fieldname": "period", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Evaluation Period", + "length": 0, + "no_copy": 0, + "options": "Per Week\nPer Month\nPer Year", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fieldname": "scoring_setup", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Scoring Setup", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fieldname": "scoring_setup", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Scoring Setup", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "{total_score} * max( 0, min ( 1 , (12 - {period_number}) / 12) )", - "description": "Scorecard variables can be used, as well as:\n{total_score} (the total score from that period),\n{period_number} (the number of periods to present day)\n", - "fieldname": "weighting_function", - "fieldtype": "Small Text", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Weighting Function", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "{total_score} * max( 0, min ( 1 , (12 - {period_number}) / 12) )", + "description": "Scorecard variables can be used, as well as:\n{total_score} (the total score from that period),\n{period_number} (the number of periods to present day)\n", + "fieldname": "weighting_function", + "fieldtype": "Small Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 1, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Weighting Function", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "standings", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Scoring Standings", - "length": 0, - "no_copy": 0, - "options": "Supplier Scorecard Scoring Standing", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "standings", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Scoring Standings", + "length": 0, + "no_copy": 0, + "options": "Supplier Scorecard Scoring Standing", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fieldname": "criteria_setup", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Criteria Setup", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fieldname": "criteria_setup", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Criteria Setup", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "load_criteria", - "fieldtype": "Button", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Load All Criteria", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "load_criteria", + "fieldtype": "Button", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Load All Criteria", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "criteria", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Scoring Criteria", - "length": 0, - "no_copy": 0, - "options": "Supplier Scorecard Scoring Criteria", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "criteria", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Scoring Criteria", + "length": 0, + "no_copy": 0, + "options": "Supplier Scorecard Scoring Criteria", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "collapsible_depends_on": "eval: doc.status != 'Unknown'", - "columns": 0, - "fieldname": "scorecard_actions", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Scorecard Actions", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "collapsible_depends_on": "eval: doc.status != 'Unknown'", + "columns": 0, + "fieldname": "scorecard_actions", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Scorecard Actions", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "warn_rfqs", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Warn for new Request for Quotations", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "warn_rfqs", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Warn for new Request for Quotations", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "warn_pos", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Warn for new Purchase Orders", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "warn_pos", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Warn for new Purchase Orders", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "prevent_rfqs", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Prevent RFQs", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "prevent_rfqs", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Prevent RFQs", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "prevent_pos", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Prevent POs", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "prevent_pos", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Prevent POs", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_16", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_16", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "notify_supplier", - "fieldtype": "Check", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Notify Supplier", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "notify_supplier", + "fieldtype": "Check", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Notify Supplier", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "notify_employee", - "fieldtype": "Check", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Notify Employee", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "notify_employee", + "fieldtype": "Check", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Notify Employee", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "employee", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Employee", - "length": 0, - "no_copy": 0, - "options": "Employee", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "employee", + "fieldtype": "Link", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Employee", + "length": 0, + "no_copy": 0, + "options": "Employee", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2019-01-22 11:42:19.918990", - "modified_by": "Administrator", - "module": "Buying", - "name": "Supplier Scorecard", - "name_case": "", - "owner": "Administrator", + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2019-01-22 11:42:19.918990", + "modified_by": "Administrator", + "module": "Buying", + "name": "Supplier Scorecard", + "name_case": "", + "owner": "Administrator", "permissions": [ { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, "write": 1 } - ], - "quick_entry": 0, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 0, + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 0, "track_seen": 0 } \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py index b23d321a2a..33a0dc7837 100644 --- a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py +++ b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py @@ -30,7 +30,6 @@ class SupplierScorecardCriteria(Document): for dummy2 in range(0, len(match.groups())): test_formula = test_formula.replace('{' + match.group(1) + '}', "0") - test_formula = test_formula.replace('<','<').replace('>','>') try: frappe.safe_eval(test_formula, None, {'max':max, 'min': min}) except Exception: diff --git a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py index 4410431b54..15ba3f93ba 100644 --- a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py +++ b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py @@ -40,22 +40,8 @@ class SupplierScorecardPeriod(Document): def calculate_criteria(self): for crit in self.criteria: - my_eval_statement = crit.formula.replace("\r", "").replace("\n", "") - - for var in self.variables: - if var.value: - if var.param_name in my_eval_statement: - my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', "{:.2f}".format(var.value)) - else: - if var.param_name in my_eval_statement: - my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', '0.0') - - #frappe.msgprint(my_eval_statement ) - - my_eval_statement = my_eval_statement.replace('<','<').replace('>','>') - try: - crit.score = min(crit.max_score, max( 0 ,frappe.safe_eval(my_eval_statement, None, {'max':max, 'min': min}))) + crit.score = min(crit.max_score, max( 0 ,frappe.safe_eval(self.get_eval_statement(crit.formula), None, {'max':max, 'min': min}))) except Exception: frappe.throw(_("Could not solve criteria score function for {0}. Make sure the formula is valid.".format(crit.criteria_name)),frappe.ValidationError) crit.score = 0 @@ -67,26 +53,27 @@ class SupplierScorecardPeriod(Document): self.total_score = myscore def calculate_weighted_score(self, weighing_function): - my_eval_statement = weighing_function.replace("\r", "").replace("\n", "") - - for var in self.variables: - if var.value: - if var.param_name in my_eval_statement: - my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', "{:.2f}".format(var.value)) - else: - if var.param_name in my_eval_statement: - my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', '0.0') - - my_eval_statement = my_eval_statement.replace('<','<').replace('>','>') - try: - weighed_score = frappe.safe_eval(my_eval_statement, None, {'max':max, 'min': min}) + weighed_score = frappe.safe_eval(self.get_eval_statement(weighing_function), None, {'max':max, 'min': min}) except Exception: frappe.throw(_("Could not solve weighted score function. Make sure the formula is valid."),frappe.ValidationError) weighed_score = 0 return weighed_score + def get_eval_statement(self, input): + my_eval_statement = input.replace("\r", "").replace("\n", "") + + for var in self.variables: + if var.value: + if var.param_name in my_eval_statement: + my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', "{:.2f}".format(var.value)) + else: + if var.param_name in my_eval_statement: + my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', '0.0') + + return my_eval_statement + def import_string_path(path): components = path.split('.') @@ -108,7 +95,7 @@ def make_supplier_scorecard(source_name, target_doc=None): for var in get_variables(cr.criteria_name): if var not in variables: variables.append(var) - + target.extend('variables', variables) doc = get_mapped_doc("Supplier Scorecard", source_name, { diff --git a/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json b/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json index 5816856521..55ed45e320 100644 --- a/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json +++ b/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json @@ -1,252 +1,252 @@ { - "allow_copy": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2017-05-29 01:32:17.988454", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, - "engine": "InnoDB", + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2017-05-29 01:32:17.988454", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", "fields": [ { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 5, - "fieldname": "criteria_name", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Criteria Name", - "length": 0, - "no_copy": 0, - "options": "Supplier Scorecard Criteria", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 5, + "fieldname": "criteria_name", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Criteria Name", + "length": 0, + "no_copy": 0, + "options": "Supplier Scorecard Criteria", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 2, - "fieldname": "score", - "fieldtype": "Percent", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Score", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 2, + "fieldname": "score", + "fieldtype": "Percent", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Score", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_4", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_4", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 2, - "fieldname": "weight", - "fieldtype": "Percent", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Criteria Weight", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 2, + "fieldname": "weight", + "fieldtype": "Percent", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Criteria Weight", + "length": 0, + "no_copy": 0, + "options": "", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "100", - "fieldname": "max_score", - "fieldtype": "Float", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Max Score", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "100", + "fieldname": "max_score", + "fieldtype": "Float", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Max Score", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "section_break_6", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break_6", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "formula", - "fieldtype": "Small Text", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Criteria Formula", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "formula", + "fieldtype": "Small Text", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 1, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Criteria Formula", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 1, - "max_attachments": 0, - "modified": "2019-01-23 13:49:13.350095", - "modified_by": "Administrator", - "module": "Buying", - "name": "Supplier Scorecard Scoring Criteria", - "name_case": "", - "owner": "Administrator", - "permissions": [], - "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 1, + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2019-01-23 13:49:13.350095", + "modified_by": "Administrator", + "module": "Buying", + "name": "Supplier Scorecard Scoring Criteria", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, "track_seen": 0 } \ No newline at end of file From f51661b225d0fe007901f098d2d80cb5d0b88965 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Wed, 23 Jan 2019 16:42:28 +0530 Subject: [PATCH 10/20] fix: allow operators, make weighting_function mandatory --- .../supplier_scorecard.json | 2 +- erpnext/patches.txt | 3 ++- .../allow_operators_in_supplier_scorecard.py | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json index 95dc7518f6..6a077e9c35 100644 --- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json +++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json @@ -252,7 +252,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 9d5b331123..d34a3fb87d 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -507,4 +507,5 @@ erpnext.patches.v10_0.set_discount_amount erpnext.patches.v10_0.recalculate_gross_margin_for_project erpnext.patches.v10_0.delete_hub_documents erpnext.patches.v10_0.update_user_image_in_employee -erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items \ No newline at end of file +erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items +erpnext.patches.v10_0.allow_operators_in_supplier_scorecard \ No newline at end of file diff --git a/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py b/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py new file mode 100644 index 0000000000..27478f3ad5 --- /dev/null +++ b/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py @@ -0,0 +1,19 @@ +# Copyright (c) 2019, Frappe and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + for criteria in frappe.get_all('Supplier Scorecard Criteria', fields=['name', 'formula'], limit_page_length=None): + frappe.db.set_value('Supplier Scorecard Criteria', criteria.name, + 'formula', criteria.formula.replace('<','<').replace('>','>')) + + for criteria in frappe.get_all('Supplier Scorecard Scoring Criteria', fields=['name', 'formula'], limit_page_length=None): + if criteria.formula: # not mandatory + frappe.db.set_value('Supplier Scorecard Scoring Criteria', criteria.name, + 'formula', criteria.formula.replace('<','<').replace('>','>')) + + for sc in frappe.get_all('Supplier Scorecard', fields=['name', 'weighting_function'], limit_page_length=None): + frappe.db.set_value('Supplier Scorecard', sc.name, 'weighting_function', + sc.weighting_function.replace('<','<').replace('>','>')) \ No newline at end of file From e9778d9556d37dd89c00c4c0a8de802fc112551f Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Wed, 23 Jan 2019 16:58:42 +0530 Subject: [PATCH 11/20] fix: do not use built-in "input", reload_doc --- .../supplier_scorecard_period/supplier_scorecard_period.py | 4 ++-- .../patches/v10_0/allow_operators_in_supplier_scorecard.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py index 15ba3f93ba..737ddd6ddd 100644 --- a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py +++ b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py @@ -61,8 +61,8 @@ class SupplierScorecardPeriod(Document): return weighed_score - def get_eval_statement(self, input): - my_eval_statement = input.replace("\r", "").replace("\n", "") + def get_eval_statement(self, formula): + my_eval_statement = formula.replace("\r", "").replace("\n", "") for var in self.variables: if var.value: diff --git a/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py b/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py index 27478f3ad5..827f9bc94f 100644 --- a/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py +++ b/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py @@ -5,6 +5,10 @@ from __future__ import unicode_literals import frappe def execute(): + frappe.reload_doc('buying', 'doctype', 'supplier_scorecard_criteria') + frappe.reload_doc('buying', 'doctype', 'supplier_scorecard_scoring_criteria') + frappe.reload_doc('buying', 'doctype', 'supplier_scorecard') + for criteria in frappe.get_all('Supplier Scorecard Criteria', fields=['name', 'formula'], limit_page_length=None): frappe.db.set_value('Supplier Scorecard Criteria', criteria.name, 'formula', criteria.formula.replace('<','<').replace('>','>')) From c6c1628c8a4363fdcda2e6dadb84cf7cf6670276 Mon Sep 17 00:00:00 2001 From: scmmishra Date: Mon, 21 Jan 2019 19:35:46 +0530 Subject: [PATCH 12/20] [feat] Modified help config --- erpnext/public/js/conf.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/conf.js b/erpnext/public/js/conf.js index d256c08e13..040726957b 100644 --- a/erpnext/public/js/conf.js +++ b/erpnext/public/js/conf.js @@ -14,7 +14,7 @@ $(document).bind('toolbar_setup', function() { $('.navbar-home').html(''); - $('[data-link="docs"]').attr("href", "https://frappe.github.io/erpnext/") + $('[data-link="docs"]').attr("href", "https://erpnext.com/docs") $('[data-link="issues"]').attr("href", "https://github.com/frappe/erpnext/issues") @@ -23,7 +23,8 @@ $(document).bind('toolbar_setup', function() { // additional help links for erpnext var $help_menu = $('.dropdown-help ul .documentation-links'); - + $('
  • '+__('Documentation')+'
  • ').insertBefore($help_menu); $('
  • '+__('User Forum')+'
  • ').insertBefore($help_menu); $('
  • Date: Fri, 25 Jan 2019 12:56:27 +0530 Subject: [PATCH 13/20] [fix] Links now redirect to erpnext.com --- README.md | 2 +- erpnext/change_log/v6/v6_13_1.md | 2 +- erpnext/hooks.py | 2 -- erpnext/public/js/conf.js | 2 +- .../page/welcome_to_erpnext/welcome_to_erpnext.html | 2 +- erpnext/utilities/user_progress.py | 10 +++++----- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 74ea7fc8a5..d719873c76 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Includes: Accounting, Inventory, Manufacturing, CRM, Sales, Purchase, Project Ma ERPNext is built on the [FrappĂ©](https://github.com/frappe/frappe) Framework, a full-stack web app framework in Python & JavaScript. -- [User Guide](https://erpnext.org/docs/user) +- [User Guide](https://erpnext.com/docs/user) - [Discussion Forum](https://discuss.erpnext.com/) --- diff --git a/erpnext/change_log/v6/v6_13_1.md b/erpnext/change_log/v6/v6_13_1.md index 4b2c4a9cca..d5a930e3b9 100644 --- a/erpnext/change_log/v6/v6_13_1.md +++ b/erpnext/change_log/v6/v6_13_1.md @@ -1 +1 @@ -- [ERPNext Manual in German](http://erpnext.org/docs/user/manual/de/) contributed by [CWT Connector & Wire Technology GmbH](http://www.cwt-assembly.com/) +- [ERPNext Manual in German](http://erpnext.com/docs/user/manual/de/) contributed by [CWT Connector & Wire Technology GmbH](http://www.cwt-assembly.com/) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index ee31e32a3b..5f1e7d4243 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -15,8 +15,6 @@ develop_version = '10.x.x-develop' error_report_email = "support@erpnext.com" -docs_app = "foundation" - app_include_js = "assets/js/erpnext.min.js" app_include_css = "assets/css/erpnext.css" web_include_js = "assets/js/erpnext-web.min.js" diff --git a/erpnext/public/js/conf.js b/erpnext/public/js/conf.js index 040726957b..32cf065169 100644 --- a/erpnext/public/js/conf.js +++ b/erpnext/public/js/conf.js @@ -23,7 +23,7 @@ $(document).bind('toolbar_setup', function() { // additional help links for erpnext var $help_menu = $('.dropdown-help ul .documentation-links'); - $('
  • '+__('Documentation')+'
  • ').insertBefore($help_menu); $('
  • '+__('User Forum')+'
  • ').insertBefore($help_menu); diff --git a/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.html b/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.html index 57fce28eeb..5808ce73ee 100644 --- a/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.html +++ b/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.html @@ -22,7 +22,7 @@ diff --git a/erpnext/utilities/user_progress.py b/erpnext/utilities/user_progress.py index 9f5935e3cb..a6b5b49f08 100644 --- a/erpnext/utilities/user_progress.py +++ b/erpnext/utilities/user_progress.py @@ -33,7 +33,7 @@ def get_slide_settings(): help_links=[ { "label": _("Chart of Accounts"), - "url": ["https://erpnext.org/docs/user/manual/en/accounts/chart-of-accounts"] + "url": ["https://erpnext.com/docs/user/manual/en/accounts/chart-of-accounts"] }, { "label": _("Opening Balances"), @@ -56,7 +56,7 @@ def get_slide_settings(): help_links=[ { "label": _('Learn More'), - "url": ["https://erpnext.org/docs/user/manual/en/setting-up/setting-company-sales-goal"] + "url": ["https://erpnext.com/docs/user/manual/en/setting-up/setting-company-sales-goal"] } ] ), @@ -80,7 +80,7 @@ def get_slide_settings(): help_links=[ { "label": _('Learn More'), - "url": ["https://erpnext.org/docs/user/manual/en/CRM/customer.html"] + "url": ["https://erpnext.com/docs/user/manual/en/CRM/customer.html"] } ] ), @@ -123,7 +123,7 @@ def get_slide_settings(): help_links=[ { "label": _('Learn More'), - "url": ["https://erpnext.org/docs/user/manual/en/buying/supplier"] + "url": ["https://erpnext.com/docs/user/manual/en/buying/supplier"] }, { "label": _('Customers and Suppliers'), @@ -261,7 +261,7 @@ def get_slide_settings(): help_links=[ { "label": _('Learn More'), - "url": ["https://erpnext.org/docs/user/manual/en/setting-up/users-and-permissions"] + "url": ["https://erpnext.com/docs/user/manual/en/setting-up/users-and-permissions"] }, { "label": _('Users and Permissions'), From 000e2163548e6cb26f5d98e7c2475c06dcb6d2f2 Mon Sep 17 00:00:00 2001 From: scmmishra Date: Fri, 25 Jan 2019 13:14:11 +0530 Subject: [PATCH 14/20] [feat] Added docsUrl variable to configure help_links --- erpnext/public/js/help_links.js | 368 ++++++++++++++++---------------- 1 file changed, 183 insertions(+), 185 deletions(-) diff --git a/erpnext/public/js/help_links.js b/erpnext/public/js/help_links.js index d8af0e516d..d3cc688cd2 100644 --- a/erpnext/public/js/help_links.js +++ b/erpnext/public/js/help_links.js @@ -1,528 +1,526 @@ frappe.provide('frappe.help.help_links'); +const docsUrl = 'https://erpnext.com/docs/' + frappe.help.help_links['Form/Rename Tool'] = [ - { label: 'Bulk Rename', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/data/bulk-rename' }, + { label: 'Bulk Rename', url: docsUrl + 'user/manual/en/setting-up/data/bulk-rename' }, ] //Setup frappe.help.help_links['List/User'] = [ - { label: 'New User', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/users-and-permissions/adding-users' }, - { label: 'Rename User', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/rename-user' }, + { label: 'New User', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/adding-users' }, + { label: 'Rename User', url: docsUrl + 'user/manual/en/setting-up/articles/rename-user' }, ] frappe.help.help_links['permission-manager'] = [ - { label: 'Role Permissions Manager', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/users-and-permissions/role-based-permissions' }, - { label: 'Managing Perm Level in Permissions Manager', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/managing-perm-level' }, - { label: 'User Permissions', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/users-and-permissions/user-permissions' }, - { label: 'Sharing', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/users-and-permissions/sharing' }, - { label: 'Password', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/change-password' }, + { label: 'Role Permissions Manager', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/role-based-permissions' }, + { label: 'Managing Perm Level in Permissions Manager', url: docsUrl + 'user/manual/en/setting-up/articles/managing-perm-level' }, + { label: 'User Permissions', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/user-permissions' }, + { label: 'Sharing', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/sharing' }, + { label: 'Password', url: docsUrl + 'user/manual/en/setting-up/articles/change-password' }, ] frappe.help.help_links['Form/System Settings'] = [ - { label: 'Naming Series', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/settings/system-settings' }, + { label: 'Naming Series', url: docsUrl + 'user/manual/en/setting-up/settings/system-settings' }, ] frappe.help.help_links['data-import-tool'] = [ - { label: 'Importing and Exporting Data', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/data/data-import-tool' }, - { label: 'Overwriting Data from Data Import Tool', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool' }, + { label: 'Importing and Exporting Data', url: docsUrl + 'user/manual/en/setting-up/data/data-import-tool' }, + { label: 'Overwriting Data from Data Import Tool', url: docsUrl + 'user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool' }, ] frappe.help.help_links['module_setup'] = [ - { label: 'Role Permissions Manager', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/users-and-permissions/role-based-permissions' }, + { label: 'Role Permissions Manager', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/role-based-permissions' }, ] frappe.help.help_links['Form/Naming Series'] = [ - { label: 'Naming Series', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/settings/naming-series' }, - { label: 'Setting the Current Value for Naming Series', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/naming-series-current-value' }, + { label: 'Naming Series', url: docsUrl + 'user/manual/en/setting-up/settings/naming-series' }, + { label: 'Setting the Current Value for Naming Series', url: docsUrl + 'user/manual/en/setting-up/articles/naming-series-current-value' }, ] frappe.help.help_links['Form/Global Defaults'] = [ - { label: 'Global Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/settings/global-defaults' }, + { label: 'Global Settings', url: docsUrl + 'user/manual/en/setting-up/settings/global-defaults' }, ] frappe.help.help_links['Form/Email Digest'] = [ - { label: 'Email Digest', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/email-digest' }, + { label: 'Email Digest', url: docsUrl + 'user/manual/en/setting-up/email/email-digest' }, ] frappe.help.help_links['List/Print Heading'] = [ - { label: 'Print Heading', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/print-headings' }, + { label: 'Print Heading', url: docsUrl + 'user/manual/en/setting-up/print/print-headings' }, ] frappe.help.help_links['List/Letter Head'] = [ - { label: 'Letter Head', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/letter-head' }, + { label: 'Letter Head', url: docsUrl + 'user/manual/en/setting-up/print/letter-head' }, ] frappe.help.help_links['List/Address Template'] = [ - { label: 'Address Template', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/address-template' }, + { label: 'Address Template', url: docsUrl + 'user/manual/en/setting-up/print/address-template' }, ] frappe.help.help_links['List/Terms and Conditions'] = [ - { label: 'Terms and Conditions', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/terms-and-conditions' }, + { label: 'Terms and Conditions', url: docsUrl + 'user/manual/en/setting-up/print/terms-and-conditions' }, ] frappe.help.help_links['List/Cheque Print Template'] = [ - { label: 'Cheque Print Template', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/cheque-print-template' }, + { label: 'Cheque Print Template', url: docsUrl + 'user/manual/en/setting-up/print/cheque-print-template' }, ] frappe.help.help_links['List/Email Account'] = [ - { label: 'Email Account', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/email-account' }, + { label: 'Email Account', url: docsUrl + 'user/manual/en/setting-up/email/email-account' }, ] -frappe.help.help_links['List/Email Alert'] = [ - { label: 'Email Alert', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/email-alerts' }, +frappe.help.help_links['List/Notification'] = [ + { label: 'Notification', url: docsUrl + 'user/manual/en/setting-up/email/notifications' }, ] -frappe.help.help_links['Form/Email Alert'] = [ - { label: 'Email Alert', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/email-alerts' }, +frappe.help.help_links['Form/Notification'] = [ + { label: 'Notification', url: docsUrl + 'user/manual/en/setting-up/email/notifications' }, ] frappe.help.help_links['List/Email Digest'] = [ - { label: 'Email Digest', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/email-digest' }, + { label: 'Email Digest', url: docsUrl + 'user/manual/en/setting-up/email/email-digest' }, ] frappe.help.help_links['List/Auto Email Report'] = [ - { label: 'Auto Email Reports', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/email-reports' }, + { label: 'Auto Email Reports', url: docsUrl + 'user/manual/en/setting-up/email/email-reports' }, ] frappe.help.help_links['Form/Print Settings'] = [ - { label: 'Print Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/print-settings' }, + { label: 'Print Settings', url: docsUrl + 'user/manual/en/setting-up/print/print-settings' }, ] frappe.help.help_links['print-format-builder'] = [ - { label: 'Print Format Builder', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/print-settings' }, + { label: 'Print Format Builder', url: docsUrl + 'user/manual/en/setting-up/print/print-settings' }, ] frappe.help.help_links['List/Print Heading'] = [ - { label: 'Print Heading', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/print-headings' }, + { label: 'Print Heading', url: docsUrl + 'user/manual/en/setting-up/print/print-headings' }, ] //setup-integrations frappe.help.help_links['Form/PayPal Settings'] = [ - { label: 'PayPal Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/integrations/paypal-integration' }, + { label: 'PayPal Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/paypal-integration' }, ] frappe.help.help_links['Form/Razorpay Settings'] = [ - { label: 'Razorpay Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/integrations/razorpay-integration' }, + { label: 'Razorpay Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/razorpay-integration' }, ] frappe.help.help_links['Form/Dropbox Settings'] = [ - { label: 'Dropbox Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/integrations/dropbox-backup' }, + { label: 'Dropbox Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/dropbox-backup' }, ] frappe.help.help_links['Form/LDAP Settings'] = [ - { label: 'LDAP Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/integrations/ldap-integration' }, + { label: 'LDAP Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/ldap-integration' }, ] frappe.help.help_links['Form/Stripe Settings'] = [ - { label: 'Stripe Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/integrations/stripe-integration' }, + { label: 'Stripe Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/stripe-integration' }, ] //Sales frappe.help.help_links['Form/Quotation'] = [ - { label: 'Quotation', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/quotation' }, - { label: 'Applying Discount', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/applying-discount' }, - { label: 'Sales Person', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/sales-persons-in-the-sales-transactions' }, - { label: 'Applying Margin', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/adding-margin' }, + { label: 'Quotation', url: docsUrl + 'user/manual/en/selling/quotation' }, + { label: 'Applying Discount', url: docsUrl + 'user/manual/en/selling/articles/applying-discount' }, + { label: 'Sales Person', url: docsUrl + 'user/manual/en/selling/articles/sales-persons-in-the-sales-transactions' }, + { label: 'Applying Margin', url: docsUrl + 'user/manual/en/selling/articles/adding-margin' }, ] frappe.help.help_links['List/Customer'] = [ - { label: 'Customer', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/customer' }, - { label: 'Credit Limit', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/credit-limit' }, + { label: 'Customer', url: docsUrl + 'user/manual/en/CRM/customer' }, + { label: 'Credit Limit', url: docsUrl + 'user/manual/en/accounts/credit-limit' }, ] frappe.help.help_links['Form/Customer'] = [ - { label: 'Customer', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/customer' }, - { label: 'Credit Limit', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/credit-limit' }, + { label: 'Customer', url: docsUrl + 'user/manual/en/CRM/customer' }, + { label: 'Credit Limit', url: docsUrl + 'user/manual/en/accounts/credit-limit' }, ] frappe.help.help_links['List/Sales Taxes and Charges Template'] = [ - { label: 'Setting Up Taxes', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/setting-up-taxes' }, + { label: 'Setting Up Taxes', url: docsUrl + 'user/manual/en/setting-up/setting-up-taxes' }, ] frappe.help.help_links['Form/Sales Taxes and Charges Template'] = [ - { label: 'Setting Up Taxes', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/setting-up-taxes' }, + { label: 'Setting Up Taxes', url: docsUrl + 'user/manual/en/setting-up/setting-up-taxes' }, ] frappe.help.help_links['List/Sales Order'] = [ - { label: 'Sales Order', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/sales-order' }, - { label: 'Recurring Sales Order', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' }, - { label: 'Applying Discount', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/applying-discount' }, + { label: 'Sales Order', url: docsUrl + 'user/manual/en/selling/sales-order' }, + { label: 'Recurring Sales Order', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' }, + { label: 'Applying Discount', url: docsUrl + 'user/manual/en/selling/articles/applying-discount' }, ] frappe.help.help_links['Form/Sales Order'] = [ - { label: 'Sales Order', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/sales-order' }, - { label: 'Recurring Sales Order', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' }, - { label: 'Applying Discount', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/applying-discount' }, - { label: 'Drop Shipping', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/drop-shipping' }, - { label: 'Sales Person', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/sales-persons-in-the-sales-transactions' }, - { label: 'Close Sales Order', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/close-sales-order' }, - { label: 'Applying Margin', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/adding-margin' }, + { label: 'Sales Order', url: docsUrl + 'user/manual/en/selling/sales-order' }, + { label: 'Recurring Sales Order', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' }, + { label: 'Applying Discount', url: docsUrl + 'user/manual/en/selling/articles/applying-discount' }, + { label: 'Drop Shipping', url: docsUrl + 'user/manual/en/selling/articles/drop-shipping' }, + { label: 'Sales Person', url: docsUrl + 'user/manual/en/selling/articles/sales-persons-in-the-sales-transactions' }, + { label: 'Close Sales Order', url: docsUrl + 'user/manual/en/selling/articles/close-sales-order' }, + { label: 'Applying Margin', url: docsUrl + 'user/manual/en/selling/articles/adding-margin' }, ] frappe.help.help_links['Form/Product Bundle'] = [ - { label: 'Product Bundle', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/setup/product-bundle' }, + { label: 'Product Bundle', url: docsUrl + 'user/manual/en/selling/setup/product-bundle' }, ] frappe.help.help_links['Form/Selling Settings'] = [ - { label: 'Selling Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/setup/selling-settings' }, + { label: 'Selling Settings', url: docsUrl + 'user/manual/en/selling/setup/selling-settings' }, ] //Buying frappe.help.help_links['List/Supplier'] = [ - { label: 'Supplier', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/supplier' }, + { label: 'Supplier', url: docsUrl + 'user/manual/en/buying/supplier' }, ] frappe.help.help_links['Form/Supplier'] = [ - { label: 'Supplier', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/supplier' }, + { label: 'Supplier', url: docsUrl + 'user/manual/en/buying/supplier' }, ] frappe.help.help_links['Form/Request for Quotation'] = [ - { label: 'Request for Quotation', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/request-for-quotation' }, - { label: 'RFQ Video', url: 'https://frappe.github.io/erpnext/user/videos/learn/request-for-quotation.html' }, + { label: 'Request for Quotation', url: docsUrl + 'user/manual/en/buying/request-for-quotation' }, + { label: 'RFQ Video', url: docsUrl + 'user/videos/learn/request-for-quotation.html' }, ] frappe.help.help_links['Form/Supplier Quotation'] = [ - { label: 'Supplier Quotation', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/supplier-quotation' }, + { label: 'Supplier Quotation', url: docsUrl + 'user/manual/en/buying/supplier-quotation' }, ] frappe.help.help_links['Form/Buying Settings'] = [ - { label: 'Buying Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/setup/buying-settings' }, + { label: 'Buying Settings', url: docsUrl + 'user/manual/en/buying/setup/buying-settings' }, ] frappe.help.help_links['List/Purchase Order'] = [ - { label: 'Purchase Order', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/purchase-order' }, - { label: 'Recurring Purchase Order', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' }, + { label: 'Purchase Order', url: docsUrl + 'user/manual/en/buying/purchase-order' }, + { label: 'Recurring Purchase Order', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' }, ] frappe.help.help_links['Form/Purchase Order'] = [ - { label: 'Purchase Order', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/purchase-order' }, - { label: 'Item UoM', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/articles/purchasing-in-different-unit' }, - { label: 'Supplier Item Code', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/articles/maintaining-suppliers-part-no-in-item' }, - { label: 'Recurring Purchase Order', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' }, - { label: 'Subcontracting', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/subcontracting' }, + { label: 'Purchase Order', url: docsUrl + 'user/manual/en/buying/purchase-order' }, + { label: 'Item UoM', url: docsUrl + 'user/manual/en/buying/articles/purchasing-in-different-unit' }, + { label: 'Supplier Item Code', url: docsUrl + 'user/manual/en/buying/articles/maintaining-suppliers-part-no-in-item' }, + { label: 'Recurring Purchase Order', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' }, + { label: 'Subcontracting', url: docsUrl + 'user/manual/en/manufacturing/subcontracting' }, ] frappe.help.help_links['List/Purchase Taxes and Charges Template'] = [ - { label: 'Setting Up Taxes', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/setting-up-taxes' }, + { label: 'Setting Up Taxes', url: docsUrl + 'user/manual/en/setting-up/setting-up-taxes' }, ] frappe.help.help_links['List/POS Profile'] = [ - { label: 'POS Profile', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/pos-setting' }, + { label: 'POS Profile', url: docsUrl + 'user/manual/en/setting-up/pos-setting' }, ] frappe.help.help_links['List/Price List'] = [ - { label: 'Price List', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/price-lists' }, + { label: 'Price List', url: docsUrl + 'user/manual/en/setting-up/price-lists' }, ] frappe.help.help_links['List/Authorization Rule'] = [ - { label: 'Authorization Rule', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/authorization-rule' }, + { label: 'Authorization Rule', url: docsUrl + 'user/manual/en/setting-up/authorization-rule' }, ] frappe.help.help_links['Form/SMS Settings'] = [ - { label: 'SMS Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/sms-setting' }, + { label: 'SMS Settings', url: docsUrl + 'user/manual/en/setting-up/sms-setting' }, ] frappe.help.help_links['List/Stock Reconciliation'] = [ - { label: 'Stock Reconciliation', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item' }, + { label: 'Stock Reconciliation', url: docsUrl + 'user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item' }, ] frappe.help.help_links['Tree/Territory'] = [ - { label: 'Territory', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/territory' }, + { label: 'Territory', url: docsUrl + 'user/manual/en/setting-up/territory' }, ] frappe.help.help_links['Form/Dropbox Backup'] = [ - { label: 'Dropbox Backup', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/third-party-backups' }, - { label: 'Setting Up Dropbox Backup', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/setting-up-dropbox-backups' }, + { label: 'Dropbox Backup', url: docsUrl + 'user/manual/en/setting-up/third-party-backups' }, + { label: 'Setting Up Dropbox Backup', url: docsUrl + 'user/manual/en/setting-up/articles/setting-up-dropbox-backups' }, ] frappe.help.help_links['List/Workflow'] = [ - { label: 'Workflow', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/workflows' }, + { label: 'Workflow', url: docsUrl + 'user/manual/en/setting-up/workflows' }, ] frappe.help.help_links['List/Company'] = [ - { label: 'Company', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/company-setup' }, - { label: 'Managing Multiple Companies', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/managing-multiple-companies' }, - { label: 'Delete All Related Transactions for a Company', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions' }, + { label: 'Company', url: docsUrl + 'user/manual/en/setting-up/company-setup' }, + { label: 'Managing Multiple Companies', url: docsUrl + 'user/manual/en/setting-up/articles/managing-multiple-companies' }, + { label: 'Delete All Related Transactions for a Company', url: docsUrl + 'user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions' }, ] //Accounts frappe.help.help_links['modules/Accounts'] = [ - { label: 'Introduction to Accounts', url: 'http://frappe.github.io/erpnext/user/manual/en/accounts/' }, - { label: 'Chart of Accounts', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/chart-of-accounts.html' }, - { label: 'Multi Currency Accounting', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/multi-currency-accounting' }, + { label: 'Introduction to Accounts', url: 'http://erpnext.com/docs/user/manual/en/accounts/' }, + { label: 'Chart of Accounts', url: docsUrl + 'user/manual/en/accounts/chart-of-accounts.html' }, + { label: 'Multi Currency Accounting', url: docsUrl + 'user/manual/en/accounts/multi-currency-accounting' }, ] frappe.help.help_links['Tree/Account'] = [ - { label: 'Chart of Accounts', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/chart-of-accounts' }, - { label: 'Managing Tree Mastes', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/managing-tree-structure-masters' }, + { label: 'Chart of Accounts', url: docsUrl + 'user/manual/en/accounts/chart-of-accounts' }, + { label: 'Managing Tree Mastes', url: docsUrl + 'user/manual/en/setting-up/articles/managing-tree-structure-masters' }, ] frappe.help.help_links['Form/Sales Invoice'] = [ - { label: 'Sales Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/sales-invoice' }, - { label: 'Accounts Opening Balance', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/opening-accounts' }, - { label: 'Sales Return', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/sales-return' }, - { label: 'Recurring Sales Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' }, + { label: 'Sales Invoice', url: docsUrl + 'user/manual/en/accounts/sales-invoice' }, + { label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' }, + { label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' }, + { label: 'Recurring Sales Invoice', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' }, ] frappe.help.help_links['List/Sales Invoice'] = [ - { label: 'Sales Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/sales-invoice' }, - { label: 'Accounts Opening Balance', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/opening-accounts' }, - { label: 'Sales Return', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/sales-return' }, - { label: 'Recurring Sales Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' }, + { label: 'Sales Invoice', url: docsUrl + 'user/manual/en/accounts/sales-invoice' }, + { label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' }, + { label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' }, + { label: 'Recurring Sales Invoice', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' }, ] frappe.help.help_links['pos'] = [ - { label: 'Point of Sale Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/point-of-sale-pos-invoice' }, + { label: 'Point of Sale Invoice', url: docsUrl + 'user/manual/en/accounts/point-of-sale-pos-invoice' }, ] frappe.help.help_links['List/POS Profile'] = [ - { label: 'Point of Sale Profile', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/pos-setting' }, + { label: 'Point of Sale Profile', url: docsUrl + 'user/manual/en/setting-up/pos-setting' }, ] frappe.help.help_links['List/Purchase Invoice'] = [ - { label: 'Purchase Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/purchase-invoice' }, - { label: 'Accounts Opening Balance', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/opening-accounts' }, - { label: 'Recurring Purchase Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' }, + { label: 'Purchase Invoice', url: docsUrl + 'user/manual/en/accounts/purchase-invoice' }, + { label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' }, + { label: 'Recurring Purchase Invoice', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' }, ] frappe.help.help_links['List/Journal Entry'] = [ - { label: 'Journal Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/journal-entry' }, - { label: 'Advance Payment Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/advance-payment-entry' }, - { label: 'Accounts Opening Balance', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/opening-accounts' }, + { label: 'Journal Entry', url: docsUrl + 'user/manual/en/accounts/journal-entry' }, + { label: 'Advance Payment Entry', url: docsUrl + 'user/manual/en/accounts/advance-payment-entry' }, + { label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' }, ] frappe.help.help_links['List/Payment Entry'] = [ - { label: 'Payment Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/payment-entry' }, + { label: 'Payment Entry', url: docsUrl + 'user/manual/en/accounts/payment-entry' }, ] frappe.help.help_links['List/Payment Request'] = [ - { label: 'Payment Request', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/payment-request' }, + { label: 'Payment Request', url: docsUrl + 'user/manual/en/accounts/payment-request' }, ] frappe.help.help_links['List/Asset'] = [ - { label: 'Managing Fixed Assets', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/managing-fixed-assets' }, + { label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' }, ] frappe.help.help_links['List/Asset Category'] = [ - { label: 'Asset Category', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/managing-fixed-assets' }, + { label: 'Asset Category', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' }, ] frappe.help.help_links['Tree/Cost Center'] = [ - { label: 'Budgeting', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/budgeting' }, + { label: 'Budgeting', url: docsUrl + 'user/manual/en/accounts/budgeting' }, ] frappe.help.help_links['List/Item'] = [ - { label: 'Item', url: 'http://frappe.github.io/erpnext/user/manual/en/stock/item' }, - { label: 'Item Price', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-price' }, - { label: 'Barcode', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/track-items-using-barcode' }, - { label: 'Item Wise Taxation', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/item-wise-taxation' }, - { label: 'Managing Fixed Assets', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/managing-fixed-assets' }, - { label: 'Item Codification', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-codification' }, - { label: 'Item Variants', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-variants' }, - { label: 'Item Valuation', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-valuation-fifo-and-moving-average' }, + { label: 'Item', url: 'http://erpnext.com/docs/user/manual/en/stock/item' }, + { label: 'Item Price', url: docsUrl + 'user/manual/en/stock/item/item-price' }, + { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' }, + { label: 'Item Wise Taxation', url: docsUrl + 'user/manual/en/accounts/item-wise-taxation' }, + { label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' }, + { label: 'Item Codification', url: docsUrl + 'user/manual/en/stock/item/item-codification' }, + { label: 'Item Variants', url: docsUrl + 'user/manual/en/stock/item/item-variants' }, + { label: 'Item Valuation', url: docsUrl + 'user/manual/en/stock/item/item-valuation-fifo-and-moving-average' }, ] frappe.help.help_links['Form/Item'] = [ - { label: 'Item', url: 'http://frappe.github.io/erpnext/user/manual/en/stock/item' }, - { label: 'Item Price', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-price' }, - { label: 'Barcode', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/track-items-using-barcode' }, - { label: 'Item Wise Taxation', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/item-wise-taxation' }, - { label: 'Managing Fixed Assets', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/managing-fixed-assets' }, - { label: 'Item Codification', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-codification' }, - { label: 'Item Variants', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-variants' }, - { label: 'Item Valuation', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-valuation-fifo-and-moving-average' }, + { label: 'Item', url: 'http://erpnext.com/docs/user/manual/en/stock/item' }, + { label: 'Item Price', url: docsUrl + 'user/manual/en/stock/item/item-price' }, + { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' }, + { label: 'Item Wise Taxation', url: docsUrl + 'user/manual/en/accounts/item-wise-taxation' }, + { label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' }, + { label: 'Item Codification', url: docsUrl + 'user/manual/en/stock/item/item-codification' }, + { label: 'Item Variants', url: docsUrl + 'user/manual/en/stock/item/item-variants' }, + { label: 'Item Valuation', url: docsUrl + 'user/manual/en/stock/item/item-valuation-fifo-and-moving-average' }, ] frappe.help.help_links['List/Purchase Receipt'] = [ - { label: 'Purchase Receipt', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/purchase-receipt' }, - { label: 'Barcode', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/track-items-using-barcode' }, + { label: 'Purchase Receipt', url: docsUrl + 'user/manual/en/stock/purchase-receipt' }, + { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' }, ] frappe.help.help_links['List/Delivery Note'] = [ - { label: 'Delivery Note', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/delivery-note' }, - { label: 'Barcode', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/track-items-using-barcode' }, - { label: 'Sales Return', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/sales-return' }, + { label: 'Delivery Note', url: docsUrl + 'user/manual/en/stock/delivery-note' }, + { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' }, + { label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' }, ] frappe.help.help_links['Form/Delivery Note'] = [ - { label: 'Delivery Note', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/delivery-note' }, - { label: 'Sales Return', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/sales-return' }, - { label: 'Barcode', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/track-items-using-barcode' }, - { label: 'Subcontracting', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/subcontracting' }, + { label: 'Delivery Note', url: docsUrl + 'user/manual/en/stock/delivery-note' }, + { label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' }, + { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' }, + { label: 'Subcontracting', url: docsUrl + 'user/manual/en/manufacturing/subcontracting' }, ] frappe.help.help_links['List/Installation Note'] = [ - { label: 'Installation Note', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/installation-note' }, + { label: 'Installation Note', url: docsUrl + 'user/manual/en/stock/installation-note' }, ] frappe.help.help_links['Tree'] = [ - { label: 'Managing Tree Structure Masters', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/managing-tree-structure-masters' }, + { label: 'Managing Tree Structure Masters', url: docsUrl + 'user/manual/en/setting-up/articles/managing-tree-structure-masters' }, ] frappe.help.help_links['List/Budget'] = [ - { label: 'Budgeting', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/budgeting' }, + { label: 'Budgeting', url: docsUrl + 'user/manual/en/accounts/budgeting' }, ] //Stock frappe.help.help_links['List/Material Request'] = [ - { label: 'Material Request', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/material-request' }, - { label: 'Auto-creation of Material Request', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/auto-creation-of-material-request' }, + { label: 'Material Request', url: docsUrl + 'user/manual/en/stock/material-request' }, + { label: 'Auto-creation of Material Request', url: docsUrl + 'user/manual/en/stock/articles/auto-creation-of-material-request' }, ] frappe.help.help_links['Form/Material Request'] = [ - { label: 'Material Request', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/material-request' }, - { label: 'Auto-creation of Material Request', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/auto-creation-of-material-request' }, + { label: 'Material Request', url: docsUrl + 'user/manual/en/stock/material-request' }, + { label: 'Auto-creation of Material Request', url: docsUrl + 'user/manual/en/stock/articles/auto-creation-of-material-request' }, ] frappe.help.help_links['Form/Stock Entry'] = [ - { label: 'Stock Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/stock-entry' }, - { label: 'Stock Entry Types', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/stock-entry-purpose' }, - { label: 'Repack Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/repack-entry' }, - { label: 'Opening Stock', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/opening-stock' }, - { label: 'Subcontracting', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/subcontracting' }, + { label: 'Stock Entry', url: docsUrl + 'user/manual/en/stock/stock-entry' }, + { label: 'Stock Entry Types', url: docsUrl + 'user/manual/en/stock/articles/stock-entry-purpose' }, + { label: 'Repack Entry', url: docsUrl + 'user/manual/en/stock/articles/repack-entry' }, + { label: 'Opening Stock', url: docsUrl + 'user/manual/en/stock/opening-stock' }, + { label: 'Subcontracting', url: docsUrl + 'user/manual/en/manufacturing/subcontracting' }, ] frappe.help.help_links['List/Stock Entry'] = [ - { label: 'Stock Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/stock-entry' }, + { label: 'Stock Entry', url: docsUrl + 'user/manual/en/stock/stock-entry' }, ] frappe.help.help_links['Tree/Warehouse'] = [ - { label: 'Warehouse', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/warehouse' }, + { label: 'Warehouse', url: docsUrl + 'user/manual/en/stock/warehouse' }, ] frappe.help.help_links['List/Serial No'] = [ - { label: 'Serial No', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/serial-no' }, + { label: 'Serial No', url: docsUrl + 'user/manual/en/stock/serial-no' }, ] frappe.help.help_links['Form/Serial No'] = [ - { label: 'Serial No', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/serial-no' }, + { label: 'Serial No', url: docsUrl + 'user/manual/en/stock/serial-no' }, ] frappe.help.help_links['Form/Batch'] = [ - { label: 'Batch', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/batch' }, + { label: 'Batch', url: docsUrl + 'user/manual/en/stock/batch' }, ] frappe.help.help_links['Form/Packing Slip'] = [ - { label: 'Packing Slip', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/tools/packing-slip' }, + { label: 'Packing Slip', url: docsUrl + 'user/manual/en/stock/tools/packing-slip' }, ] frappe.help.help_links['Form/Quality Inspection'] = [ - { label: 'Quality Inspection', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/tools/quality-inspection' }, + { label: 'Quality Inspection', url: docsUrl + 'user/manual/en/stock/tools/quality-inspection' }, ] frappe.help.help_links['Form/Landed Cost Voucher'] = [ - { label: 'Landed Cost Voucher', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/tools/landed-cost-voucher' }, + { label: 'Landed Cost Voucher', url: docsUrl + 'user/manual/en/stock/tools/landed-cost-voucher' }, ] frappe.help.help_links['Tree/Item Group'] = [ - { label: 'Item Group', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/setup/item-group' }, + { label: 'Item Group', url: docsUrl + 'user/manual/en/stock/setup/item-group' }, ] frappe.help.help_links['Form/Item Attribute'] = [ - { label: 'Item Attribute', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/setup/item-attribute' }, + { label: 'Item Attribute', url: docsUrl + 'user/manual/en/stock/setup/item-attribute' }, ] frappe.help.help_links['Form/UOM'] = [ - { label: 'Fractions in UOM', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/managing-fractions-in-uom' }, + { label: 'Fractions in UOM', url: docsUrl + 'user/manual/en/stock/articles/managing-fractions-in-uom' }, ] frappe.help.help_links['Form/Stock Reconciliation'] = [ - { label: 'Opening Stock Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/opening-stock' }, + { label: 'Opening Stock Entry', url: docsUrl + 'user/manual/en/stock/opening-stock' }, ] //CRM frappe.help.help_links['Form/Lead'] = [ - { label: 'Lead', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/lead' }, + { label: 'Lead', url: docsUrl + 'user/manual/en/CRM/lead' }, ] frappe.help.help_links['Form/Opportunity'] = [ - { label: 'Opportunity', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/opportunity' }, + { label: 'Opportunity', url: docsUrl + 'user/manual/en/CRM/opportunity' }, ] frappe.help.help_links['Form/Address'] = [ - { label: 'Address', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/contact' }, + { label: 'Address', url: docsUrl + 'user/manual/en/CRM/contact' }, ] frappe.help.help_links['Form/Contact'] = [ - { label: 'Contact', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/contact' }, + { label: 'Contact', url: docsUrl + 'user/manual/en/CRM/contact' }, ] frappe.help.help_links['Form/Newsletter'] = [ - { label: 'Newsletter', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/newsletter' }, + { label: 'Newsletter', url: docsUrl + 'user/manual/en/CRM/newsletter' }, ] frappe.help.help_links['Form/Campaign'] = [ - { label: 'Campaign', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/setup/campaign' }, + { label: 'Campaign', url: docsUrl + 'user/manual/en/CRM/setup/campaign' }, ] frappe.help.help_links['Tree/Sales Person'] = [ - { label: 'Sales Person', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/setup/sales-person' }, + { label: 'Sales Person', url: docsUrl + 'user/manual/en/CRM/setup/sales-person' }, ] frappe.help.help_links['Form/Sales Person'] = [ - { label: 'Sales Person Target', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/setup/sales-person-target-allocation' }, + { label: 'Sales Person Target', url: docsUrl + 'user/manual/en/selling/setup/sales-person-target-allocation' }, ] //Support frappe.help.help_links['List/Feedback Trigger'] = [ - { label: 'Feedback Trigger', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/feedback/setting-up-feedback' }, + { label: 'Feedback Trigger', url: docsUrl + 'user/manual/en/setting-up/feedback/setting-up-feedback' }, ] frappe.help.help_links['List/Feedback Request'] = [ - { label: 'Feedback Request', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/feedback/submit-feedback' }, + { label: 'Feedback Request', url: docsUrl + 'user/manual/en/setting-up/feedback/submit-feedback' }, ] frappe.help.help_links['List/Feedback Request'] = [ - { label: 'Feedback Request', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/feedback/submit-feedback' }, + { label: 'Feedback Request', url: docsUrl + 'user/manual/en/setting-up/feedback/submit-feedback' }, ] //Manufacturing frappe.help.help_links['Form/BOM'] = [ - { label: 'Bill of Material', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/bill-of-materials' }, - { label: 'Nested BOM Structure', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/articles/nested-bom-structure' }, + { label: 'Bill of Material', url: docsUrl + 'user/manual/en/manufacturing/bill-of-materials' }, + { label: 'Nested BOM Structure', url: docsUrl + 'user/manual/en/manufacturing/articles/nested-bom-structure' }, ] -frappe.help.help_links['Form/Production Order'] = [ - { label: 'Production Order', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/production-order' }, +frappe.help.help_links['Form/Work Order'] = [ + { label: 'Work Order', url: docsUrl + 'user/manual/en/manufacturing/work-order' }, ] frappe.help.help_links['Form/Workstation'] = [ - { label: 'Workstation', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/workstation' }, + { label: 'Workstation', url: docsUrl + 'user/manual/en/manufacturing/workstation' }, ] frappe.help.help_links['Form/Operation'] = [ - { label: 'Operation', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/operation' }, -] - -frappe.help.help_links['Form/Production Planning Tool'] = [ - { label: 'Production Planning Tool', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/tools/production-planning-tool' }, + { label: 'Operation', url: docsUrl + 'user/manual/en/manufacturing/operation' }, ] frappe.help.help_links['Form/BOM Update Tool'] = [ - { label: 'BOM Update Tool', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/tools/bom-update-tool' }, + { label: 'BOM Update Tool', url: docsUrl + 'user/manual/en/manufacturing/tools/bom-update-tool' }, ] //Customize frappe.help.help_links['Form/Customize Form'] = [ - { label: 'Custom Field', url: 'https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/custom-field' }, - { label: 'Customize Field', url: 'https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/customize-form' }, + { label: 'Custom Field', url: docsUrl + 'user/manual/en/customize-erpnext/custom-field' }, + { label: 'Customize Field', url: docsUrl + 'user/manual/en/customize-erpnext/customize-form' }, ] frappe.help.help_links['Form/Custom Field'] = [ - { label: 'Custom Field', url: 'https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/custom-field' }, + { label: 'Custom Field', url: docsUrl + 'user/manual/en/customize-erpnext/custom-field' }, ] frappe.help.help_links['Form/Custom Field'] = [ - { label: 'Custom Field', url: 'https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/custom-field' }, + { label: 'Custom Field', url: docsUrl + 'user/manual/en/customize-erpnext/custom-field' }, ] \ No newline at end of file From e1f5d22a02e2a139867c296edfc5b0b09a0035c2 Mon Sep 17 00:00:00 2001 From: scmmishra Date: Fri, 25 Jan 2019 14:27:23 +0530 Subject: [PATCH 15/20] [fix] Code formatting, removed trailing spaces --- erpnext/public/js/help_links.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/public/js/help_links.js b/erpnext/public/js/help_links.js index d3cc688cd2..23e7deb6e9 100644 --- a/erpnext/public/js/help_links.js +++ b/erpnext/public/js/help_links.js @@ -1,6 +1,6 @@ frappe.provide('frappe.help.help_links'); -const docsUrl = 'https://erpnext.com/docs/' +const docsUrl = 'https://erpnext.com/docs/'; frappe.help.help_links['Form/Rename Tool'] = [ { label: 'Bulk Rename', url: docsUrl + 'user/manual/en/setting-up/data/bulk-rename' }, @@ -320,12 +320,12 @@ frappe.help.help_links['Tree/Cost Center'] = [ frappe.help.help_links['List/Item'] = [ { label: 'Item', url: 'http://erpnext.com/docs/user/manual/en/stock/item' }, - { label: 'Item Price', url: docsUrl + 'user/manual/en/stock/item/item-price' }, + { label: 'Item Price', url: docsUrl + 'user/manual/en/stock/item/item-price' }, { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' }, { label: 'Item Wise Taxation', url: docsUrl + 'user/manual/en/accounts/item-wise-taxation' }, { label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' }, { label: 'Item Codification', url: docsUrl + 'user/manual/en/stock/item/item-codification' }, - { label: 'Item Variants', url: docsUrl + 'user/manual/en/stock/item/item-variants' }, + { label: 'Item Variants', url: docsUrl + 'user/manual/en/stock/item/item-variants' }, { label: 'Item Valuation', url: docsUrl + 'user/manual/en/stock/item/item-valuation-fifo-and-moving-average' }, ] @@ -336,8 +336,8 @@ frappe.help.help_links['Form/Item'] = [ { label: 'Item Wise Taxation', url: docsUrl + 'user/manual/en/accounts/item-wise-taxation' }, { label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' }, { label: 'Item Codification', url: docsUrl + 'user/manual/en/stock/item/item-codification' }, - { label: 'Item Variants', url: docsUrl + 'user/manual/en/stock/item/item-variants' }, - { label: 'Item Valuation', url: docsUrl + 'user/manual/en/stock/item/item-valuation-fifo-and-moving-average' }, + { label: 'Item Variants', url: docsUrl + 'user/manual/en/stock/item/item-variants' }, + { label: 'Item Valuation', url: docsUrl + 'user/manual/en/stock/item/item-valuation-fifo-and-moving-average' }, ] frappe.help.help_links['List/Purchase Receipt'] = [ From 1b63fa19207977cc5c7ccdf0343afc30fe914b0a Mon Sep 17 00:00:00 2001 From: scmmishra Date: Fri, 25 Jan 2019 14:56:30 +0530 Subject: [PATCH 16/20] [fix] Formatting issues --- erpnext/public/js/help_links.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/help_links.js b/erpnext/public/js/help_links.js index 23e7deb6e9..458276eceb 100644 --- a/erpnext/public/js/help_links.js +++ b/erpnext/public/js/help_links.js @@ -326,12 +326,12 @@ frappe.help.help_links['List/Item'] = [ { label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' }, { label: 'Item Codification', url: docsUrl + 'user/manual/en/stock/item/item-codification' }, { label: 'Item Variants', url: docsUrl + 'user/manual/en/stock/item/item-variants' }, - { label: 'Item Valuation', url: docsUrl + 'user/manual/en/stock/item/item-valuation-fifo-and-moving-average' }, + { label: 'Item Valuation', url: docsUrl + 'user/manual/en/stock/item/item-valuation-fifo-and-moving-average' }, ] frappe.help.help_links['Form/Item'] = [ { label: 'Item', url: 'http://erpnext.com/docs/user/manual/en/stock/item' }, - { label: 'Item Price', url: docsUrl + 'user/manual/en/stock/item/item-price' }, + { label: 'Item Price', url: docsUrl + 'user/manual/en/stock/item/item-price' }, { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' }, { label: 'Item Wise Taxation', url: docsUrl + 'user/manual/en/accounts/item-wise-taxation' }, { label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' }, From aac404a155c5d0d3b2a7cfcc5b940ee2aa33248d Mon Sep 17 00:00:00 2001 From: navdeepghai1 Date: Mon, 28 Jan 2019 10:42:16 +0400 Subject: [PATCH 17/20] Fixed net_pay calculation issue --- erpnext/hr/doctype/salary_slip/salary_slip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 3ee98e6be0..901ede1197 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -360,7 +360,7 @@ class SalarySlip(TransactionBase): elif not d.amount: d.amount = d.default_amount if not d.do_not_include_in_total: - self.set(total_field, self.get(total_field) + flt(d.amount)) + self.set(total_field, self.get(total_field) + flt(d.amount, 2)) def calculate_net_pay(self): if self.salary_structure: @@ -473,4 +473,4 @@ def unlink_ref_doc_from_salary_slip(ref_no): if linked_ss: for ss in linked_ss: ss_doc = frappe.get_doc("Salary Slip", ss) - frappe.db.set_value("Salary Slip", ss_doc.name, "journal_entry", "") \ No newline at end of file + frappe.db.set_value("Salary Slip", ss_doc.name, "journal_entry", "") From 92bb84aa70270a8f6b278c040eff9dbd1097b1b5 Mon Sep 17 00:00:00 2001 From: navdeepghai1 Date: Mon, 28 Jan 2019 16:54:58 +0400 Subject: [PATCH 18/20] Changed static precision(2) value to system setting currency_precision value --- erpnext/hr/doctype/salary_slip/salary_slip.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 901ede1197..11538cc368 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -330,7 +330,7 @@ class SalarySlip(TransactionBase): if frappe.db.get_value('Timesheet', data.time_sheet, 'status') == 'Payrolled': frappe.throw(_("Salary Slip of employee {0} already created for time sheet {1}").format(self.employee, data.time_sheet)) - def sum_components(self, component_type, total_field): + def sum_components(self, component_type, total_field, precision): joining_date, relieving_date = frappe.db.get_value("Employee", self.employee, ["date_of_joining", "relieving_date"]) @@ -350,7 +350,7 @@ class SalarySlip(TransactionBase): )): d.amount = rounded( - (flt(d.default_amount) * flt(self.payment_days) + (flt(d.default_amount, precision) * flt(self.payment_days) / cint(self.total_working_days)), self.precision("amount", component_type) ) @@ -360,19 +360,19 @@ class SalarySlip(TransactionBase): elif not d.amount: d.amount = d.default_amount if not d.do_not_include_in_total: - self.set(total_field, self.get(total_field) + flt(d.amount, 2)) + self.set(total_field, self.get(total_field) + flt(d.amount, precision)) def calculate_net_pay(self): if self.salary_structure: self.calculate_component_amounts() disable_rounded_total = cint(frappe.db.get_value("Global Defaults", None, "disable_rounded_total")) - + precision = frappe.defaults.get_global_default("currency_precision") self.total_deduction = 0 self.gross_pay = 0 - self.sum_components('earnings', 'gross_pay') - self.sum_components('deductions', 'total_deduction') + self.sum_components('earnings', 'gross_pay', precision) + self.sum_components('deductions', 'total_deduction', precision) self.set_loan_repayment() From 9acb885e60f77cd4e9ea8c98bdc39c18abcac731 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 29 Jan 2019 10:52:37 +0530 Subject: [PATCH 19/20] fix(sqli): Avoid SQL Injection with sender param (#16509) --- erpnext/templates/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/templates/utils.py b/erpnext/templates/utils.py index eb84bcc8d8..8e14c067f1 100644 --- a/erpnext/templates/utils.py +++ b/erpnext/templates/utils.py @@ -16,7 +16,7 @@ def send_message(subject="Website Query", message="", sender="", status="Open"): customer = frappe.db.sql("""select distinct dl.link_name from `tabDynamic Link` dl left join `tabContact` c on dl.parent=c.name where dl.link_doctype='Customer' - and c.email_id='{email_id}'""".format(email_id=sender)) + and c.email_id = %s""", sender) if not customer: lead = frappe.db.get_value('Lead', dict(email_id=sender)) From b32d9458b5ed456fbb3c629cfd886fcb7eb1375d Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Tue, 29 Jan 2019 17:30:19 +0550 Subject: [PATCH 20/20] bumped to version 10.1.81 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 847618232c..c1090e9e0a 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.1.80' +__version__ = '10.1.81' def get_default_company(user=None): '''Get default company for user'''