Merge branch 'PULLREQUEST80' into develop
This commit is contained in:
+2
@@ -77,4 +77,6 @@ public interface ConfigurationDomainService {
|
||||
|
||||
Long retreivePeroidInNumberOfDaysForSkipMeetingDate();
|
||||
|
||||
boolean isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled();
|
||||
|
||||
}
|
||||
+7
@@ -255,6 +255,13 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
final GlobalConfigurationProperty property = this.globalConfigurationRepository.findOneByNameWithNotFoundDetection(propertyName);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled() {
|
||||
final String propertyName = "change-emi-if-repaymentdate-same-as-disbursementdate";
|
||||
final GlobalConfigurationProperty property = this.globalConfigurationRepository.findOneByNameWithNotFoundDetection(propertyName);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+8
-3
@@ -42,15 +42,16 @@ public class ScheduleGeneratorDTO {
|
||||
final Boolean isInterestChargedFromDateAsDisbursementDateEnabled;
|
||||
final Integer numberOfdays;
|
||||
final boolean isSkipRepaymentOnFirstDayofMonth;
|
||||
final Boolean isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled;
|
||||
|
||||
|
||||
public ScheduleGeneratorDTO(final LoanScheduleGeneratorFactory loanScheduleFactory, final ApplicationCurrency applicationCurrency,
|
||||
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 Boolean isInterestChargedFromDateAsDisbursementDateEnabled, final Integer numberOfdays, final boolean isSkipRepaymentOnFirstDayofMonth) {
|
||||
final Boolean isInterestChargedFromDateAsDisbursementDateEnabled, final Integer numberOfdays, final boolean isSkipRepaymentOnFirstDayofMonth,
|
||||
final Boolean isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled) {
|
||||
|
||||
this.loanScheduleFactory = loanScheduleFactory;
|
||||
this.applicationCurrency = applicationCurrency;
|
||||
@@ -64,9 +65,9 @@ public class ScheduleGeneratorDTO {
|
||||
this.calendar = calendar;
|
||||
this.calendarHistoryDataWrapper = calendarHistoryDataWrapper;
|
||||
this.isInterestChargedFromDateAsDisbursementDateEnabled = isInterestChargedFromDateAsDisbursementDateEnabled;
|
||||
|
||||
this.numberOfdays = numberOfdays;
|
||||
this.isSkipRepaymentOnFirstDayofMonth = isSkipRepaymentOnFirstDayofMonth;
|
||||
this.isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled = isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled;
|
||||
}
|
||||
|
||||
public LoanScheduleGeneratorFactory getLoanScheduleFactory() {
|
||||
@@ -136,5 +137,9 @@ public class ScheduleGeneratorDTO {
|
||||
public boolean isSkipRepaymentOnFirstDayofMonth() {
|
||||
return isSkipRepaymentOnFirstDayofMonth;
|
||||
}
|
||||
|
||||
public Boolean isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled() {
|
||||
return this.isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+8
-2
@@ -2359,8 +2359,13 @@ public class Loan extends AbstractPersistable<Long> {
|
||||
if (this.loanProduct.isMultiDisburseLoan()) {
|
||||
final Date dateValue = null;
|
||||
final boolean isSpecificToInstallment = false;
|
||||
final Boolean isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled = scheduleGeneratorDTO.isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled();
|
||||
Date effectiveDateFrom = actualDisbursementDate.toDate();
|
||||
if(!isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled && actualDisbursementDate.equals(nextPossibleRepaymentDate)){
|
||||
effectiveDateFrom = nextPossibleRepaymentDate.plusDays(1).toDate();
|
||||
}
|
||||
LoanTermVariations loanVariationTerms = new LoanTermVariations(LoanTermVariationType.EMI_AMOUNT.getValue(),
|
||||
actualDisbursementDate.toDate(), emiAmount, dateValue, isSpecificToInstallment, this, LoanStatus.ACTIVE.getValue());
|
||||
effectiveDateFrom, emiAmount, dateValue, isSpecificToInstallment, this, LoanStatus.ACTIVE.getValue());
|
||||
this.loanTermVariations.add(loanVariationTerms);
|
||||
} else {
|
||||
this.fixedEmiAmount = emiAmount;
|
||||
@@ -5082,7 +5087,7 @@ public class Loan extends AbstractPersistable<Long> {
|
||||
this.loanProduct.getInstallmentAmountInMultiplesOf(), recalculationFrequencyType, restCalendarInstance, compoundingMethod,
|
||||
compoundingCalendarInstance, compoundingFrequencyType, this.loanProduct.preCloseInterestCalculationStrategy(),
|
||||
rescheduleStrategyMethod, calendar, getApprovedPrincipal(), annualNominalInterestRate, loanTermVariations, calendarHistoryDataWrapper,
|
||||
scheduleGeneratorDTO.getNumberOfdays(), scheduleGeneratorDTO.isSkipRepaymentOnFirstDayofMonth());
|
||||
scheduleGeneratorDTO.getNumberOfdays(), scheduleGeneratorDTO.isSkipRepaymentOnFirstDayofMonth());
|
||||
return loanApplicationTerms;
|
||||
}
|
||||
|
||||
@@ -5239,6 +5244,7 @@ public class Loan extends AbstractPersistable<Long> {
|
||||
* TODO
|
||||
* @param floatingRateDTO
|
||||
* TODO
|
||||
* @param isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled
|
||||
* @param loanCalendarInstance
|
||||
* Used for accessing the loan's calendar object
|
||||
* @return application terms of the Loan object
|
||||
|
||||
+2
-1
@@ -136,11 +136,12 @@ public class LoanUtilService {
|
||||
isSkipRepaymentOnFirstMonth = isLoanRepaymentsSyncWithMeeting(loan.group(), calendar);
|
||||
if(isSkipRepaymentOnFirstMonth) { numberOfDays = configurationDomainService.retreivePeroidInNumberOfDaysForSkipMeetingDate().intValue(); }
|
||||
}
|
||||
final Boolean isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled = this.configurationDomainService.isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled();
|
||||
|
||||
ScheduleGeneratorDTO scheduleGeneratorDTO = new ScheduleGeneratorDTO(loanScheduleFactory, applicationCurrency,
|
||||
calculatedRepaymentsStartingFromDate, holidayDetails, restCalendarInstance, compoundingCalendarInstance, recalculateFrom,
|
||||
overdurPenaltyWaitPeriod, floatingRateDTO, calendar, calendarHistoryDataWrapper, isInterestChargedFromDateAsDisbursementDateEnabled,
|
||||
numberOfDays, isSkipRepaymentOnFirstMonth);
|
||||
numberOfDays, isSkipRepaymentOnFirstMonth, isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled);
|
||||
|
||||
return scheduleGeneratorDTO;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user