private double checkIfTransactionsExist(boolean checkAll) { double amount = 0.0; for (Transaction t : transactions) amount += t.getAmount(); return amount; }
private boolean isThereWithdrawl() { long diff = 0; long diffDays = 0; Date now = DateProvider.getInstance().now(); Date transactionDate = null; for (Transaction t : transactions) { if (t.getAmount() < 0) { transactionDate = t.getTransactionDate(); diff = now.getTime() - transactionDate.getTime(); diffDays = diff / (24 * 60 * 60 * 1000) + 1; if (diffDays < 10) { return true; } } } return false; }