]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fix SQL when filtering transaction list by account name
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 25 Mar 2021 21:38:54 +0000 (23:38 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 25 Mar 2021 21:38:54 +0000 (23:38 +0200)
app/src/main/java/net/ktnx/mobileledger/async/UpdateTransactionsTask.java

index 9e7c8101b669a91b106fbba811c101ebb11c27f3..c7f0ad828e43a89c6b40dcca98a7f759acfedea8 100644 (file)
@@ -50,12 +50,9 @@ public class UpdateTransactionsTask extends AsyncTask<MainModel, Void, String> {
             }
             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};
             }