FINERACT-1971: Down payment (auto) transaction using installment multiples of setting
This commit is contained in:
committed by
Adam Saghy
parent
7499859d39
commit
849790ea46
+3
-1
@@ -2968,7 +2968,9 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
|
||||
}
|
||||
Money downPaymentMoney = Money.of(getCurrency(),
|
||||
MathUtil.percentageOf(disbursementTransaction.getAmount(), disbursedAmountPercentageForDownPayment, 19));
|
||||
|
||||
if (getLoanProduct().getInstallmentAmountInMultiplesOf() != null) {
|
||||
downPaymentMoney = Money.roundToMultiplesOf(downPaymentMoney, getLoanProduct().getInstallmentAmountInMultiplesOf());
|
||||
}
|
||||
Money adjustedDownPaymentMoney = switch (getLoanProductRelatedDetail().getLoanScheduleType()) {
|
||||
// For Cumulative loan: To check whether the loan was overpaid when the disbursement happened and to get the
|
||||
// proper amount after the disbursement we are using two balances:
|
||||
|
||||
+3
-2
@@ -1206,10 +1206,11 @@ public final class LoanApplicationTerms {
|
||||
double installmentAmount = FinanicalFunctions.pmt(periodicInterestRate.doubleValue(), periodsRemaining.doubleValue(),
|
||||
principalDouble, futureValue, false);
|
||||
|
||||
BigDecimal fixedEmiAmount = BigDecimal.valueOf(installmentAmount);
|
||||
if (this.installmentAmountInMultiplesOf != null) {
|
||||
installmentAmount = Money.roundToMultiplesOf(installmentAmount, this.installmentAmountInMultiplesOf);
|
||||
fixedEmiAmount = Money.roundToMultiplesOf(fixedEmiAmount, this.installmentAmountInMultiplesOf);
|
||||
}
|
||||
setFixedEmiAmount(BigDecimal.valueOf(installmentAmount));
|
||||
setFixedEmiAmount(fixedEmiAmount);
|
||||
}
|
||||
return getFixedEmiAmount().doubleValue();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user