FINERACT-2181: fix prepayment functionality when prepayment happens in the first month of loan

This commit is contained in:
CsengeSóti
2025-06-19 11:10:36 +02:00
committed by Arnold Gálovics
parent dd2c29fb91
commit cb82af119b
8 changed files with 213 additions and 8 deletions
@@ -35,6 +35,7 @@ public class ScheduleGeneratorDTO {
final CalendarInstance calendarInstanceForInterestRecalculation;
final CalendarInstance compoundingCalendarInstance;
LocalDate recalculateFrom;
LocalDate recalculateTill;
final Long overdurPenaltyWaitPeriod;
final FloatingRateDTO floatingRateDTO;
final Calendar calendar;
@@ -50,8 +51,8 @@ public class ScheduleGeneratorDTO {
public ScheduleGeneratorDTO(final LoanScheduleGeneratorFactory loanScheduleFactory, final CurrencyData currency,
final LocalDate calculatedRepaymentsStartingFromDate, final HolidayDetailDTO holidayDetailDTO,
final CalendarInstance calendarInstanceForInterestRecalculation, final CalendarInstance compoundingCalendarInstance,
final LocalDate recalculateFrom, final Long overdurPenaltyWaitPeriod, final FloatingRateDTO floatingRateDTO,
final Calendar calendar, final CalendarHistoryDataWrapper calendarHistoryDataWrapper,
final LocalDate recalculateFrom, final LocalDate recalculateTill, final Long overdurPenaltyWaitPeriod,
final FloatingRateDTO floatingRateDTO, final Calendar calendar, final CalendarHistoryDataWrapper calendarHistoryDataWrapper,
final Boolean isInterestChargedFromDateAsDisbursementDateEnabled, final Integer numberOfdays,
final boolean isSkipRepaymentOnFirstDayofMonth, final Boolean isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled,
final boolean isFirstRepaymentDateAllowedOnHoliday, final boolean isInterestToBeRecoveredFirstWhenGreaterThanEMI,
@@ -63,6 +64,7 @@ public class ScheduleGeneratorDTO {
this.calendarInstanceForInterestRecalculation = calendarInstanceForInterestRecalculation;
this.compoundingCalendarInstance = compoundingCalendarInstance;
this.recalculateFrom = recalculateFrom;
this.recalculateTill = recalculateTill;
this.overdurPenaltyWaitPeriod = overdurPenaltyWaitPeriod;
this.holidayDetailDTO = holidayDetailDTO;
this.floatingRateDTO = floatingRateDTO;
@@ -97,6 +99,10 @@ public class ScheduleGeneratorDTO {
return this.recalculateFrom;
}
public LocalDate getRecalculateTill() {
return this.recalculateTill;
}
public Long getOverdurPenaltyWaitPeriod() {
return this.overdurPenaltyWaitPeriod;
}
@@ -2186,7 +2186,8 @@ public abstract class AbstractCumulativeLoanScheduleGenerator implements LoanSch
}
private LoanScheduleDTO rescheduleNextInstallments(final MathContext mc, final LoanApplicationTerms loanApplicationTerms, Loan loan,
@Override
public LoanScheduleDTO rescheduleNextInstallments(final MathContext mc, final LoanApplicationTerms loanApplicationTerms, Loan loan,
final HolidayDetailDTO holidayDetailDTO,
final LoanRepaymentScheduleTransactionProcessor loanRepaymentScheduleTransactionProcessor, LocalDate rescheduleFrom,
final LocalDate scheduleTillDate) {
@@ -41,6 +41,10 @@ public interface LoanScheduleGenerator {
HolidayDetailDTO holidayDetailDTO, LoanRepaymentScheduleTransactionProcessor loanRepaymentScheduleTransactionProcessor,
LocalDate rescheduleFrom);
LoanScheduleDTO rescheduleNextInstallments(MathContext mc, LoanApplicationTerms loanApplicationTerms, Loan loan,
HolidayDetailDTO holidayDetailDTO, LoanRepaymentScheduleTransactionProcessor loanRepaymentScheduleTransactionProcessor,
LocalDate rescheduleFrom, LocalDate rescheduleTill);
OutstandingAmountsDTO calculatePrepaymentAmount(MonetaryCurrency currency, LocalDate onDate, LoanApplicationTerms loanApplicationTerms,
MathContext mc, Loan loan, HolidayDetailDTO holidayDetailDTO,
LoanRepaymentScheduleTransactionProcessor loanRepaymentScheduleTransactionProcessor);