remove warnings
This commit is contained in:
+21
-10
@@ -184,7 +184,7 @@ public class DepositAccountData {
|
|||||||
this.interestPaid=account.getInterestPaid();
|
this.interestPaid=account.getInterestPaid();
|
||||||
this.isInterestWithdrawable=account.isInterestWithdrawable();
|
this.isInterestWithdrawable=account.isInterestWithdrawable();
|
||||||
this.interestCompoundingAllowed = account.isInterestCompoundingAllowed();
|
this.interestCompoundingAllowed = account.isInterestCompoundingAllowed();
|
||||||
this.availableInterestForWithdrawal=getAvailableInterestForWithdrawal(account);;
|
this.availableInterestForWithdrawal=determineAvailableInterestForWithdrawal(account);;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DepositAccountData(
|
public DepositAccountData(
|
||||||
@@ -444,15 +444,26 @@ public class DepositAccountData {
|
|||||||
public BigDecimal getAvailableInterestForWithdrawal() {
|
public BigDecimal getAvailableInterestForWithdrawal() {
|
||||||
return availableInterestForWithdrawal;
|
return availableInterestForWithdrawal;
|
||||||
}
|
}
|
||||||
public BigDecimal getAvailableInterestForWithdrawal(DepositAccountData account) {
|
|
||||||
if(account.getStatus().getId()==300){
|
private BigDecimal determineAvailableInterestForWithdrawal(final DepositAccountData account) {
|
||||||
BigDecimal interstGettingForPeriod = BigDecimal.valueOf(account.getActualInterestAccrued().doubleValue()/new Double(account.getTenureInMonths()));
|
BigDecimal availableInterestForWithdrawal = BigDecimal.ZERO;
|
||||||
Integer noOfMonthsforInterestCal = Months.monthsBetween(account.getActualCommencementDate(), new LocalDate()).getMonths();
|
|
||||||
Integer noOfPeriods = noOfMonthsforInterestCal / account.getInterestCompoundedEvery();
|
if (account.getStatus().getId() == 300) {
|
||||||
return BigDecimal.valueOf(interstGettingForPeriod.multiply(new BigDecimal(noOfPeriods)).doubleValue()-account.getInterestPaid().doubleValue());
|
BigDecimal interestGettingForPeriod = BigDecimal.valueOf(account
|
||||||
}
|
.getActualInterestAccrued().doubleValue()
|
||||||
else{
|
/ new Double(account.getTenureInMonths()));
|
||||||
return new BigDecimal(0);
|
Integer noOfMonthsforInterestCal = Months.monthsBetween(
|
||||||
|
account.getActualCommencementDate(), new LocalDate())
|
||||||
|
.getMonths();
|
||||||
|
Integer noOfPeriods = noOfMonthsforInterestCal
|
||||||
|
/ account.getInterestCompoundedEvery();
|
||||||
|
|
||||||
|
availableInterestForWithdrawal = BigDecimal
|
||||||
|
.valueOf(interestGettingForPeriod.multiply(
|
||||||
|
new BigDecimal(noOfPeriods)).doubleValue()
|
||||||
|
- account.getInterestPaid().doubleValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return availableInterestForWithdrawal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
@@ -45,9 +45,11 @@ public class DepositAccountTransaction extends AbstractPersistable<Long> {
|
|||||||
@Column(name = "amount", scale = 6, precision = 19, nullable = false)
|
@Column(name = "amount", scale = 6, precision = 19, nullable = false)
|
||||||
private final BigDecimal amount;
|
private final BigDecimal amount;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
@Column(name = "interest", scale = 6, precision = 19, nullable = false)
|
@Column(name = "interest", scale = 6, precision = 19, nullable = false)
|
||||||
private final BigDecimal interest;
|
private final BigDecimal interest;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
@Column(name = "total", scale = 6, precision = 19, nullable = false)
|
@Column(name = "total", scale = 6, precision = 19, nullable = false)
|
||||||
private final BigDecimal total;
|
private final BigDecimal total;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user