Adam Saghy created FINERACT-2790:
------------------------------------

             Summary: Merchant Issued Refund after Re-age on progressive loan 
with down payment + additional installment causes NoSuchElementException
                 Key: FINERACT-2790
                 URL: https://issues.apache.org/jira/browse/FINERACT-2790
             Project: Apache Fineract
          Issue Type: Bug
    Affects Versions: 1.15.0
            Reporter: Adam Saghy
            Assignee: Adam Saghy
             Fix For: 1.16.0


*Summary*

A Merchant Issued Refund (MIR) on the progressive/advanced-payment-allocation 
schedule can crash when the loan has an "additional" installment in its 
persisted schedule (e.g. inserted by a prior re-age) and the product has down 
payments enabled with a MERCHANT_ISSUED_REFUND payment-allocation rule using 
futureInstallmentAllocationRule = LAST_INSTALLMENT. The failure surfaces as an 
unwrapped NoSuchElementException.


{noformat}
java.util.NoSuchElementException: No value present
    at java.base/java.util.Optional.orElseThrow(Optional.java:377)
    at 
org.apache.fineract.portfolio.loanproduct.calc.ProgressiveEMICalculator.getDueAmounts(ProgressiveEMICalculator.java:521)
    at 
...AdvancedPaymentScheduleTransactionProcessor.updateRepaymentPeriodBalances(...java:2932)
    at 
...handlingPaymentAllocationForInterestBearingProgressiveLoan(...java:2899)
    at ...processAllocationsHorizontally(...java:2715)
    at ...handleRepayment(...java:1972)
    at ...handleInterestRefund(...java:675)
    at 
LoanAccountDomainServiceJpa.makeRefund(LoanAccountDomainServiceJpa.java:854)
    at 
LoanMerchantIssuedRefundCommandHandler.processCommand(LoanMerchantIssuedRefundCommandHandler.java:41)
{noformat}




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to