remove warnings
This commit is contained in:
+21
-10
@@ -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;
|
||||
}
|
||||
}
|
||||
+2
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user