fix: loan interest accrual date (#35695)
fix: loan interest accrual date
---------
Co-authored-by: Abhinav Raut <abhinav.raut@zerodha.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
diff --git a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py
index ced6394..ab4ea4c 100644
--- a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py
+++ b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py
@@ -293,8 +293,8 @@
# interest for last interest accrual date is already booked, so add 1 day
last_disbursement_date = get_last_disbursement_date(loan, posting_date)
- if last_disbursement_date and getdate(last_disbursement_date) > getdate(
- last_interest_accrual_date
+ if last_disbursement_date and getdate(last_disbursement_date) > add_days(
+ getdate(last_interest_accrual_date), 1
):
last_interest_accrual_date = last_disbursement_date