fix: Auto write off on loan closure

This commit is contained in:
Deepesh Garg 2021-05-01 22:07:13 +05:30
parent 1efafb3ce8
commit 824f089569
2 changed files with 2 additions and 2 deletions

View File

@ -193,7 +193,8 @@ def request_loan_closure(loan, posting_date=None):
posting_date = getdate()
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')
write_off_limit = frappe.get_value('Loan Type', loan_type, 'write_off_amount')

View File

@ -435,7 +435,6 @@ def get_amounts(amounts, against_loan, posting_date):
@frappe.whitelist()
def calculate_amounts(against_loan, posting_date, payment_type=''):
amounts = {
'penalty_amount': 0.0,
'interest_amount': 0.0,