magyari-adam commented on code in PR #4330:
URL: https://github.com/apache/fineract/pull/4330#discussion_r1954765174
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanCOBCreateAccrualsTest.java:
##########
@@ -563,4 +565,146 @@ public void
testInterestRecognitionOnDisbursementDateFalse() {
transaction(430.0d, "Disbursement", "20 December 2024",
430.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false));
});
}
+
+ @Test
+ public void testProgressiveChargeBackNoInterestRecalculation() {
+ AtomicReference<Long> loanIdRef = new AtomicReference<>();
+ AtomicReference<Long> repaymentIdRef = new AtomicReference<>();
+
+ setup();
+ final PostLoanProductsResponse loanProductsResponse = loanProductHelper
+
.createLoanProduct(create4IProgressive().isInterestRecalculationEnabled(false)
+
.creditAllocation(chargebackCreditAllocationOrders(List.of("PRINCIPAL",
"PENALTY", "FEE", "INTEREST")))
+ .currencyCode("USD"));
+
+ runAt("20 December 2024", () -> {
+ Long loanId = applyAndApproveProgressiveLoan(client.getClientId(),
loanProductsResponse.getResourceId(), "20 December 2024",
+ 430.0, 26.0, 6, null);
+
+ loanIdRef.set(loanId);
+
+ disburseLoan(loanId, BigDecimal.valueOf(430), "20 December 2024");
+ executeInlineCOB(loanId);
+ });
+ runAt("20 January 2025", () -> {
+ Long loanId = loanIdRef.get();
+ executeInlineCOB(loanId);
+
+ addCharge(loanId, true, 5.0d, "20 January 2025");
+ Long repaymentId = loanTransactionHelper.makeLoanRepayment(loanId,
"Repayment", "20 January 2025", 82.20).getResourceId();
+ repaymentIdRef.set(repaymentId);
+ });
+ runAt("2 February 2025", () -> {
+ Long loanId = loanIdRef.get();
+ executeInlineCOB(loanId);
+
+ addChargebackForLoan(loanId, repaymentIdRef.get(), 82.20);
+ });
+ runAt("20 February 2025", () -> {
+ Long loanId = loanIdRef.get();
+ executeInlineCOB(loanId);
+
+ GetLoansLoanIdResponse loanDetails =
loanTransactionHelper.getLoanDetails(loanId);
+ validateTransactionsExist(loanDetails, //
+ transaction(0.26, "Accrual", "01 February 2025", 0.0, 0.0,
0.26, 0.0, 0.0, 0.0, 0.0), //
+ transaction(0.25, "Accrual", "02 February 2025", 0.0, 0.0,
0.25, 0.0, 0.0, 0.0, 0.0), //
+ transaction(0.25, "Accrual", "03 February 2025", 0.0, 0.0,
0.25, 0.0, 0.0, 0.0, 0.0)); //
+ });
+ runAt("23 February 2025", () -> {
+ Long loanId = loanIdRef.get();
+ executeInlineCOB(loanId);
+
+ GetLoansLoanIdResponse loanDetails =
loanTransactionHelper.getLoanDetails(loanId);
+ validateTransactionsExist(loanDetails, //
+ transaction(0.25, "Accrual", "19 February 2025", 0.0, 0.0,
0.25, 0.0, 0.0, 0.0, 0.0), //
Review Comment:
February 20 is the installment due date, jumps down there from lowering
outstanding principal. The day by day +/-0.01 is just from rounding.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]