From 3ccba53de2c34783c5ad6435fd7d79777fe95588 Mon Sep 17 00:00:00 2001 From: Andrii Kulminskyi Date: Thu, 31 Oct 2024 12:51:59 +0200 Subject: [PATCH] FINERACT-1981: When paying down payment, that should not be reflected on the InterestModel --- .../impl/AdvancedPaymentScheduleTransactionProcessor.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 6fa0875e3a..9f63571c0d 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 @@ -1560,6 +1560,12 @@ private Money handlingPaymentAllocationForInterestBearingProgressiveLoan(LoanTra paidPortion = processPaymentAllocation(paymentAllocationType, installment, loanTransaction, transactionAmountUnprocessed, loanTransactionToRepaymentScheduleMapping, charges, balances, LoanRepaymentScheduleInstallment.PaymentAction.PAY); + if (installment.isDownPayment() || installment.getDueDate().isAfter(ctx.getModel().getMaturityDate())) { + // Skip interest and principal payment processing for down payment period or periods after loan maturity + // date + return paidPortion; + } + if (PRINCIPAL.equals(paymentAllocationType.getAllocationType())) { emiCalculator.payPrincipal(model, installment.getDueDate(), payDate, paidPortion); updateRepaymentPeriods(loanTransaction, ctx, model);