mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-15 12:55:10 +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 () {
|
||||
return {
|
||||
"filters": {
|
||||
|
||||
@@ -5,8 +5,15 @@
|
||||
|
||||
frappe.ui.form.on('Loan Application', {
|
||||
refresh: function(frm) {
|
||||
frm.trigger("toggle_fields")
|
||||
frm.trigger("add_toolbar_buttons")
|
||||
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 = ""
|
||||
|
||||
@@ -869,8 +869,8 @@ class SalarySlip(TransactionBase):
|
||||
`tabRepayment Schedule` as rps, `tabLoan` as l
|
||||
where
|
||||
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""",
|
||||
(self.start_date, self.end_date, self.employee), as_dict=True) or []
|
||||
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, self.company), as_dict=True) or []
|
||||
|
||||
def update_salary_slip_in_additional_salary(self):
|
||||
salary_slip = self.name if self.docstatus==1 else None
|
||||
|
||||
Reference in New Issue
Block a user