From 31aaccec51ff50d376e4bb5c214a5f9eb386da83 Mon Sep 17 00:00:00 2001 From: "Emmanuele (WolfSolver)" Date: Sat, 27 Jul 2024 19:39:04 +0200 Subject: [PATCH 1/3] // Close issue #1706 --- .../transactions/RecurringTransactionListFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListFragment.java b/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListFragment.java index 3d8259e755..611a7df6b7 100644 --- a/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListFragment.java +++ b/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListFragment.java @@ -457,6 +457,7 @@ private void startRecurringTransactionEditActivity(Integer billDepositsId, int p intent.setAction(Intent.ACTION_INSERT); } // launch activity - startActivityForResult(intent, purposeCode); + // startActivityForResult(intent, purposeCode); + startActivity(intent); // Close issue #1706 } } From 84d4811e34f9abbaf614b6ff608db773a56e63c1 Mon Sep 17 00:00:00 2001 From: "Emmanuele (WolfSolver)" Date: Sun, 28 Jul 2024 12:37:42 +0200 Subject: [PATCH 2/3] Solve known issue: [X] Open Edit Dialog for insert Recurring Transaction in mode Prompt [ ] Prevent multiple recurring transaction list when call via notification --- .../RecurringTransactionListActivity.java | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListActivity.java b/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListActivity.java index 9ce4a174f9..c15d09a700 100644 --- a/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListActivity.java +++ b/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListActivity.java @@ -16,12 +16,15 @@ */ package com.money.manager.ex.recurring.transactions; +import static android.app.PendingIntent.getActivity; + import android.app.NotificationManager; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.widget.Toast; +import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import com.money.manager.ex.PasscodeActivity; @@ -36,6 +39,8 @@ import com.money.manager.ex.notifications.RecurringTransactionNotifications; import com.money.manager.ex.servicelayer.RecurringTransactionService; import com.money.manager.ex.settings.AppSettings; +import com.money.manager.ex.transactions.CheckingTransactionEditActivity; +import com.money.manager.ex.transactions.EditTransactionActivityConstants; /** * Not used. @@ -84,7 +89,7 @@ protected void onCreate(Bundle savedInstanceState) { } if ( action.equals("SKIP") || action.equals("ENTER")) { - // ToDo Skip or enter Occurrence + // Skip or enter Occurrence NotificationManager notificationManager = (NotificationManager) getApplication().getApplicationContext() .getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancel(trxid); @@ -103,10 +108,22 @@ protected void onCreate(Bundle savedInstanceState) { // showCreateTransactionActivity(trxid); // } else { RecurringTransactionService service = new RecurringTransactionService(trxid, this); - AccountTransactionRepository accountTransactionRepository = new AccountTransactionRepository(getApplicationContext()); - AccountTransaction accountTrx = service.getAccountTransactionFromRecurring(); - accountTransactionRepository.insert(accountTrx); - service.moveNextOccurrence(); + RecurringTransaction tx = service.load(trxid); + if ( tx.isRecurringModeAuto()) { + AccountTransactionRepository accountTransactionRepository = new AccountTransactionRepository(getApplicationContext()); + AccountTransaction accountTrx = service.getAccountTransactionFromRecurring(); + accountTransactionRepository.insert(accountTrx); + service.moveNextOccurrence(); + } else { + // showCreateTransactionActivity(trxid); + Intent intent = new Intent(this, CheckingTransactionEditActivity.class); + intent.setAction(Intent.ACTION_INSERT); + intent.putExtra(EditTransactionActivityConstants.KEY_BDID_ID, trxid); + intent.putExtra(EditTransactionActivityConstants.KEY_TRANS_SOURCE, "RecurringTransactionListFragment.java"); + // start for insert new transaction + startActivity(intent, savedInstanceState); +// startActivityForResult(intent, 1002); // TODO REQUEST_ADD_TRANSACTION + } // } From 177ea0452e8601dbb49f1b621e88687697faddb7 Mon Sep 17 00:00:00 2001 From: wolfsolver Date: Sun, 28 Jul 2024 14:14:33 +0200 Subject: [PATCH 3/3] Update RecurringTransactionListFragment.java --- .../transactions/RecurringTransactionListFragment.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListFragment.java b/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListFragment.java index 611a7df6b7..3d8259e755 100644 --- a/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListFragment.java +++ b/app/src/main/java/com/money/manager/ex/recurring/transactions/RecurringTransactionListFragment.java @@ -457,7 +457,6 @@ private void startRecurringTransactionEditActivity(Integer billDepositsId, int p intent.setAction(Intent.ACTION_INSERT); } // launch activity - // startActivityForResult(intent, purposeCode); - startActivity(intent); // Close issue #1706 + startActivityForResult(intent, purposeCode); } }