Skip to content

Commit

Permalink
Merge branch 'FINERACT-221' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nazeer1100126 committed Jan 31, 2017
2 parents e1a0e3f + e92b6b1 commit b6f4230
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1268,9 +1268,14 @@ public void updateLoanSummarAndStatus() {
}

public Map<String, Object> loanApplicationModification(final JsonCommand command, final Set<LoanCharge> possiblyModifedLoanCharges,
final Set<LoanCollateral> possiblyModifedLoanCollateralItems, final AprCalculator aprCalculator, boolean isChargesModified) {
final Set<LoanCollateral> possiblyModifedLoanCollateralItems, final AprCalculator aprCalculator, boolean isChargesModified,
final LoanProduct loanProduct) {

final Map<String, Object> actualChanges = this.loanRepaymentScheduleDetail.updateLoanApplicationAttributes(command, aprCalculator);
final MonetaryCurrency currency = new MonetaryCurrency(loanProduct.getCurrency().getCode(), loanProduct.getCurrency().getDigitsAfterDecimal(),
loanProduct.getCurrency().getCurrencyInMultiplesOf());
this.loanRepaymentScheduleDetail.updateCurrency(currency);

if (!actualChanges.isEmpty()) {
final boolean recalculateLoanSchedule = !(actualChanges.size() == 1 && actualChanges.containsKey("inArrearsTolerance"));
actualChanges.put("recalculateLoanSchedule", recalculateLoanSchedule);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ public CommandProcessingResult modifyApplication(final Long loanId, final JsonCo


final Map<String, Object> changes = existingLoanApplication.loanApplicationModification(command, possiblyModifedLoanCharges,
possiblyModifedLoanCollateralItems, this.aprCalculator, isChargeModified);
possiblyModifedLoanCollateralItems, this.aprCalculator, isChargeModified, loanProductForValidations);

if (changes.containsKey("expectedDisbursementDate")) {
this.loanAssembler.validateExpectedDisbursementForHolidayAndNonWorkingDay(existingLoanApplication);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ public Map<String, Object> updateLoanApplicationAttributes(final JsonCommand com
return actualChanges;
}

public void updateCurrency(final MonetaryCurrency currency) {
this.currency = currency ;
}

public void validateRepaymentPeriodWithGraceSettings() {
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loanproduct");
Expand Down

0 comments on commit b6f4230

Please sign in to comment.