FINERACT-2326: Repayment Reversal Failing After Full Repayment of Principal and Fee
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
627ccf603f
commit
c7f5743b12
+7
-2
@@ -236,11 +236,16 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen
|
||||
|
||||
final int firstNormalInstallmentNumber = LoanRepaymentScheduleProcessingWrapper.fetchFirstNormalInstallmentNumber(installments);
|
||||
|
||||
final LoanRepaymentScheduleInstallment currentInstallment = installments.stream()
|
||||
final Optional<LoanRepaymentScheduleInstallment> currentInstallmentOpt = installments.stream()
|
||||
.filter(installment -> LoanRepaymentScheduleProcessingWrapper.isInPeriod(loanTransaction.getTransactionDate(), installment,
|
||||
installment.getInstallmentNumber().equals(firstNormalInstallmentNumber)))
|
||||
.findFirst().orElseThrow();
|
||||
.findFirst();
|
||||
|
||||
if (currentInstallmentOpt.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final LoanRepaymentScheduleInstallment currentInstallment = currentInstallmentOpt.get();
|
||||
if (currentInstallment.isNotFullyPaidOff() && (currentInstallment.getDueDate().isAfter(loanTransaction.getTransactionDate())
|
||||
|| (currentInstallment.getDueDate().isEqual(loanTransaction.getTransactionDate())
|
||||
&& loanTransaction.getTransactionDate().equals(DateUtils.getBusinessLocalDate())))) {
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class LoanStatusChangePlatformServiceImpl implements LoanStatusChangePlat
|
||||
if (loan.getLoanProductRelatedDetail().isEnableAccrualActivityPosting()) {
|
||||
LoanStatus oldStatus = event.getOldStatus();
|
||||
LoanStatus newStatus = loan.getStatus();
|
||||
if ((oldStatus.isClosed() || oldStatus.isOverpaid()) && newStatus.isActive()) {
|
||||
if ((oldStatus.isClosedObligationsMet() || oldStatus.isClosed() || oldStatus.isOverpaid()) && newStatus.isActive()) {
|
||||
loanAccrualActivityProcessingService.processAccrualActivityForLoanReopen(loan);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user