-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from Nihantra-Patel/patch_for_loan_repayment_…
…scheduler_status fix: loan repayment schedule status --patch
- Loading branch information
Showing
4 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
lending/patches/v15_0/loan_repayment_schedule_status_patch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import frappe | ||
from frappe.query_builder import DocType | ||
|
||
|
||
def execute(): | ||
LoanRepaymentSchedule = DocType("Loan Repayment Schedule") | ||
|
||
frappe.qb.update(LoanRepaymentSchedule).set(LoanRepaymentSchedule.status, "Cancelled").where( | ||
(LoanRepaymentSchedule.docstatus == 2) & (LoanRepaymentSchedule.status != "Cancelled") | ||
).run() |