mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
fix: added company filter while fetching loans (#26296)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
This commit is contained in:
@@ -15,6 +15,15 @@ frappe.ui.form.on('Loan', {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
frm.set_query("loan_type", function () {
|
||||||
|
return {
|
||||||
|
"filters": {
|
||||||
|
"docstatus": 1,
|
||||||
|
"company": frm.doc.company
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
frm.set_query("interest_income_account", function () {
|
frm.set_query("interest_income_account", function () {
|
||||||
return {
|
return {
|
||||||
"filters": {
|
"filters": {
|
||||||
|
|||||||
@@ -5,8 +5,15 @@
|
|||||||
|
|
||||||
frappe.ui.form.on('Loan Application', {
|
frappe.ui.form.on('Loan Application', {
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
frm.trigger("toggle_fields")
|
frm.trigger("toggle_fields");
|
||||||
frm.trigger("add_toolbar_buttons")
|
frm.trigger("add_toolbar_buttons");
|
||||||
|
frm.set_query('loan_type', () => {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
company: frm.doc.company
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
},
|
},
|
||||||
repayment_method: function(frm) {
|
repayment_method: function(frm) {
|
||||||
frm.doc.repayment_amount = frm.doc.repayment_periods = ""
|
frm.doc.repayment_amount = frm.doc.repayment_periods = ""
|
||||||
|
|||||||
@@ -869,8 +869,8 @@ class SalarySlip(TransactionBase):
|
|||||||
`tabRepayment Schedule` as rps, `tabLoan` as l
|
`tabRepayment Schedule` as rps, `tabLoan` as l
|
||||||
where
|
where
|
||||||
l.name = rps.parent and rps.payment_date between %s and %s and
|
l.name = rps.parent and rps.payment_date between %s and %s and
|
||||||
l.repay_from_salary = 1 and l.docstatus = 1 and l.applicant = %s""",
|
l.repay_from_salary = 1 and l.docstatus = 1 and l.applicant = %s and l.company = %s""",
|
||||||
(self.start_date, self.end_date, self.employee), as_dict=True) or []
|
(self.start_date, self.end_date, self.employee, self.company), as_dict=True) or []
|
||||||
|
|
||||||
def update_salary_slip_in_additional_salary(self):
|
def update_salary_slip_in_additional_salary(self):
|
||||||
salary_slip = self.name if self.docstatus==1 else None
|
salary_slip = self.name if self.docstatus==1 else None
|
||||||
|
|||||||
Reference in New Issue
Block a user