From 2a0de58f3dc49f8bfb58056b8ae8917ce9cc6338 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 4 May 2020 13:45:43 +0530 Subject: [PATCH] fix: Use grace period in days for calculation of due date --- .../loan_management/doctype/loan_repayment/loan_repayment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py index a5ed5de30e..5979ee3102 100644 --- a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py @@ -282,7 +282,8 @@ def get_amounts(amounts, against_loan, posting_date, payment_type): 'payable_principal_amount': flt(entry.payable_principal_amount) }) - final_due_date = due_date + if not final_due_date: + final_due_date = add_days(due_date, loan_type_details.grace_period_in_days) pending_principal_amount = against_loan_doc.total_payment - against_loan_doc.total_principal_paid - against_loan_doc.total_interest_payable