remove warnings

This commit is contained in:
Keith Woodlock
2012-09-26 10:18:41 +01:00
parent c08a76dd94
commit 3617197f5f
2 changed files with 23 additions and 10 deletions
@@ -184,7 +184,7 @@ public class DepositAccountData {
this.interestPaid=account.getInterestPaid();
this.isInterestWithdrawable=account.isInterestWithdrawable();
this.interestCompoundingAllowed = account.isInterestCompoundingAllowed();
this.availableInterestForWithdrawal=getAvailableInterestForWithdrawal(account);;
this.availableInterestForWithdrawal=determineAvailableInterestForWithdrawal(account);;
}
public DepositAccountData(
@@ -444,15 +444,26 @@ public class DepositAccountData {
public BigDecimal getAvailableInterestForWithdrawal() {
return availableInterestForWithdrawal;
}
public BigDecimal getAvailableInterestForWithdrawal(DepositAccountData account) {
if(account.getStatus().getId()==300){
BigDecimal interstGettingForPeriod = BigDecimal.valueOf(account.getActualInterestAccrued().doubleValue()/new Double(account.getTenureInMonths()));
Integer noOfMonthsforInterestCal = Months.monthsBetween(account.getActualCommencementDate(), new LocalDate()).getMonths();
Integer noOfPeriods = noOfMonthsforInterestCal / account.getInterestCompoundedEvery();
return BigDecimal.valueOf(interstGettingForPeriod.multiply(new BigDecimal(noOfPeriods)).doubleValue()-account.getInterestPaid().doubleValue());
}
else{
return new BigDecimal(0);
private BigDecimal determineAvailableInterestForWithdrawal(final DepositAccountData account) {
BigDecimal availableInterestForWithdrawal = BigDecimal.ZERO;
if (account.getStatus().getId() == 300) {
BigDecimal interestGettingForPeriod = BigDecimal.valueOf(account
.getActualInterestAccrued().doubleValue()
/ new Double(account.getTenureInMonths()));
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;
}
}
@@ -45,9 +45,11 @@ public class DepositAccountTransaction extends AbstractPersistable<Long> {
@Column(name = "amount", scale = 6, precision = 19, nullable = false)
private final BigDecimal amount;
@SuppressWarnings("unused")
@Column(name = "interest", scale = 6, precision = 19, nullable = false)
private final BigDecimal interest;
@SuppressWarnings("unused")
@Column(name = "total", scale = 6, precision = 19, nullable = false)
private final BigDecimal total;