From 4bb9c40cdcb7d4407d8260a44058c7c2f148766d Mon Sep 17 00:00:00 2001 From: taskain7 Date: Mon, 16 Oct 2023 10:31:33 +0200 Subject: [PATCH] [FINERACT-1971] don't send event if the installment is paid --- .../fineract/cob/loan/CheckLoanRepaymentDueBusinessStep.java | 2 +- .../cob/loan/CheckLoanRepaymentDueBusinessStepTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/cob/loan/CheckLoanRepaymentDueBusinessStep.java b/fineract-provider/src/main/java/org/apache/fineract/cob/loan/CheckLoanRepaymentDueBusinessStep.java index 944031579..fc815f937 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/cob/loan/CheckLoanRepaymentDueBusinessStep.java +++ b/fineract-provider/src/main/java/org/apache/fineract/cob/loan/CheckLoanRepaymentDueBusinessStep.java @@ -81,6 +81,6 @@ public class CheckLoanRepaymentDueBusinessStep implements LoanCOBBusinessStep { return repaymentDate.minusDays(numberOfDaysBeforeDueDateToRaiseEvent).equals(currentDate) && !nonDisbursedStatuses.contains(loan.getStatus()) && loan.getLoanSummary().getTotalOutstanding().compareTo(BigDecimal.ZERO) > 0 - && repaymentScheduleInstallment.getDue(loan.getCurrency()).isGreaterThanZero(); + && repaymentScheduleInstallment.getTotalOutstanding(loan.getCurrency()).isGreaterThanZero(); } } diff --git a/fineract-provider/src/test/java/org/apache/fineract/cob/loan/CheckLoanRepaymentDueBusinessStepTest.java b/fineract-provider/src/test/java/org/apache/fineract/cob/loan/CheckLoanRepaymentDueBusinessStepTest.java index 5376ad815..6b193ad7c 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/cob/loan/CheckLoanRepaymentDueBusinessStepTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/cob/loan/CheckLoanRepaymentDueBusinessStepTest.java @@ -92,7 +92,7 @@ public class CheckLoanRepaymentDueBusinessStepTest { when(loanForProcessing.getLoanSummary()).thenReturn(loanSummary); when(loanForProcessing.getLoanSummary().getTotalOutstanding()).thenReturn(BigDecimal.ONE); when(loanForProcessing.getCurrency()).thenReturn(currency); - when(repaymentInstallment.getDue(currency)).thenReturn(money); + when(repaymentInstallment.getTotalOutstanding(currency)).thenReturn(money); when(money.isGreaterThanZero()).thenReturn(true); // when @@ -150,7 +150,7 @@ public class CheckLoanRepaymentDueBusinessStepTest { when(loanForProcessing.getLoanSummary()).thenReturn(loanSummary); when(loanForProcessing.getLoanSummary().getTotalOutstanding()).thenReturn(BigDecimal.ONE); when(loanForProcessing.getCurrency()).thenReturn(currency); - when(repaymentInstallment.getDue(currency)).thenReturn(money); + when(repaymentInstallment.getTotalOutstanding(currency)).thenReturn(money); when(money.isGreaterThanZero()).thenReturn(true); // when