From 3819c0bf2845652f5a1c6f2c5ed63ebba22f03ea Mon Sep 17 00:00:00 2001 From: Afshan Date: Mon, 6 Jul 2020 23:52:11 +0530 Subject: [PATCH 1/2] fix: cost center should only show option of selectedcompany --- erpnext/hr/doctype/expense_claim/expense_claim.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js index 8f8dafdd7f..b6651e271f 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.js +++ b/erpnext/hr/doctype/expense_claim/expense_claim.js @@ -113,6 +113,14 @@ cur_frm.cscript.calculate_total_amount = function(doc,cdt,cdn){ cur_frm.cscript.calculate_total(doc,cdt,cdn); }; +cur_frm.fields_dict['cost_center'].get_query = function(doc) { + return { + filters: { + "company": doc.company + } + } +} + erpnext.expense_claim = { set_title: function(frm) { if (!frm.doc.task) { From 70b3edd502eb8144144ef2151adea11f60bea8f2 Mon Sep 17 00:00:00 2001 From: Afshan Date: Tue, 7 Jul 2020 00:03:45 +0530 Subject: [PATCH 2/2] fix: format according to cordacy --- erpnext/hr/doctype/expense_claim/expense_claim.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js index b6651e271f..221300b519 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.js +++ b/erpnext/hr/doctype/expense_claim/expense_claim.js @@ -119,7 +119,7 @@ cur_frm.fields_dict['cost_center'].get_query = function(doc) { "company": doc.company } } -} +}; erpnext.expense_claim = { set_title: function(frm) {