You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "AshharAhmadKhan (via GitHub)" <gi...@apache.org> on 2026/08/27 19:13:22 UTC

[PR] FINERACT-2790: Fix NoSuchElementException on Merchant Issued Refund for re-aged progressive loans [fineract]

AshharAhmadKhan opened a new pull request, #6344:
URL: https://github.com/apache/fineract/pull/6344

   JIRA
   https://issues.apache.org/jira/browse/FINERACT-2790
   
   Problem
   A Merchant Issued Refund on a progressive loan schedule crashes with an unwrapped NoSuchElementException when the loan has an "additional" installment in its persisted schedule (inserted by a prior re-age), the product has down payments enabled, and the payment allocation rule is MERCHANT_ISSUED_REFUND with futureInstallmentAllocationRule = LAST_INSTALLMENT.
   
   The crash happens because AdvancedPaymentScheduleTransactionProcessor.updateRepaymentPeriodBalances() did not exclude isAdditional() installments before calling ProgressiveEMICalculator.getDueAmounts(). Additional installments are filtered out of the EMI model's repaymentPeriods at build time, so a lookup using an additional installment's dates has nothing to find.
   
   Grepped all call sites of isDownPayment() and isAdditional() in fineract-progressive-loan/src/main/java and found 17 places where both are already excluded together. This is an established convention in the module: down payment and additional installments are both "special installments" excluded from EMI-model-based lookups. The LAST_INSTALLMENT selection logic already excludes isAdditional() from candidacy, so this was a downstream consumer that hadn't caught up to that rule, not a missing design decision.
   
   Fix
   Excludes isAdditional() installments in updateRepaymentPeriodBalances() the same way isDownPayment() installments are already excluded.
   
   Verification
   Added test coverage to the existing AdvancedPaymentScheduleTransactionProcessorTest and ProgressiveEMICalculatorTest suites (no standalone ticket-numbered test classes, per the module's convention):
   - updateRepaymentPeriodBalancesSkipsAdditionalInstallmentAndAppliesPaymentDirectly asserts getDueAmounts() is never called for an additional installment and that the payment is applied directly to its own persisted principal balance instead.
   - getDueAmountsThrowsNoSuchElementExceptionForAdditionalInstallment reproduces the original crash mechanism directly against ProgressiveEMICalculator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2790: Fix NoSuchElementException on Merchant Issued Refund for re-aged progressive loans [fineract]

Posted by "AshharAhmadKhan (via GitHub)" <gi...@apache.org>.
AshharAhmadKhan commented on PR #6344:
URL: https://github.com/apache/fineract/pull/6344#issuecomment-5455135788

   hey @adamsaghy , please let me know your thoughts on this one, thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2790: Fix NoSuchElementException on Merchant Issued Refund for re-aged progressive loans [fineract]

Posted by "AshharAhmadKhan (via GitHub)" <gi...@apache.org>.
AshharAhmadKhan closed pull request #6344: FINERACT-2790: Fix NoSuchElementException on Merchant Issued Refund for re-aged progressive loans
URL: https://github.com/apache/fineract/pull/6344


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2790: Fix NoSuchElementException on Merchant Issued Refund for re-aged progressive loans [fineract]

Posted by "AshharAhmadKhan (via GitHub)" <gi...@apache.org>.
AshharAhmadKhan commented on PR #6344:
URL: https://github.com/apache/fineract/pull/6344#issuecomment-5444853672

   Hey @adamsaghy , failure unrelated to my code. Please retrigger whenever possible.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2790: Fix NoSuchElementException on Merchant Issued Refund for re-aged progressive loans [fineract]

Posted by "AshharAhmadKhan (via GitHub)" <gi...@apache.org>.
AshharAhmadKhan commented on PR #6344:
URL: https://github.com/apache/fineract/pull/6344#issuecomment-5525303363

   Hey @adamsaghy, I’m closing this PR since PR #6347 has a better fix for the issue. :)
   
   While looking into the same problem, I also found an additional issue and created PR #6372 with the fix and test coverage. Please take a look when you get a chance, thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2790: Fix NoSuchElementException on Merchant Issued Refund for re-aged progressive loans [fineract]

Posted by "AshharAhmadKhan (via GitHub)" <gi...@apache.org>.
AshharAhmadKhan commented on PR #6344:
URL: https://github.com/apache/fineract/pull/6344#issuecomment-5455206612

   > @AshharAhmadKhan Thank you for your interest in this, but one of my DEV is already working on this, i would like to see what the diff between the two PRs
   
   Hey @adamsaghy, checked PR #6347. The main fix is identical to mine, same guard clause. The difference is #6347 also adds a second layer of protection in ProgressiveEMICalculator, plus two integration tests that reproduce the actual production scenario.
   
   I've only done unit tests on mine. Happy to close this one once #6347 is out of draft and passing, or you can decide either way, just let me know.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2790: Fix NoSuchElementException on Merchant Issued Refund for re-aged progressive loans [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6344:
URL: https://github.com/apache/fineract/pull/6344#issuecomment-5455151449

   @AshharAhmadKhan Thank you for your interest in this, but one of my DEV is already working on this, i would like to see what the diff between the two PRs
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org