FINERACT-2807: Fix fixed interest scaling when in the middle of period - #6417
Open
Cocoa-Puffs wants to merge 1 commit into
Open
FINERACT-2807: Fix fixed interest scaling when in the middle of period#6417Cocoa-Puffs wants to merge 1 commit into
Cocoa-Puffs wants to merge 1 commit into
Conversation
Cocoa-Puffs
force-pushed
the
FINERACT-2807-fix-reage-equal-amortiztion-issue
branch
from
September 9, 2026 08:01
753100f to
7d5fedd
Compare
| ProgressiveLoanInterestScheduleModel scheduleModelCopy = scheduleModel.deepCopy(mc); | ||
| calculateRateFactorForScheduleTillDateInclusive(scheduleModelCopy, targetDate); | ||
| if (fixedInterestTillDate) { | ||
| scaleFixedInterestTillDate(scheduleModelCopy, targetDate); |
Contributor
There was a problem hiding this comment.
scaleFixedInterestTillDate runs before calculateLastUnpaidRepaymentPeriodEMI, so fixedInterest is already mutated when the EMI-pass uses it as a floor (see ~1290–1292: paidPrincipal + fixedInterest).
Maybe it will be better to move scaleFixedInterestTillDate after calculateLastUnpaidRepaymentPeriodEMI?
| */ | ||
| private void scaleFixedInterestTillDate(ProgressiveLoanInterestScheduleModel scheduleModelCopy, LocalDate targetDate) { | ||
| scheduleModelCopy.repaymentPeriods().forEach(rp -> { | ||
| if (rp.getFixedInterest().isGreaterThanZero()) { |
Contributor
There was a problem hiding this comment.
Maybe it`s worth to gate with && rp.isReAged()? updateModelForReageEqualAmortization sets reAged=true on exactly the periods that later receive fixedInterest, so this does not weaken the fix. It does keep scaling off non-re-age uses of fixedInterest (e.g. copyWithoutPaidAmounts / accelerate-maturity aggregation).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.