Skip to content

Commit

Permalink
Merge pull request #170 from frappe/mergify/bp/version-15/pr-162
Browse files Browse the repository at this point in the history
fix: remove company filter from customer and member in applicant field (backport #162)
  • Loading branch information
deepeshgarg007 authored Mar 3, 2024
2 parents ddfa4f4 + 74a1a58 commit 34a2d1d
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions lending/public/js/loan_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,28 @@ lending.common = {
erpnext.hide_company();
frm.trigger("set_company_filter");
},

applicant_type: function(frm) {
frm.trigger("set_company_filter");
},
set_company_filter: function(frm) {
if (
["Loan Application", "Loan"].includes(frm.doc.doctype) &&
frm.doc.applicant_type === "Employee"
) {
frm.set_query("applicant", function() {
return {
"filters": {
"company": frm.doc.company
}
};
});
if (["Loan Application", "Loan"].includes(frm.doc.doctype)) {
if (frm.doc.applicant_type === "Employee") {
frm.set_query("applicant", function() {
return {
"filters": {
"company": frm.doc.company
}
};
});
} else {
frm.set_query("applicant", function() {
return {
"filters": {
"docstatus": 0
}
};
});
}
}
},

Expand Down

0 comments on commit 34a2d1d

Please sign in to comment.