mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 07:02:54 +00:00
fix: Update only if loans to close
This commit is contained in:
@@ -29,7 +29,8 @@ def execute():
|
|||||||
|
|
||||||
loans_to_close = [d.parent for d in loans_list]
|
loans_to_close = [d.parent for d in loans_list]
|
||||||
|
|
||||||
frappe.db.sql("UPDATE `tabLoan` set status = 'Closed' where name not in (%s)" % (', '.join(['%s'] * len(loans_to_close))), tuple(loans_to_close))
|
if loans_to_close:
|
||||||
|
frappe.db.sql("UPDATE `tabLoan` set status = 'Closed' where name not in (%s)" % (', '.join(['%s'] * len(loans_to_close))), tuple(loans_to_close))
|
||||||
|
|
||||||
loans = frappe.get_all('Loan', fields=['name', 'loan_type', 'company', 'status', 'mode_of_payment',
|
loans = frappe.get_all('Loan', fields=['name', 'loan_type', 'company', 'status', 'mode_of_payment',
|
||||||
'applicant_type', 'applicant', 'loan_account', 'payment_account', 'interest_income_account'],
|
'applicant_type', 'applicant', 'loan_account', 'payment_account', 'interest_income_account'],
|
||||||
|
|||||||
Reference in New Issue
Block a user