-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: closed status in loan disbursement #222
fix: closed status in loan disbursement #222
Conversation
|
||
loan_dis = frappe.db.get_all( | ||
"Loan Disbursement", | ||
filters={"status": ["!=", "Closed"]}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have just introduced the status field, whats the point of checking status here?
) | ||
for ld in loan_dis: | ||
if ld.docstatus == 0: | ||
frappe.db.set_value("Loan Disbursement", ld.name, "status", "Draft", update_modified=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making one single query for every loan will take lot of time, we have 3 statuses to update. Can you do it just 3 update queries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
First, add a status field in the loan disbursement. When the loan repayment schedule is closed, the loan disbursement should also be automatically marked as closed.