fix: Added Company filters for Loan (#26294)

* fix: loan validations

* fix: added company filter while fetching loans

* fix: tests
This commit is contained in:
Jannat Patel
2021-07-12 13:01:31 +05:30
committed by GitHub
parent 10473b1195
commit 38994bd494
5 changed files with 38 additions and 25 deletions

View File

@@ -28,7 +28,8 @@ frappe.ui.form.on('Loan', {
frm.set_query("loan_type", function () {
return {
"filters": {
"docstatus": 1
"docstatus": 1,
"company": frm.doc.company
}
};
});

View File

@@ -14,6 +14,13 @@ frappe.ui.form.on('Loan Application', {
refresh: function(frm) {
frm.trigger("toggle_fields");
frm.trigger("add_toolbar_buttons");
frm.set_query('loan_type', () => {
return {
filters: {
company: frm.doc.company
}
};
});
},
repayment_method: function(frm) {
frm.doc.repayment_amount = frm.doc.repayment_periods = ""