fix: Unaccrued interest from last accrual date instead of disbursement date

This commit is contained in:
Deepesh Garg 2020-10-26 14:20:55 +05:30
parent 2b3f8e0c3b
commit d63fbd79f4

View File

@ -310,6 +310,7 @@ def get_accrued_interest_entries(against_loan):
payable_principal_amount - paid_principal_amount > 0) payable_principal_amount - paid_principal_amount > 0)
AND AND
docstatus = 1 docstatus = 1
ORDER BY posting_date
""", (against_loan), as_dict=1) """, (against_loan), as_dict=1)
return unpaid_accrued_entries return unpaid_accrued_entries
@ -366,7 +367,8 @@ def get_amounts(amounts, against_loan, posting_date):
if due_date: if due_date:
pending_days = date_diff(posting_date, due_date) + 1 pending_days = date_diff(posting_date, due_date) + 1
else: else:
pending_days = date_diff(posting_date, against_loan_doc.disbursement_date) + 1 last_accrual_date = get_last_accural_date(against_loan_doc.name)
pending_days = date_diff(posting_date, last_accrual_date) + 1
if pending_days > 0: if pending_days > 0:
principal_amount = flt(pending_principal_amount, precision) principal_amount = flt(pending_principal_amount, precision)