Skip to content

Commit

Permalink
Merge pull request #162 from Nihantra-Patel/fix_filter_loan
Browse files Browse the repository at this point in the history
fix: remove company filter from customer and member in applicant field
  • Loading branch information
deepeshgarg007 authored Feb 18, 2024
2 parents 9420294 + 48cfe47 commit 21a19b6
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 21a19b6

Please sign in to comment.