-
Notifications
You must be signed in to change notification settings - Fork 2.3k
FINERACT-2155: Allow annual charge payment after due date #5340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FINERACT-2155: Allow annual charge payment after due date #5340
Conversation
adamsaghy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please attach proper integration or E2E test cases to cover this functionality!
a93912c to
8e40cff
Compare
Added integration test. |
fd36cb1 to
589f19b
Compare
| BigDecimal actualDaysInPeriod = BigDecimal.valueOf(DateUtils.getDifferenceInDays(interestPeriodFromDate, interestPeriodDueDate)); | ||
| if (loanProductRelatedDetail.getInterestCalculationPeriodMethod() != null | ||
| && loanProductRelatedDetail.getInterestCalculationPeriodMethod().isSameAsRepaymentPeriod() | ||
| && !loanProductRelatedDetail.isAllowPartialPeriodInterestCalculation()) { | ||
| actualDaysInPeriod = calculatedDaysInRepaymentPeriod; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think this is relevant for the FINERACT-2155 story.
Also I dont think this is correct either... Ratefactor is only from the interest period. It is independent from interest calculation period method. That should only control whether we are taking all the interest periods anyway or not, but not directly the sub interest period.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review. I have removed the changes to ProgressiveEMICalculator.java and ClientChargeWritePlatformServiceImpl.java as requested, keeping the PR focused solely on the valid fix for FINERACT-2155 in SavingsAccount.java.
Regarding the reverted changes: I initially thought they were necessary to fix e2e test failures I encountered earlier.
Could you please point me to any documentation regarding the financial architecture calculations in Fineract? It would help me better understand the model for future contributions.
adamsaghy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the unrelated parts of the PR!
589f19b to
b66a85d
Compare
b66a85d to
34fb56e
Compare
Description
This PR addresses two distinct issues identified in e2e testing:
allowPartialPeriodInterestCalculationconfiguration.Changes
validatePaymentDateAndAmount.clientChargedue date, it fails with the error codetransaction.before.dueDate. This clarifies that payments are allowed on or after the due date, but not before.calculateRateFactorPerPeriodlogic.!loanProductRelatedDetail.isAllowPartialPeriodInterestCalculation().calculatedDaysInRepaymentPeriodinstead of theactualDaysInPeriod, preventing incorrect partial interest accrual in specific schedule generation scenarios.Rationale
allowPartialPeriodInterestCalculationflag was not being consistently applied in the rate factor calculation, causing discrepancies in EMI schedules for loans where partial interest should be disabled.Testing
transaction.before.dueDateerror is raised for early client charge payments.allowPartialPeriodInterestCalculationis set to false.