use the account / transaction category filter of the statistics page when navigating from the statistics page to the transaction list page

This commit is contained in:
MaysWind
2024-07-07 14:22:03 +08:00
parent dad3f1041e
commit d0e8419b2e
4 changed files with 91 additions and 1 deletions
+29
View File
@@ -228,6 +228,35 @@ export function getAllFilteredAccountsBalance(categorizedAccounts, accountFilter
return ret;
}
export function getFinalAccountIdsByFilteredAccountIds(allAccountsMap, filteredAccountIds) {
let finalAccountIds = '';
if (!allAccountsMap) {
return finalAccountIds;
}
for (let accountId in allAccountsMap) {
if (!Object.prototype.hasOwnProperty.call(allAccountsMap, accountId)) {
continue;
}
const account = allAccountsMap[accountId];
if (filteredAccountIds && !isAccountOrSubAccountsAllChecked(account, filteredAccountIds)) {
continue;
}
if (finalAccountIds.length > 0) {
finalAccountIds += ',';
}
finalAccountIds += account.id;
}
return finalAccountIds;
}
export function getUnifiedSelectedAccountsCurrencyOrDefaultCurrency(allAccounts, selectedAccountIds, defaultCurrency) {
if (!selectedAccountIds) {
return defaultCurrency;