From: Damyan Ivanov Date: Thu, 25 Mar 2021 21:38:54 +0000 (+0200) Subject: fix SQL when filtering transaction list by account name X-Git-Tag: v0.18.0~99 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=6a4f07bbddf90574b8ed2e4b5a5a4a82285e8cfe;p=mobile-ledger.git fix SQL when filtering transaction list by account name --- 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}; }