Fix FEB_29_PERIOD_ONLY strategy for cross-year repayment periods#5728
Closed
pratikpatel-aurochs wants to merge 1 commit intoapache:developfrom
Closed
Fix FEB_29_PERIOD_ONLY strategy for cross-year repayment periods#5728pratikpatel-aurochs wants to merge 1 commit intoapache:developfrom
pratikpatel-aurochs wants to merge 1 commit intoapache:developfrom
Conversation
Contributor
|
@pratikpatel-aurochs Before contributing go through https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests thoroughly please |
Contributor
Author
Don't have Jira access so closing it |
Contributor
Author
#5729 Created a new PR |
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
Fix
isPeriodContainsFeb29inProgressiveEMICalculatorto correctly detect Feb 29 when a repayment period spans from a non-leap year into a leap year (e.g., Dec 1, 2023 → Mar 1, 2024)repaymentPeriodFromDate's year for leap year, causing it to returnfalsewhen the from-date was in a non-leap year — even if Feb 29 of the next (leap) yearfell within the period
FEB_29_PERIOD_ONLYstrategy:numberOfDaysFeb29PeriodOnlyreturned 365 instead of 366partialPeriodCalculationNeededwasfalse, skipping the year-splitting interest calculationSummary
isPeriodContainsFeb29inProgressiveEMICalculatorto correctly detect Feb 29 when a repayment period spans from a non-leap year into a leap year (e.g., Dec 1, 2023 → Mar 1, 2024)repaymentPeriodFromDate's year for leap year, causing it to returnfalsewhen the from-date was in a non-leap year — even if Feb 29 of the next (leap) yearfell within the period
FEB_29_PERIOD_ONLYstrategy:numberOfDaysFeb29PeriodOnlyreturned 365 instead of 366partialPeriodCalculationNeededwasfalse, skipping the year-splitting interest calculationImpact
Affects progressive loan interest calculations using:
DaysInYearType.ACTUAL+DaysInYearCustomStrategyType.FEB_29_PERIOD_ONLYMonthly repayments are not affected since a single month cannot span from one year past Feb 29 of the next year.
Changes
ProgressiveEMICalculator.javaProgressiveEMICalculatorTest.javatest_feb29_period_only_cross_year_quarterly_period_containing_feb29verifying cross-year FEB_29_PERIOD_ONLY matches FULL_LEAP_YEAR when Feb 29 is in the periodChecklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.