Skip to content

Commit

Permalink
FINERACT-2148: Update instalments interest with zero after charge off…
Browse files Browse the repository at this point in the history
… with interest recalculation enabled
  • Loading branch information
oleksii-novikov-onix committed Dec 17, 2024
1 parent 51433ff commit e91177f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3572,4 +3572,10 @@ public LoanRepaymentScheduleTransactionProcessor getTransactionProcessor() {
public boolean isProgressiveSchedule() {
return getLoanProductRelatedDetail().getLoanScheduleType() == PROGRESSIVE;
}

public boolean isTransactionBeforeZeroInterestChargeOff(final LoanTransaction transaction) {
return !this.isChargedOff()
|| !LoanChargeOffBehaviour.ZERO_INTEREST.equals(this.getLoanProductRelatedDetail().getChargeOffBehaviour())
|| !transaction.getTransactionDate().isAfter(this.getChargedOffOnDate());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,8 @@ private Money processAllocationsHorizontally(LoanTransaction loanTransaction, Tr
transactionMappings, loanTransaction, oldestPastDueInstallment, currency);
Loan loan = loanTransaction.getLoan();
if (transactionCtx instanceof ProgressiveTransactionCtx ctx && loan.isInterestBearing()
&& loan.getLoanProductRelatedDetail().isInterestRecalculationEnabled()) {
&& loan.getLoanProductRelatedDetail().isInterestRecalculationEnabled()
&& loanTransaction.getLoan().isTransactionBeforeZeroInterestChargeOff(loanTransaction)) {
paidPortion = handlingPaymentAllocationForInterestBearingProgressiveLoan(loanTransaction,
transactionAmountUnprocessed, balances, paymentAllocationType, oldestPastDueInstallment, ctx,
loanTransactionToRepaymentScheduleMapping, oldestPastDueInstallmentCharges);
Expand All @@ -1605,7 +1606,8 @@ private Money processAllocationsHorizontally(LoanTransaction loanTransaction, Tr
transactionMappings, loanTransaction, dueInstallment, currency);
Loan loan = loanTransaction.getLoan();
if (transactionCtx instanceof ProgressiveTransactionCtx ctx && loan.isInterestBearing()
&& loan.getLoanProductRelatedDetail().isInterestRecalculationEnabled()) {
&& loan.getLoanProductRelatedDetail().isInterestRecalculationEnabled()
&& loanTransaction.getLoan().isTransactionBeforeZeroInterestChargeOff(loanTransaction)) {
paidPortion = handlingPaymentAllocationForInterestBearingProgressiveLoan(loanTransaction,
transactionAmountUnprocessed, balances, paymentAllocationType, dueInstallment, ctx,
loanTransactionToRepaymentScheduleMapping, dueInstallmentCharges);
Expand Down Expand Up @@ -1636,7 +1638,8 @@ private Money processAllocationsHorizontally(LoanTransaction loanTransaction, Tr

Loan loan = loanTransaction.getLoan();
if (transactionCtx instanceof ProgressiveTransactionCtx ctx && loan.isInterestBearing()
&& loan.getLoanProductRelatedDetail().isInterestRecalculationEnabled()) {
&& loan.getLoanProductRelatedDetail().isInterestRecalculationEnabled()
&& loanTransaction.getLoan().isTransactionBeforeZeroInterestChargeOff(loanTransaction)) {
paidPortion = handlingPaymentAllocationForInterestBearingProgressiveLoan(loanTransaction, evenPortion,
balances, paymentAllocationType, inAdvanceInstallment, ctx,
loanTransactionToRepaymentScheduleMapping, inAdvanceInstallmentCharges);
Expand Down

0 comments on commit e91177f

Please sign in to comment.