From eadcf7768fcab9e50e3f9843b0b462a264ce887c Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 10 Aug 2025 11:26:27 +0800 Subject: [PATCH] fix the total amount of all sub-accounts under the parent account was not counted after filtering any sub-accounts (#192) --- src/stores/account.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stores/account.ts b/src/stores/account.ts index 66375602..0b81aff3 100644 --- a/src/stores/account.ts +++ b/src/stores/account.ts @@ -492,7 +492,7 @@ export const useAccountsStore = defineStore('accounts', () => { } const accountsBalance = getAllFilteredAccountsBalance(allCategorizedAccountsMap.value, account => - !settingsStore.appSettings.totalAmountExcludeAccountIds[account.id] + !(account.type === AccountType.SingleAccount.type && settingsStore.appSettings.totalAmountExcludeAccountIds[account.id]) ); let netAssets = 0; let hasUnCalculatedAmount = false; @@ -525,7 +525,7 @@ export const useAccountsStore = defineStore('accounts', () => { } const accountsBalance = getAllFilteredAccountsBalance(allCategorizedAccountsMap.value, account => - !settingsStore.appSettings.totalAmountExcludeAccountIds[account.id] && (account.isAsset || false) + (account.isAsset || false) && !(account.type === AccountType.SingleAccount.type && settingsStore.appSettings.totalAmountExcludeAccountIds[account.id]) ); let totalAssets = 0; let hasUnCalculatedAmount = false; @@ -558,7 +558,7 @@ export const useAccountsStore = defineStore('accounts', () => { } const accountsBalance = getAllFilteredAccountsBalance(allCategorizedAccountsMap.value, account => - !settingsStore.appSettings.totalAmountExcludeAccountIds[account.id] && (account.isLiability || false) + (account.isLiability || false) && !(account.type === AccountType.SingleAccount.type && settingsStore.appSettings.totalAmountExcludeAccountIds[account.id]) ); let totalLiabilities = 0; let hasUnCalculatedAmount = false;