From 6a4f07bbddf90574b8ed2e4b5a5a4a82285e8cfe Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 25 Mar 2021 23:38:54 +0200 Subject: [PATCH] fix SQL when filtering transaction list by account name --- .../ktnx/mobileledger/async/UpdateTransactionsTask.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/async/UpdateTransactionsTask.java b/app/src/main/java/net/ktnx/mobileledger/async/UpdateTransactionsTask.java index 9e7c8101..c7f0ad82 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/UpdateTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/UpdateTransactionsTask.java @@ -50,12 +50,9 @@ public class UpdateTransactionsTask extends AsyncTask { } else { sql = "SELECT distinct tr.id, tr.year, tr.month, tr.day from transactions tr " + - "JOIN " + "transaction_accounts ta " + - "ON ta.transaction_id=tr.id AND ta.profile=tr.profile WHERE tr.profile_id=?" + - " " + - "and ta.account_name LIKE ?||'%' AND ta" + - ".amount <> 0 ORDER BY tr.year desc, tr.month desc, tr.day desc, tr.id " + - "desc"; + "JOIN transaction_accounts ta ON ta.transaction_id=tr.id WHERE tr" + + ".profile_id=? and ta.account_name LIKE ?||'%' AND ta.amount <> 0 ORDER " + + "BY tr.year desc, tr.month desc, tr.day desc, tr.id " + "desc"; params = new String[]{String.valueOf(profile_id), accFilter}; } -- 2.39.5