- if (hasFilter) {
- sql = "SELECT distinct tr.id from transactions tr JOIN transaction_accounts ta " +
- "ON ta.transaction_id=tr.id WHERE ta.account_name LIKE ?||'%' AND ta" +
- ".amount <> 0 ORDER BY tr.date desc, tr.id desc";
- params = filterAccName;
+ if (profileId == NO_PROFILE_ID)
+ transactions = new ArrayList<>();
+ else if (accFilter == null) {
+ transactions = DB.get()
+ .getTransactionDAO()
+ .getAllWithAccountsSync(profileId);
+ }
+ else {
+ transactions = DB.get()
+ .getTransactionDAO()
+ .getAllWithAccountsFilteredSync(profileId, accFilter);