FINERACT-221-After submitting the modify application the currency is not getting updated as per the new product
This commit is contained in:
+6
-1
@@ -1268,9 +1268,14 @@ public class Loan extends AbstractPersistableCustom<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> loanApplicationModification(final JsonCommand command, final Set<LoanCharge> possiblyModifedLoanCharges,
|
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 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()) {
|
if (!actualChanges.isEmpty()) {
|
||||||
final boolean recalculateLoanSchedule = !(actualChanges.size() == 1 && actualChanges.containsKey("inArrearsTolerance"));
|
final boolean recalculateLoanSchedule = !(actualChanges.size() == 1 && actualChanges.containsKey("inArrearsTolerance"));
|
||||||
actualChanges.put("recalculateLoanSchedule", recalculateLoanSchedule);
|
actualChanges.put("recalculateLoanSchedule", recalculateLoanSchedule);
|
||||||
|
|||||||
+1
-1
@@ -605,7 +605,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
|
|
||||||
|
|
||||||
final Map<String, Object> changes = existingLoanApplication.loanApplicationModification(command, possiblyModifedLoanCharges,
|
final Map<String, Object> changes = existingLoanApplication.loanApplicationModification(command, possiblyModifedLoanCharges,
|
||||||
possiblyModifedLoanCollateralItems, this.aprCalculator, isChargeModified);
|
possiblyModifedLoanCollateralItems, this.aprCalculator, isChargeModified, loanProductForValidations);
|
||||||
|
|
||||||
if (changes.containsKey("expectedDisbursementDate")) {
|
if (changes.containsKey("expectedDisbursementDate")) {
|
||||||
this.loanAssembler.validateExpectedDisbursementForHolidayAndNonWorkingDay(existingLoanApplication);
|
this.loanAssembler.validateExpectedDisbursementForHolidayAndNonWorkingDay(existingLoanApplication);
|
||||||
|
|||||||
+4
@@ -499,6 +499,10 @@ public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentSche
|
|||||||
return actualChanges;
|
return actualChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateCurrency(final MonetaryCurrency currency) {
|
||||||
|
this.currency = currency ;
|
||||||
|
}
|
||||||
|
|
||||||
public void validateRepaymentPeriodWithGraceSettings() {
|
public void validateRepaymentPeriodWithGraceSettings() {
|
||||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loanproduct");
|
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loanproduct");
|
||||||
|
|||||||
Reference in New Issue
Block a user