-
Notifications
You must be signed in to change notification settings - Fork 93
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 #222 from Nihantra-Patel/fix_status_loan_dis
fix: closed status in loan disbursement
- Loading branch information
Showing
7 changed files
with
80 additions
and
1 deletion.
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
14 changes: 14 additions & 0 deletions
14
lending/loan_management/doctype/loan_disbursement/loan_disbursement_list.js
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,14 @@ | ||
// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and Contributors | ||
// License: GNU General Public License v3. See license.txt | ||
|
||
frappe.listview_settings['Loan Disbursement'] = { | ||
get_indicator: function(doc) { | ||
var status_color = { | ||
"Draft": "red", | ||
"Submitted": "blue", | ||
"Cancelled": "red", | ||
"Closed": "green" | ||
}; | ||
return [__(doc.status), status_color[doc.status], "status,=,"+doc.status]; | ||
}, | ||
}; |
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
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,35 @@ | ||
import frappe | ||
|
||
frappe.db.sql( | ||
""" | ||
UPDATE `tabLoan Disbursement` | ||
SET status = 'Draft' | ||
WHERE docstatus = 0 | ||
""" | ||
) | ||
|
||
frappe.db.sql( | ||
""" | ||
UPDATE `tabLoan Disbursement` | ||
SET status = 'Submitted' | ||
WHERE docstatus = 1 | ||
""" | ||
) | ||
|
||
frappe.db.sql( | ||
""" | ||
UPDATE `tabLoan Disbursement` | ||
SET status = 'Cancelled' | ||
WHERE docstatus = 2 | ||
""" | ||
) | ||
|
||
frappe.db.sql( | ||
""" | ||
UPDATE `tabLoan Disbursement` ld | ||
INNER JOIN `tabLoan Repayment Schedule` lrs | ||
ON ld.name = lrs.loan_disbursement | ||
SET ld.status = 'Closed' | ||
WHERE lrs.status = 'Closed' | ||
""" | ||
) |