mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 08:14:25 +08:00
total amount on the account list page supports excluding specified accounts (#161)
This commit is contained in:
+11
-3
@@ -1,6 +1,7 @@
|
||||
import { ref, computed } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
import { useSettingsStore } from './setting.ts';
|
||||
import { useUserStore } from './user.ts';
|
||||
import { useExchangeRatesStore } from './exchangeRates.ts';
|
||||
|
||||
@@ -21,6 +22,7 @@ import services from '@/lib/services.ts';
|
||||
import logger from '@/lib/logger.ts';
|
||||
|
||||
export const useAccountsStore = defineStore('accounts', () => {
|
||||
const settingsStore = useSettingsStore();
|
||||
const userStore = useUserStore();
|
||||
const exchangeRatesStore = useExchangeRatesStore();
|
||||
|
||||
@@ -484,7 +486,9 @@ export const useAccountsStore = defineStore('accounts', () => {
|
||||
return '***';
|
||||
}
|
||||
|
||||
const accountsBalance = getAllFilteredAccountsBalance(allCategorizedAccountsMap.value, () => true);
|
||||
const accountsBalance = getAllFilteredAccountsBalance(allCategorizedAccountsMap.value, account =>
|
||||
!settingsStore.appSettings.totalAmountExcludeAccountIds[account.id]
|
||||
);
|
||||
let netAssets = 0;
|
||||
let hasUnCalculatedAmount = false;
|
||||
|
||||
@@ -515,7 +519,9 @@ export const useAccountsStore = defineStore('accounts', () => {
|
||||
return '***';
|
||||
}
|
||||
|
||||
const accountsBalance = getAllFilteredAccountsBalance(allCategorizedAccountsMap.value, account => account.isAsset || false);
|
||||
const accountsBalance = getAllFilteredAccountsBalance(allCategorizedAccountsMap.value, account =>
|
||||
!settingsStore.appSettings.totalAmountExcludeAccountIds[account.id] && (account.isAsset || false)
|
||||
);
|
||||
let totalAssets = 0;
|
||||
let hasUnCalculatedAmount = false;
|
||||
|
||||
@@ -546,7 +552,9 @@ export const useAccountsStore = defineStore('accounts', () => {
|
||||
return '***';
|
||||
}
|
||||
|
||||
const accountsBalance = getAllFilteredAccountsBalance(allCategorizedAccountsMap.value, account => account.isLiability || false);
|
||||
const accountsBalance = getAllFilteredAccountsBalance(allCategorizedAccountsMap.value, account =>
|
||||
!settingsStore.appSettings.totalAmountExcludeAccountIds[account.id] && (account.isLiability || false)
|
||||
);
|
||||
let totalLiabilities = 0;
|
||||
let hasUnCalculatedAmount = false;
|
||||
|
||||
|
||||
@@ -220,6 +220,13 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
updateUserApplicationCloudSettingValue('alwaysShowTransactionPicturesInMobileTransactionEditPage', value);
|
||||
}
|
||||
|
||||
// Account List Page
|
||||
function setTotalAmountExcludeAccountIds(value: Record<string, boolean>): void {
|
||||
updateApplicationSettingsValue('totalAmountExcludeAccountIds', value);
|
||||
appSettings.value.totalAmountExcludeAccountIds = value;
|
||||
updateUserApplicationCloudSettingValue('totalAmountExcludeAccountIds', value);
|
||||
}
|
||||
|
||||
// Exchange Rates Data Page
|
||||
function setCurrencySortByInExchangeRatesPage(value: number): void {
|
||||
updateApplicationSettingsValue('currencySortByInExchangeRatesPage', value);
|
||||
@@ -429,6 +436,8 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
setAutoSaveTransactionDraft,
|
||||
setAutoGetCurrentGeoLocation,
|
||||
setAlwaysShowTransactionPicturesInMobileTransactionEditPage,
|
||||
// -- Account List Page
|
||||
setTotalAmountExcludeAccountIds,
|
||||
// -- Exchange Rates Data Page
|
||||
setCurrencySortByInExchangeRatesPage,
|
||||
// -- Statistics Settings
|
||||
|
||||
Reference in New Issue
Block a user