-
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.
chore: loan partner and IRAC provisioning configuration updates (#121)
- Loading branch information
1 parent
8ebd1dd
commit 203637b
Showing
7 changed files
with
97 additions
and
45 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
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
22 changes: 20 additions & 2 deletions
22
lending/loan_management/doctype/loan_partner/loan_partner.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 |
---|---|---|
@@ -1,13 +1,31 @@ | ||
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors | ||
# For license information, please see license.txt | ||
|
||
import frappe | ||
from frappe import _ | ||
from frappe.contacts.address_and_contact import load_address_and_contact | ||
|
||
# import frappe | ||
from frappe.model.document import Document | ||
|
||
|
||
class LoanPartner(Document): | ||
def onload(self): | ||
"""Load address and contacts in `__onload`""" | ||
load_address_and_contact(self) | ||
|
||
def validate(self): | ||
self.validate_percentage_and_interest_fields() | ||
|
||
def validate_percentage_and_interest_fields(self): | ||
fields = [ | ||
"partner_loan_share_percentage", | ||
"company_loan_share_percentage", | ||
"partner_base_interest_rate", | ||
"company_base_interest_rate", | ||
"fldg_total_percentage", | ||
"fldg_fixed_deposit_percentage", | ||
"fldg_corporate_guarantee_percentage", | ||
] | ||
|
||
for field in fields: | ||
if self.get(field) and (self.get(field) < 0 or self.get(field) > 100): | ||
frappe.throw(_("{0} should be between 0 and 100").format(frappe.bold(frappe.unscrub(field)))) |
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