diff --git a/src/stores/account.ts b/src/stores/account.ts index c98365a6..a6a60588 100644 --- a/src/stores/account.ts +++ b/src/stores/account.ts @@ -50,6 +50,29 @@ export const useAccountsStore = defineStore('accounts', () => { return Account.sortAccounts(allAccountsList, allAccountsMap.value); }); + const allMixedPlainAccounts = computed(() => { + const allAccountsList: Account[] = []; + + for (let i = 0; i < allAccounts.value.length; i++) { + const account = allAccounts.value[i]; + + if (account.type === AccountType.SingleAccount.type) { + allAccountsList.push(account); + } else if (account.type === AccountType.MultiSubAccounts.type) { + allAccountsList.push(account); + + if (account.subAccounts) { + for (let j = 0; j < account.subAccounts.length; j++) { + const subAccount = account.subAccounts[j]; + allAccountsList.push(subAccount); + } + } + } + } + + return Account.sortAccounts(allAccountsList, allAccountsMap.value); + }); + const allVisiblePlainAccounts = computed(() => { const allVisibleAccounts: Account[] = []; @@ -982,6 +1005,7 @@ export const useAccountsStore = defineStore('accounts', () => { accountListStateInvalid, // computed states allPlainAccounts, + allMixedPlainAccounts, allVisiblePlainAccounts, allAvailableAccountsCount, allVisibleAccountsCount, diff --git a/src/views/base/transactions/TransactionListPageBase.ts b/src/views/base/transactions/TransactionListPageBase.ts index 26038088..60ad5001 100644 --- a/src/views/base/transactions/TransactionListPageBase.ts +++ b/src/views/base/transactions/TransactionListPageBase.ts @@ -66,7 +66,7 @@ export function useTransactionListPageBase() { const allDateRanges = computed(() => getAllDateRanges(DateRangeScene.Normal, true, !!accountsStore.getAccountStatementDate(query.value.accountIds))); - const allAccounts = computed(() => accountsStore.allPlainAccounts); + const allAccounts = computed(() => accountsStore.allMixedPlainAccounts); const allAccountsMap = computed>(() => accountsStore.allAccountsMap); const allAvailableAccountsCount = computed(() => accountsStore.allAvailableAccountsCount); const allPrimaryCategories = computed>(() => {