diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java index 280693da5fe..4803e2de6ce 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java @@ -1588,8 +1588,11 @@ public List retrieveListOfTransactionsForReprocessing() { } private static Predicate loanTransactionForReprocessingPredicate() { - return transaction -> transaction.isNotReversed() && (transaction.isChargeOff() || transaction.isReAge() - || transaction.isAccrualActivity() || transaction.isReAmortize() || !transaction.isNonMonetaryTransaction()); + return transaction -> transaction.isNotReversed() + && (transaction.isChargeOff() || transaction.isReAge() || transaction.isAccrualActivity() || transaction.isReAmortize() + || !transaction.isNonMonetaryTransaction()) + || transaction.isReversed() && transaction.isChargeOff() && LoanChargeOffBehaviour.ZERO_INTEREST + .equals(transaction.getLoan().getLoanProductRelatedDetail().getChargeOffBehaviour()); } public List retrieveListOfTransactionsExcludeAccruals() { diff --git a/fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/AdvancedPaymentScheduleTransactionProcessor.java b/fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/AdvancedPaymentScheduleTransactionProcessor.java index d7b52bd9e2e..d08bb6288f6 100644 --- a/fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/AdvancedPaymentScheduleTransactionProcessor.java +++ b/fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/AdvancedPaymentScheduleTransactionProcessor.java @@ -1172,8 +1172,8 @@ private void handleOverpayment(Money overpaymentPortion, LoanTransaction loanTra private void handleChargeOff(final LoanTransaction loanTransaction, final TransactionCtx transactionCtx) { if (transactionCtx instanceof ProgressiveTransactionCtx progressiveTransactionCtx) { - if (LoanChargeOffBehaviour.ZERO_INTEREST - .equals(loanTransaction.getLoan().getLoanProductRelatedDetail().getChargeOffBehaviour())) { + if (LoanChargeOffBehaviour.ZERO_INTEREST.equals(loanTransaction.getLoan().getLoanProductRelatedDetail().getChargeOffBehaviour()) + && !loanTransaction.isReversed()) { handleZeroInterestChargeOff(loanTransaction, progressiveTransactionCtx); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java index ea08a7b3370..a544fde4f8c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java @@ -3348,6 +3348,9 @@ public CommandProcessingResult undoChargeOff(JsonCommand command) { saveLoanWithDataIntegrityViolationChecks(loan); postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds); businessEventNotifierService.notifyPostBusinessEvent(new LoanUndoChargeOffBusinessEvent(chargedOffTransaction)); + + loan.reprocessTransactions(); + return new CommandProcessingResultBuilder() // .withOfficeId(loan.getOfficeId()) // .withClientId(loan.getClientId()) //