diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java index bb88331b8..134aa09d3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java @@ -36,6 +36,7 @@ import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecific import org.apache.fineract.infrastructure.event.business.BusinessEventListener; import org.apache.fineract.infrastructure.event.business.domain.loan.LoanAdjustTransactionBusinessEvent; import org.apache.fineract.infrastructure.event.business.domain.loan.LoanApplyOverdueChargeBusinessEvent; +import org.apache.fineract.infrastructure.event.business.domain.loan.LoanBalanceChangedBusinessEvent; import org.apache.fineract.infrastructure.event.business.domain.loan.LoanDisbursalBusinessEvent; import org.apache.fineract.infrastructure.event.business.domain.loan.charge.LoanAddChargeBusinessEvent; import org.apache.fineract.infrastructure.event.business.domain.loan.charge.LoanWaiveChargeBusinessEvent; @@ -92,6 +93,8 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService { businessEventNotifierService.addPostBusinessEventListener(LoanDisbursalBusinessEvent.class, new DisbursementEventListener()); businessEventNotifierService.addPostBusinessEventListener(LoanForeClosurePostBusinessEvent.class, new LoanForeClosureEventListener()); + businessEventNotifierService.addPostBusinessEventListener(LoanBalanceChangedBusinessEvent.class, + new LoanBalanceChangedEventListener()); } @Override @@ -523,4 +526,13 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService { handleArrearsForLoan(loan); } } + + private class LoanBalanceChangedEventListener implements BusinessEventListener { + + @Override + public void onBusinessEvent(LoanBalanceChangedBusinessEvent event) { + Loan loan = event.get(); + handleArrearsForLoan(loan); + } + } }