From 40b7ac4987cfd76e8226e924a8bf098592262662 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Sun, 15 Dec 2019 21:20:55 +0530 Subject: [PATCH] fix: Minor filter fix in expense claim type --- erpnext/hr/doctype/expense_claim/expense_claim.js | 6 +++--- erpnext/hr/doctype/expense_claim/expense_claim.json | 5 ++++- erpnext/hr/doctype/expense_claim_type/expense_claim_type.js | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js index 570f2ef4c7..e0bfc83a9b 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.js +++ b/erpnext/hr/doctype/expense_claim/expense_claim.js @@ -243,11 +243,11 @@ frappe.ui.form.on("Expense Claim", { update_employee_advance_claimed_amount: function(frm) { let amount_to_be_allocated = frm.doc.grand_total; - $.each(frm.doc.advances || [], function(i, advance){ - if (amount_to_be_allocated >= advance.unclaimed_amount){ + $.each(frm.doc.advances || [], function(i, advance) { + if (amount_to_be_allocated >= advance.unclaimed_amount) { frm.doc.advances[i].allocated_amount = frm.doc.advances[i].unclaimed_amount; amount_to_be_allocated -= advance.allocated_amount; - } else{ + } else { frm.doc.advances[i].allocated_amount = amount_to_be_allocated; amount_to_be_allocated = 0; } diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.json b/erpnext/hr/doctype/expense_claim/expense_claim.json index b5b6823e1c..96baaab595 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.json +++ b/erpnext/hr/doctype/expense_claim/expense_claim.json @@ -1,4 +1,5 @@ { + "actions": [], "allow_import": 1, "autoname": "naming_series:", "creation": "2013-01-10 16:34:14", @@ -43,6 +44,7 @@ "accounting_dimensions_section", "project", "dimension_col_break", + "cost_center", "more_details", "status", "amended_from", @@ -365,7 +367,8 @@ "icon": "fa fa-money", "idx": 1, "is_submittable": 1, - "modified": "2019-11-09 14:13:08.964547", + "links": [], + "modified": "2019-12-14 23:52:05.388458", "modified_by": "Administrator", "module": "HR", "name": "Expense Claim", diff --git a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.js b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.js index c487797677..d007e1a6c2 100644 --- a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.js +++ b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.js @@ -2,10 +2,10 @@ // License: GNU General Public License v3. See license.txt frappe.ui.form.on("Expense Claim Type", { - refresh: function(frm){ - frm.fields_dict["accounts"].grid.get_field("default_account").get_query = function(frm, cdt, cdn){ + refresh: function(frm) { + frm.fields_dict["accounts"].grid.get_field("default_account").get_query = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; - return{ + return { filters: { "is_group": 0, "root_type": frm.doc.deferred_expense_account ? "Asset" : "Expense",