fix: Update only if loans to close
This commit is contained in:
parent
c51b340ddf
commit
78690af440
@ -29,6 +29,7 @@ def execute():
|
|||||||
|
|
||||||
loans_to_close = [d.parent for d in loans_list]
|
loans_to_close = [d.parent for d in loans_list]
|
||||||
|
|
||||||
|
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))
|
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',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user