[
https://issues.apache.org/jira/browse/FINERACT-2532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18066088#comment-18066088
]
Adam Saghy commented on FINERACT-2532:
--------------------------------------
[~krishnamewara] I dont think
`testCreateLoanRescheduleRequestForInterestAppropriationAndFixedEMI` is failing
at the moment. CI shows green build.
> Combined DUE_DATE and EMI_AMOUNT reschedule requests fail to remap EMI
> variation dates upon approval
> ----------------------------------------------------------------------------------------------------
>
> Key: FINERACT-2532
> URL: https://issues.apache.org/jira/browse/FINERACT-2532
> Project: Apache Fineract
> Issue Type: Bug
> Components: Loan
> Environment: Upstream develop branch (commit 46abf58ee)
> Reporter: Krishna Mewara
> Priority: Major
>
> *Bug Description:*
> When a loan reschedule request contains both a DUE_DATE shift and an
> EMI_AMOUNT change, the generated repayment schedule fails to apply the new
> EMI amount correctly to the shifted installments. The new EMI amount is
> either applied to the wrong installments or skipped entirely.
> *Root Cause:*
> The issue originates in how the {{AbstractCumulativeLoanScheduleGenerator}}
> processes {{EMI_AMOUNT}} term variations alongside a {{DUE_DATE}} term
> variation.
> The {{EMI_AMOUNT}} variations (which are {{isSpecificToInstallment=true}} and
> created at the original installment dates) are being incorrectly consumed
> during schedule generation because the iterator-based {{hasVariation()}}
> matching logic ({{!DateUtils.isAfter(applicableDate, scheduledDueDate)}})
> evaluates multiple pre-shift variation dates as matching the early post-shift
> installment dates. This causes the EMI overrides to be exhausted before they
> reach the correct periods.
> *Steps to Reproduce (via Integration Test):*
> This bug is currently causing
> {{testCreateLoanRescheduleRequestForInterestAppropriationAndFixedEMI}} to
> fail on upstream {{develop}} (commit {{46abf58ee}}).
> # Create a loan with 12 monthly installments.
> # Submit a combined reschedule request that shifts the {{adjustedDueDate}}
> forward by several months AND applies a new fixed {{emi}}.
> # Approve the request.
> # Observe that the generated schedule does not correctly apply the fixed EMI
> to the shifted periods (the test expects a reverted EMI of 15417 for period
> 8, but receives the overridden 5000 instead).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)