remove warnings, format sections.
This commit is contained in:
+36
-20
@@ -83,7 +83,6 @@ public class DepositAccount extends AbstractAuditableCustom<AppUser, Long> {
|
|||||||
@Column(name = "projected_interest_accrued_on_maturity", scale = 6, precision = 19, nullable = false)
|
@Column(name = "projected_interest_accrued_on_maturity", scale = 6, precision = 19, nullable = false)
|
||||||
private BigDecimal projectedInterestAccruedOnMaturity;
|
private BigDecimal projectedInterestAccruedOnMaturity;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
@Column(name = "actual_interest_accrued", scale = 6, precision = 19, nullable = false)
|
@Column(name = "actual_interest_accrued", scale = 6, precision = 19, nullable = false)
|
||||||
private BigDecimal interestAccrued;
|
private BigDecimal interestAccrued;
|
||||||
|
|
||||||
@@ -158,13 +157,18 @@ public class DepositAccount extends AbstractAuditableCustom<AppUser, Long> {
|
|||||||
final boolean isInterstWithdrawable,final boolean interestCompoundingAllowed) {
|
final boolean isInterstWithdrawable,final boolean interestCompoundingAllowed) {
|
||||||
|
|
||||||
Money futureValueOnMaturity =null;
|
Money futureValueOnMaturity =null;
|
||||||
|
|
||||||
if(interestCompoundingAllowed){
|
if (interestCompoundingAllowed) {
|
||||||
futureValueOnMaturity = fixedTermDepositInterestCalculator.calculateInterestOnMaturityFor(deposit, tenureInMonths,
|
futureValueOnMaturity = fixedTermDepositInterestCalculator
|
||||||
maturityInterestRate, interestCompoundedEvery, interestCompoundedFrequencyPeriodType);
|
.calculateInterestOnMaturityFor(deposit, tenureInMonths,
|
||||||
}else if(!interestCompoundingAllowed){
|
maturityInterestRate, interestCompoundedEvery,
|
||||||
futureValueOnMaturity = fixedTermDepositInterestCalculator.calculateInterestOnMaturityForSimpleInterest(deposit, tenureInMonths,
|
interestCompoundedFrequencyPeriodType);
|
||||||
maturityInterestRate, interestCompoundedEvery, interestCompoundedFrequencyPeriodType);
|
} else {
|
||||||
|
futureValueOnMaturity = fixedTermDepositInterestCalculator
|
||||||
|
.calculateInterestOnMaturityForSimpleInterest(deposit,
|
||||||
|
tenureInMonths, maturityInterestRate,
|
||||||
|
interestCompoundedEvery,
|
||||||
|
interestCompoundedFrequencyPeriodType);
|
||||||
}
|
}
|
||||||
|
|
||||||
DepositAccountStatus from = null;
|
DepositAccountStatus from = null;
|
||||||
@@ -276,15 +280,20 @@ public class DepositAccount extends AbstractAuditableCustom<AppUser, Long> {
|
|||||||
|
|
||||||
Money futureValueOnMaturity =null;
|
Money futureValueOnMaturity =null;
|
||||||
|
|
||||||
if(this.interestCompoundingAllowed){
|
if (this.interestCompoundingAllowed) {
|
||||||
futureValueOnMaturity = calculator.calculateInterestOnMaturityFor(getDeposit(), this.tenureInMonths,
|
futureValueOnMaturity = calculator.calculateInterestOnMaturityFor(
|
||||||
this.interestRate, this.interestCompoundedEvery, getInterestCompoundedFrequencyType());
|
getDeposit(), this.tenureInMonths, this.interestRate,
|
||||||
} else if(!this.interestCompoundingAllowed){
|
this.interestCompoundedEvery,
|
||||||
futureValueOnMaturity = calculator.calculateInterestOnMaturityForSimpleInterest(getDeposit(), this.tenureInMonths,
|
getInterestCompoundedFrequencyType());
|
||||||
this.interestRate, this.interestCompoundedEvery, getInterestCompoundedFrequencyType());
|
} else {
|
||||||
}
|
futureValueOnMaturity = calculator
|
||||||
|
.calculateInterestOnMaturityForSimpleInterest(getDeposit(),
|
||||||
|
this.tenureInMonths, this.interestRate,
|
||||||
|
this.interestCompoundedEvery,
|
||||||
|
getInterestCompoundedFrequencyType());
|
||||||
|
}
|
||||||
this.interestAccrued = futureValueOnMaturity.minus(getDeposit()).getAmount();
|
this.interestAccrued = futureValueOnMaturity.minus(getDeposit()).getAmount();
|
||||||
this.total = this.interestCompoundingAllowed?futureValueOnMaturity.getAmount():getDeposit().getAmount();
|
this.total = this.interestCompoundingAllowed ? futureValueOnMaturity.getAmount() : getDeposit().getAmount();
|
||||||
|
|
||||||
DepositAccountTransaction depositaccountTransaction = DepositAccountTransaction.deposit(getDeposit(), getActualCommencementDate(),getAccuredInterest());
|
DepositAccountTransaction depositaccountTransaction = DepositAccountTransaction.deposit(getDeposit(), getActualCommencementDate(),getAccuredInterest());
|
||||||
depositaccountTransaction.updateAccount(this);
|
depositaccountTransaction.updateAccount(this);
|
||||||
@@ -572,10 +581,17 @@ public class DepositAccount extends AbstractAuditableCustom<AppUser, Long> {
|
|||||||
|
|
||||||
Money deposit = Money.of(account.getDeposit().getCurrency(), account.getDeposit().getAmount());
|
Money deposit = Money.of(account.getDeposit().getCurrency(), account.getDeposit().getAmount());
|
||||||
Money accuredtotalAmount = null;
|
Money accuredtotalAmount = null;
|
||||||
if(account.isInterestCompoundingAllowed()){
|
if (account.isInterestCompoundingAllowed()) {
|
||||||
accuredtotalAmount = fixedTermDepositInterestCalculator.calculateInterestOnMaturityFor(deposit, tenure, preClosureInterestRate, interestCompoundedEvery, this.product.getInterestCompoundedEveryPeriodType());
|
accuredtotalAmount = fixedTermDepositInterestCalculator
|
||||||
}else if(!account.isInterestCompoundingAllowed()){
|
.calculateInterestOnMaturityFor(deposit, tenure,
|
||||||
accuredtotalAmount = fixedTermDepositInterestCalculator.calculateInterestOnMaturityForSimpleInterest(deposit, tenure, preClosureInterestRate, interestCompoundedEvery, this.product.getInterestCompoundedEveryPeriodType());
|
preClosureInterestRate, interestCompoundedEvery,
|
||||||
|
this.product.getInterestCompoundedEveryPeriodType());
|
||||||
|
} else {
|
||||||
|
accuredtotalAmount = fixedTermDepositInterestCalculator
|
||||||
|
.calculateInterestOnMaturityForSimpleInterest(deposit,
|
||||||
|
tenure, preClosureInterestRate,
|
||||||
|
interestCompoundedEvery,
|
||||||
|
this.product.getInterestCompoundedEveryPeriodType());
|
||||||
}
|
}
|
||||||
this.total = account.isInterestCompoundingAllowed()?accuredtotalAmount.getAmount():getDeposit().getAmount();
|
this.total = account.isInterestCompoundingAllowed()?accuredtotalAmount.getAmount():getDeposit().getAmount();
|
||||||
this.interestAccrued = accuredtotalAmount.minus(deposit).getAmount();
|
this.interestAccrued = accuredtotalAmount.minus(deposit).getAmount();
|
||||||
|
|||||||
Reference in New Issue
Block a user