From 2f00b6a48260e7de801111159c80026ba48ae0e7 Mon Sep 17 00:00:00 2001 From: Tib Teng <661892+tiberiusteng@users.noreply.github.com> Date: Fri, 31 Jan 2025 03:48:03 +0900 Subject: [PATCH] feat: mass op can mark transactions pending, restored, unreconciled improve mass op action legibility #60 --- app/src/main/AndroidManifest.xml | 2 +- .../financisto/activity/MassOpFragment.java | 115 +++++++++++++++++- .../tw/tib/financisto/db/DatabaseAdapter.java | 29 +++++ app/src/main/res/layout/blotter_mass_op.xml | 3 +- .../main/res/layout/mass_op_action_item.xml | 33 +++++ app/src/main/res/values-zh-rTW/strings.xml | 3 + app/src/main/res/values/strings.xml | 3 + 7 files changed, 184 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/layout/mass_op_action_item.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a23076f..6ab42b2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,7 +12,7 @@ getSystemAttributesForTransaction(long t } } + /** + * Sets status=RS (Restored) for the selected transactions + * + * @param ids selected transactions' ids + */ + public void markRestoredSelectedTransactions(long[] ids) { + String sql = "UPDATE " + DatabaseHelper.TRANSACTION_TABLE + " SET " + DatabaseHelper.TransactionColumns.status + "='" + TransactionStatus.RS + "'"; + runInTransaction(sql, ids); + } + + /** + * Sets status=PN (Pending) for the selected transactions + * + * @param ids selected transactions' ids + */ + public void markPendingSelectedTransactions(long[] ids) { + String sql = "UPDATE " + DatabaseHelper.TRANSACTION_TABLE + " SET " + DatabaseHelper.TransactionColumns.status + "='" + TransactionStatus.PN + "'"; + runInTransaction(sql, ids); + } + + /** + * Sets status=UR (Unreconciled) for the selected transactions + * + * @param ids selected transactions' ids + */ + public void markUnreconciledSelectedTransactions(long[] ids) { + String sql = "UPDATE " + DatabaseHelper.TRANSACTION_TABLE + " SET " + DatabaseHelper.TransactionColumns.status + "='" + TransactionStatus.UR + "'"; + runInTransaction(sql, ids); + } /** * Sets status=CL (Cleared) for the selected transactions diff --git a/app/src/main/res/layout/blotter_mass_op.xml b/app/src/main/res/layout/blotter_mass_op.xml index 72b1dc8..0294cdc 100644 --- a/app/src/main/res/layout/blotter_mass_op.xml +++ b/app/src/main/res/layout/blotter_mass_op.xml @@ -13,11 +13,12 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index b6ed861..a50bd01 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -539,6 +539,9 @@ UnionPay PayPal 以過濾條件搜尋交易 + 全部標記復原 + 全部標記擱置 + 全部標記未對帳 全部清算 全部對帳 全部刪除 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3c46052..2cb4cf5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -608,6 +608,9 @@ Mass operations PayPal Use filter to search for transactions + Mark Restored all + Mark Pending all + Mark Unreconciled all Clear all Reconcile all Delete all