fix: Auto write off on loan closure
This commit is contained in:
parent
1efafb3ce8
commit
824f089569
@ -193,7 +193,8 @@ def request_loan_closure(loan, posting_date=None):
|
|||||||
posting_date = getdate()
|
posting_date = getdate()
|
||||||
|
|
||||||
amounts = calculate_amounts(loan, posting_date)
|
amounts = calculate_amounts(loan, posting_date)
|
||||||
pending_amount = amounts['payable_amount'] + amounts['unaccrued_interest']
|
pending_amount = amounts['pending_principal_amount'] + amounts['unaccrued_interest'] + \
|
||||||
|
amounts['interest_amount'] + amounts['penalty_amount']
|
||||||
|
|
||||||
loan_type = frappe.get_value('Loan', loan, 'loan_type')
|
loan_type = frappe.get_value('Loan', loan, 'loan_type')
|
||||||
write_off_limit = frappe.get_value('Loan Type', loan_type, 'write_off_amount')
|
write_off_limit = frappe.get_value('Loan Type', loan_type, 'write_off_amount')
|
||||||
|
@ -435,7 +435,6 @@ def get_amounts(amounts, against_loan, posting_date):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def calculate_amounts(against_loan, posting_date, payment_type=''):
|
def calculate_amounts(against_loan, posting_date, payment_type=''):
|
||||||
|
|
||||||
amounts = {
|
amounts = {
|
||||||
'penalty_amount': 0.0,
|
'penalty_amount': 0.0,
|
||||||
'interest_amount': 0.0,
|
'interest_amount': 0.0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user