mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 16:24:25 +08:00
total amount on the account list page supports excluding specified accounts (#161)
This commit is contained in:
+15
-3
@@ -265,7 +265,7 @@ export function selectAccountOrSubAccounts(filterAccountIds: Record<string, bool
|
||||
}
|
||||
}
|
||||
|
||||
export function selectAll(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>): void {
|
||||
export function selectAll(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>, skipHiddenAccount: boolean): void {
|
||||
for (const accountId in filterAccountIds) {
|
||||
if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) {
|
||||
continue;
|
||||
@@ -273,13 +273,17 @@ export function selectAll(filterAccountIds: Record<string, boolean>, allAccounts
|
||||
|
||||
const account = allAccountsMap[accountId];
|
||||
|
||||
if (skipHiddenAccount && account && account.hidden) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (account && account.type === AccountType.SingleAccount.type) {
|
||||
filterAccountIds[account.id] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function selectNone(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>): void {
|
||||
export function selectNone(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>, skipHiddenAccount: boolean): void {
|
||||
for (const accountId in filterAccountIds) {
|
||||
if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) {
|
||||
continue;
|
||||
@@ -287,13 +291,17 @@ export function selectNone(filterAccountIds: Record<string, boolean>, allAccount
|
||||
|
||||
const account = allAccountsMap[accountId];
|
||||
|
||||
if (skipHiddenAccount && account && account.hidden) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (account && account.type === AccountType.SingleAccount.type) {
|
||||
filterAccountIds[account.id] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function selectInvert(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>): void {
|
||||
export function selectInvert(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>, skipHiddenAccount: boolean): void {
|
||||
for (const accountId in filterAccountIds) {
|
||||
if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) {
|
||||
continue;
|
||||
@@ -301,6 +309,10 @@ export function selectInvert(filterAccountIds: Record<string, boolean>, allAccou
|
||||
|
||||
const account = allAccountsMap[accountId];
|
||||
|
||||
if (skipHiddenAccount && account && account.hidden) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (account && account.type === AccountType.SingleAccount.type) {
|
||||
filterAccountIds[account.id] = !filterAccountIds[account.id];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user