Employee Loan Should Be Limited To Employee Company (#10039) (#10093)
* filter employee drop down by company name
* codacy fix
diff --git a/erpnext/hr/doctype/employee_loan/employee_loan.js b/erpnext/hr/doctype/employee_loan/employee_loan.js
index 9720bcb..33d3a85 100644
--- a/erpnext/hr/doctype/employee_loan/employee_loan.js
+++ b/erpnext/hr/doctype/employee_loan/employee_loan.js
@@ -23,6 +23,14 @@
};
});
+ frm.set_query("employee", function() {
+ return {
+ "filters": {
+ "company": frm.doc.company,
+ }
+ };
+ });
+
$.each(["payment_account", "employee_loan_account"], function (i, field) {
frm.set_query(field, function () {
return {