MIFOSX-1760 : corrected start date calculation for approval
This commit is contained in:
+2
-2
@@ -1913,7 +1913,7 @@ public class Loan extends AbstractPersistable<Long> {
|
|||||||
// Approved amount has to be less than or equal to principal
|
// Approved amount has to be less than or equal to principal
|
||||||
// amount demanded
|
// amount demanded
|
||||||
|
|
||||||
if (approvedLoanAmount.compareTo(this.proposedPrincipal) < 1) {
|
if (approvedLoanAmount.compareTo(this.proposedPrincipal) == -1) {
|
||||||
|
|
||||||
this.approvedPrincipal = approvedLoanAmount;
|
this.approvedPrincipal = approvedLoanAmount;
|
||||||
|
|
||||||
@@ -1928,7 +1928,7 @@ public class Loan extends AbstractPersistable<Long> {
|
|||||||
actualChanges.put(LoanApiConstants.approvedLoanAmountParameterName, approvedLoanAmount);
|
actualChanges.put(LoanApiConstants.approvedLoanAmountParameterName, approvedLoanAmount);
|
||||||
actualChanges.put(LoanApiConstants.disbursementPrincipalParameterName, approvedLoanAmount);
|
actualChanges.put(LoanApiConstants.disbursementPrincipalParameterName, approvedLoanAmount);
|
||||||
|
|
||||||
} else {
|
} else if(approvedLoanAmount.compareTo(this.proposedPrincipal) == 1){
|
||||||
final String errorMessage = "Loan approved amount can't be greater than loan amount demanded.";
|
final String errorMessage = "Loan approved amount can't be greater than loan amount demanded.";
|
||||||
throw new InvalidLoanStateTransitionException("approval", "amount.can't.be.greater.than.loan.amount.demanded",
|
throw new InvalidLoanStateTransitionException("approval", "amount.can't.be.greater.than.loan.amount.demanded",
|
||||||
errorMessage, this.proposedPrincipal, approvedLoanAmount);
|
errorMessage, this.proposedPrincipal, approvedLoanAmount);
|
||||||
|
|||||||
+4
-1
@@ -523,7 +523,10 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
|||||||
|
|
||||||
final MonetaryCurrency currency = loan.getCurrency();
|
final MonetaryCurrency currency = loan.getCurrency();
|
||||||
ApplicationCurrency applicationCurrency = this.applicationCurrencyRepository.findOneWithNotFoundDetection(currency);
|
ApplicationCurrency applicationCurrency = this.applicationCurrencyRepository.findOneWithNotFoundDetection(currency);
|
||||||
LocalDate calculatedRepaymentsStartingFromDate = loan.getExpectedFirstRepaymentOnDate();
|
final CalendarInstance calendarInstance = this.calendarInstanceRepository.findCalendarInstaneByEntityId(loan.getId(),
|
||||||
|
CalendarEntityType.LOANS.getValue());
|
||||||
|
LocalDate calculatedRepaymentsStartingFromDate = this.getCalculatedRepaymentsStartingFromDate(loan.getDisbursementDate(), loan,
|
||||||
|
calendarInstance);
|
||||||
final boolean isHolidayEnabled = this.configurationDomainService.isRescheduleRepaymentsOnHolidaysEnabled();
|
final boolean isHolidayEnabled = this.configurationDomainService.isRescheduleRepaymentsOnHolidaysEnabled();
|
||||||
final List<Holiday> holidays = this.holidayRepository.findByOfficeIdAndGreaterThanDate(loan.getOfficeId(), loan
|
final List<Holiday> holidays = this.holidayRepository.findByOfficeIdAndGreaterThanDate(loan.getOfficeId(), loan
|
||||||
.getExpectedDisbursedOnLocalDate().toDate(), HolidayStatusType.ACTIVE.getValue());
|
.getExpectedDisbursedOnLocalDate().toDate(), HolidayStatusType.ACTIVE.getValue());
|
||||||
|
|||||||
Reference in New Issue
Block a user