Skip to content

Commit

Permalink
FINERACT-1981: Enable backdated Interest Payment Waiver on progressiv…
Browse files Browse the repository at this point in the history
…e loans
  • Loading branch information
magyari-adam authored and adamsaghy committed Oct 24, 2024
1 parent 256afa1 commit 2469f22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import org.apache.fineract.portfolio.loanaccount.exception.LoanDisbursalException;
import org.apache.fineract.portfolio.loanaccount.exception.LoanNotFoundException;
import org.apache.fineract.portfolio.loanaccount.exception.LoanRepaymentScheduleNotFoundException;
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
import org.apache.fineract.portfolio.loanaccount.service.LoanUtilService;
import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -778,7 +779,8 @@ public void validateClientOfficeJoiningDateIsBeforeTransactionDate(Loan loan, Lo
}

public void validateActivityNotBeforeLastTransactionDate(final Loan loan, final LocalDate activityDate, final LoanEvent event) {
if (!(loan.repaymentScheduleDetail().isInterestRecalculationEnabled() || loan.loanProduct().isHoldGuaranteeFunds())) {
if (!(loan.repaymentScheduleDetail().isInterestRecalculationEnabled() || loan.loanProduct().isHoldGuaranteeFunds())
|| !loan.getLoanRepaymentScheduleDetail().getLoanScheduleType().equals(LoanScheduleType.CUMULATIVE)) {
return;
}
LocalDate lastTransactionDate = loan.getLastUserTransactionDate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,14 @@ public void testProgressiveBackdatedGoodwillCredit() {
});
}

@Test
public void testProgressiveBackdatedInterestPaymentWaiver() {
runAt("01 July 2024", () -> {
loanTransactionHelper.makeInterestPaymentWaiver(loanId, new PostLoansLoanIdTransactionsRequest().dateFormat(DATETIME_PATTERN)
.transactionDate("5 June 2024").locale("en").transactionAmount(100.0));

GetLoansLoanIdResponse loanDetails = loanTransactionHelper.getLoanDetails(loanId);
Assertions.assertTrue(loanDetails.getTransactions().size() >= 2);
});
}
}

0 comments on commit 2469f22

Please sign in to comment.