[
https://issues.apache.org/jira/browse/FINERACT-2523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18062482#comment-18062482
]
Piotr Wargulak commented on FINERACT-2523:
------------------------------------------
Currently,
for my needs I found a workaround that makes the schedule generation the same
for both cases.
I've noticed the issue is somewhere around usage of `LoanApplicationTerms` and
how it decides what current fixed EMI is. For over-payment, at some point after
past installments are reprocessed, the fixed EMI is reset and later calculated
again, for the exact repayment the fixed EMI stays the same for all
installments.
So I've added small code that resets the EMI when it detects a change in
`annualNominalInterestRate` - a change in rate, means a new fixed EMI needs to
be calculated.
This is the whole workaround I've been using:
{code:java}
//
org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanApplicationTerms
public void updateAnnualNominalInterestRate(BigDecimal
annualNominalInterestRate) {
if (annualNominalInterestRate != null) {
if (this.annualNominalInterestRate == null ||
annualNominalInterestRate.compareTo(this.annualNominalInterestRate) != 0) {
this.fixedEmiAmount = null;
}
this.annualNominalInterestRate = annualNominalInterestRate;
}
} {code}
It doesn't feel like proper solution, so it's here more as a additional detail
about the bug.
> Inconsistent Interest Recalculation between exact repayment and over-payment
> for Cumulative Loan with Floating Rates
> --------------------------------------------------------------------------------------------------------------------
>
> Key: FINERACT-2523
> URL: https://issues.apache.org/jira/browse/FINERACT-2523
> Project: Apache Fineract
> Issue Type: Bug
> Affects Versions: 1.14.0
> Reporter: Piotr Wargulak
> Priority: Major
> Attachments: FINERACT-2523.zip,
> floating-rate-after-min-overpayment.pdf, floating-rate-after-repayment.pdf,
> floating-rate-before-repayment-1.pdf, loan-product-summary-1.pdf
>
>
> h2. Summary
> The Interest Recalculation logic will modify all following installments when
> over-payment is made, but for the same loan the Interest Recalculation will
> only modify the last installment when Floating Rate changes.
> h2. Details
> A Loan with:
> * Cumulative schedule;
> * Equal installments;
> * Declining Balance;
> * Partial Interest Calculation allowed;
> * Interest recalculation enabled;
> * Interest recalculation - Advance payments adjustment type: {*}Reduce EMI
> amount{*}.
> _See attached loan-product-summary.pdf for complete summary._
> _See attached FINERACT-2523.zip with mariadb dump with the Loan (user:
> soldevelo/Soldevelo123!)._
> h3. Before repayment
> * EMI of most installments: 217.35
> * Last installment: 217.32
> * Floating Interest Rate changes at 1st April, by 1.5%.
> _See attached floating-rate-before-repayment.pdf_
> h3. After repayment
> * The exact *217.35* is repaid, before due.
> * EMI of most installments {*}stays the same{*}: 217.35
> * Last installment changes: 206.98
> _See attached floating-rate-after-repayment.pdf_
> h3. After over-payment
> * The exact *217.36* (0.01 more) is repaid, before due.
> * EMI of the due installments changes: 216.11 (this change is bigger then
> 0.01 over-payment, it must include new Interest Rate)
> * Last installment: 216.16
> _See attached floating-rate-after-min-overpayment.pdf_
> h2. Bug
> The behavior in both cases should be the same. Both payments should result in
> a change of following installments.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)