total amount on the account list page supports excluding specified accounts (#161)

This commit is contained in:
MaysWind
2025-06-29 22:27:34 +08:00
parent 90e862fbb1
commit 801c0f8572
25 changed files with 305 additions and 24 deletions
+2
View File
@@ -27,6 +27,8 @@ var ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES = map[string]UserApplicationClo
"autoSaveTransactionDraft": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING, "autoSaveTransactionDraft": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING,
"autoGetCurrentGeoLocation": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN, "autoGetCurrentGeoLocation": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
"alwaysShowTransactionPicturesInMobileTransactionEditPage": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN, "alwaysShowTransactionPicturesInMobileTransactionEditPage": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
// Account List Page
"totalAmountExcludeAccountIds": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP,
// Exchange Rates Data Page // Exchange Rates Data Page
"currencySortByInExchangeRatesPage": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER, "currencySortByInExchangeRatesPage": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
// Statistics Settings // Statistics Settings
+6
View File
@@ -45,6 +45,8 @@ export interface ApplicationSettings extends BaseApplicationSetting {
autoSaveTransactionDraft: string; autoSaveTransactionDraft: string;
autoGetCurrentGeoLocation: boolean; autoGetCurrentGeoLocation: boolean;
alwaysShowTransactionPicturesInMobileTransactionEditPage: boolean; alwaysShowTransactionPicturesInMobileTransactionEditPage: boolean;
// Account List Page
totalAmountExcludeAccountIds: Record<string, boolean>;
// Exchange Rates Data Page // Exchange Rates Data Page
currencySortByInExchangeRatesPage: number; currencySortByInExchangeRatesPage: number;
// Statistics Settings // Statistics Settings
@@ -101,6 +103,8 @@ export const ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES: Record<string, UserAp
'autoSaveTransactionDraft': UserApplicationCloudSettingType.String, 'autoSaveTransactionDraft': UserApplicationCloudSettingType.String,
'autoGetCurrentGeoLocation': UserApplicationCloudSettingType.Boolean, 'autoGetCurrentGeoLocation': UserApplicationCloudSettingType.Boolean,
'alwaysShowTransactionPicturesInMobileTransactionEditPage': UserApplicationCloudSettingType.Boolean, 'alwaysShowTransactionPicturesInMobileTransactionEditPage': UserApplicationCloudSettingType.Boolean,
// Account List Page
'totalAmountExcludeAccountIds': UserApplicationCloudSettingType.StringBooleanMap,
// Exchange Rates Data Page // Exchange Rates Data Page
'currencySortByInExchangeRatesPage': UserApplicationCloudSettingType.Number, 'currencySortByInExchangeRatesPage': UserApplicationCloudSettingType.Number,
// Statistics Settings // Statistics Settings
@@ -141,6 +145,8 @@ export const DEFAULT_APPLICATION_SETTINGS: ApplicationSettings = {
autoSaveTransactionDraft: 'disabled', autoSaveTransactionDraft: 'disabled',
autoGetCurrentGeoLocation: false, autoGetCurrentGeoLocation: false,
alwaysShowTransactionPicturesInMobileTransactionEditPage: false, alwaysShowTransactionPicturesInMobileTransactionEditPage: false,
// Account List Page
totalAmountExcludeAccountIds: {},
// Exchange Rates Data Page // Exchange Rates Data Page
currencySortByInExchangeRatesPage: CurrencySortingType.Default.type, currencySortByInExchangeRatesPage: CurrencySortingType.Default.type,
// Statistics Settings // Statistics Settings
+15 -3
View File
@@ -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) { for (const accountId in filterAccountIds) {
if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) { if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) {
continue; continue;
@@ -273,13 +273,17 @@ export function selectAll(filterAccountIds: Record<string, boolean>, allAccounts
const account = allAccountsMap[accountId]; const account = allAccountsMap[accountId];
if (skipHiddenAccount && account && account.hidden) {
continue;
}
if (account && account.type === AccountType.SingleAccount.type) { if (account && account.type === AccountType.SingleAccount.type) {
filterAccountIds[account.id] = false; 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) { for (const accountId in filterAccountIds) {
if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) { if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) {
continue; continue;
@@ -287,13 +291,17 @@ export function selectNone(filterAccountIds: Record<string, boolean>, allAccount
const account = allAccountsMap[accountId]; const account = allAccountsMap[accountId];
if (skipHiddenAccount && account && account.hidden) {
continue;
}
if (account && account.type === AccountType.SingleAccount.type) { if (account && account.type === AccountType.SingleAccount.type) {
filterAccountIds[account.id] = true; 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) { for (const accountId in filterAccountIds) {
if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) { if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) {
continue; continue;
@@ -301,6 +309,10 @@ export function selectInvert(filterAccountIds: Record<string, boolean>, allAccou
const account = allAccountsMap[accountId]; const account = allAccountsMap[accountId];
if (skipHiddenAccount && account && account.hidden) {
continue;
}
if (account && account.type === AccountType.SingleAccount.type) { if (account && account.type === AccountType.SingleAccount.type) {
filterAccountIds[account.id] = !filterAccountIds[account.id]; filterAccountIds[account.id] = !filterAccountIds[account.id];
} }
+4
View File
@@ -1372,6 +1372,7 @@
"All Types": "Alle Typen", "All Types": "Alle Typen",
"More": "Mehr", "More": "Mehr",
"All": "Alle", "All": "Alle",
"Partial": "Partial",
"Today": "Heute", "Today": "Heute",
"Yesterday": "Gestern", "Yesterday": "Gestern",
"Recent 7 days": "Letzte 7 Tage", "Recent 7 days": "Letzte 7 Tage",
@@ -1610,6 +1611,7 @@
"Unable to save account": "Konto kann nicht gespeichert werden", "Unable to save account": "Konto kann nicht gespeichert werden",
"Show Hidden Accounts": "Versteckte Konten anzeigen", "Show Hidden Accounts": "Versteckte Konten anzeigen",
"Hide Hidden Accounts": "Versteckte Konten ausblenden", "Hide Hidden Accounts": "Versteckte Konten ausblenden",
"Set Accounts Included in Total": "Set Accounts Included in Total",
"Unable to retrieve account": "Konto kann nicht abgerufen werden", "Unable to retrieve account": "Konto kann nicht abgerufen werden",
"Unable to hide this account": "Dieses Konto kann nicht ausgeblendet werden", "Unable to hide this account": "Dieses Konto kann nicht ausgeblendet werden",
"Unable to unhide this account": "Dieses Konto kann nicht eingeblendet werden", "Unable to unhide this account": "Dieses Konto kann nicht eingeblendet werden",
@@ -1886,6 +1888,8 @@
"Show Confirmation Every Time": "Bestätigung jedes mal anzeigen", "Show Confirmation Every Time": "Bestätigung jedes mal anzeigen",
"Automatically Add Geolocation": "Geolocation automatisch hinzufügen", "Automatically Add Geolocation": "Geolocation automatisch hinzufügen",
"Always Show Transaction Pictures": "Always Show Transaction Pictures", "Always Show Transaction Pictures": "Always Show Transaction Pictures",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Exchange Rates Data Page": "Wechselkursdatenseite", "Exchange Rates Data Page": "Wechselkursdatenseite",
"Exchange Rate": "Wechselkurs", "Exchange Rate": "Wechselkurs",
"Enable Animation": "Animation aktivieren", "Enable Animation": "Animation aktivieren",
+4
View File
@@ -1372,6 +1372,7 @@
"All Types": "All Types", "All Types": "All Types",
"More": "More", "More": "More",
"All": "All", "All": "All",
"Partial": "Partial",
"Today": "Today", "Today": "Today",
"Yesterday": "Yesterday", "Yesterday": "Yesterday",
"Recent 7 days": "Recent 7 days", "Recent 7 days": "Recent 7 days",
@@ -1610,6 +1611,7 @@
"Unable to save account": "Unable to save account", "Unable to save account": "Unable to save account",
"Show Hidden Accounts": "Show Hidden Accounts", "Show Hidden Accounts": "Show Hidden Accounts",
"Hide Hidden Accounts": "Hide Hidden Accounts", "Hide Hidden Accounts": "Hide Hidden Accounts",
"Set Accounts Included in Total": "Set Accounts Included in Total",
"Unable to retrieve account": "Unable to retrieve account", "Unable to retrieve account": "Unable to retrieve account",
"Unable to hide this account": "Unable to hide this account", "Unable to hide this account": "Unable to hide this account",
"Unable to unhide this account": "Unable to unhide this account", "Unable to unhide this account": "Unable to unhide this account",
@@ -1886,6 +1888,8 @@
"Show Confirmation Every Time": "Show Confirmation Every Time", "Show Confirmation Every Time": "Show Confirmation Every Time",
"Automatically Add Geolocation": "Automatically Add Geolocation", "Automatically Add Geolocation": "Automatically Add Geolocation",
"Always Show Transaction Pictures": "Always Show Transaction Pictures", "Always Show Transaction Pictures": "Always Show Transaction Pictures",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Exchange Rates Data Page": "Exchange Rates Data Page", "Exchange Rates Data Page": "Exchange Rates Data Page",
"Exchange Rate": "Exchange Rate", "Exchange Rate": "Exchange Rate",
"Enable Animation": "Enable Animation", "Enable Animation": "Enable Animation",
+4
View File
@@ -1372,6 +1372,7 @@
"All Types": "Todos los tipos", "All Types": "Todos los tipos",
"More": "Más", "More": "Más",
"All": "Todo", "All": "Todo",
"Partial": "Partial",
"Today": "Hoy", "Today": "Hoy",
"Yesterday": "Ayer", "Yesterday": "Ayer",
"Recent 7 days": "Últimos 7 días", "Recent 7 days": "Últimos 7 días",
@@ -1610,6 +1611,7 @@
"Unable to save account": "No se puede guardar la cuenta", "Unable to save account": "No se puede guardar la cuenta",
"Show Hidden Accounts": "Mostrar cuentas ocultas", "Show Hidden Accounts": "Mostrar cuentas ocultas",
"Hide Hidden Accounts": "Ocultar cuentas ocultas", "Hide Hidden Accounts": "Ocultar cuentas ocultas",
"Set Accounts Included in Total": "Set Accounts Included in Total",
"Unable to retrieve account": "No se puede recuperar la cuenta", "Unable to retrieve account": "No se puede recuperar la cuenta",
"Unable to hide this account": "No se puede ocultar esta cuenta", "Unable to hide this account": "No se puede ocultar esta cuenta",
"Unable to unhide this account": "No se puede mostrar esta cuenta", "Unable to unhide this account": "No se puede mostrar esta cuenta",
@@ -1886,6 +1888,8 @@
"Show Confirmation Every Time": "Mostrar confirmación cada vez", "Show Confirmation Every Time": "Mostrar confirmación cada vez",
"Automatically Add Geolocation": "Agregar geolocalización automáticamente", "Automatically Add Geolocation": "Agregar geolocalización automáticamente",
"Always Show Transaction Pictures": "Always Show Transaction Pictures", "Always Show Transaction Pictures": "Always Show Transaction Pictures",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Exchange Rates Data Page": "Página de datos de tipos de cambio", "Exchange Rates Data Page": "Página de datos de tipos de cambio",
"Exchange Rate": "Tipo de cambio", "Exchange Rate": "Tipo de cambio",
"Enable Animation": "Habilitar animación", "Enable Animation": "Habilitar animación",
+4
View File
@@ -1372,6 +1372,7 @@
"All Types": "Tutti i tipi", "All Types": "Tutti i tipi",
"More": "Altro", "More": "Altro",
"All": "Tutti", "All": "Tutti",
"Partial": "Partial",
"Today": "Oggi", "Today": "Oggi",
"Yesterday": "Ieri", "Yesterday": "Ieri",
"Recent 7 days": "Ultimi 7 giorni", "Recent 7 days": "Ultimi 7 giorni",
@@ -1610,6 +1611,7 @@
"Unable to save account": "Impossibile salvare l'account", "Unable to save account": "Impossibile salvare l'account",
"Show Hidden Accounts": "Mostra account nascosti", "Show Hidden Accounts": "Mostra account nascosti",
"Hide Hidden Accounts": "Nascondi account nascosti", "Hide Hidden Accounts": "Nascondi account nascosti",
"Set Accounts Included in Total": "Set Accounts Included in Total",
"Unable to retrieve account": "Impossibile recuperare l'account", "Unable to retrieve account": "Impossibile recuperare l'account",
"Unable to hide this account": "Impossibile nascondere questo account", "Unable to hide this account": "Impossibile nascondere questo account",
"Unable to unhide this account": "Impossibile mostrare questo account", "Unable to unhide this account": "Impossibile mostrare questo account",
@@ -1886,6 +1888,8 @@
"Show Confirmation Every Time": "Mostra conferma ogni volta", "Show Confirmation Every Time": "Mostra conferma ogni volta",
"Automatically Add Geolocation": "Aggiungi automaticamente geolocalizzazione", "Automatically Add Geolocation": "Aggiungi automaticamente geolocalizzazione",
"Always Show Transaction Pictures": "Always Show Transaction Pictures", "Always Show Transaction Pictures": "Always Show Transaction Pictures",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Exchange Rates Data Page": "Pagina dati tassi di cambio", "Exchange Rates Data Page": "Pagina dati tassi di cambio",
"Exchange Rate": "Tasso di cambio", "Exchange Rate": "Tasso di cambio",
"Enable Animation": "Abilita animazione", "Enable Animation": "Abilita animazione",
+4
View File
@@ -1372,6 +1372,7 @@
"All Types": "全種類", "All Types": "全種類",
"More": "さらに", "More": "さらに",
"All": "すべて", "All": "すべて",
"Partial": "Partial",
"Today": "今日", "Today": "今日",
"Yesterday": "昨日", "Yesterday": "昨日",
"Recent 7 days": "直近7日間", "Recent 7 days": "直近7日間",
@@ -1610,6 +1611,7 @@
"Unable to save account": "口座を保存できません", "Unable to save account": "口座を保存できません",
"Show Hidden Accounts": "非表示口座を表示します", "Show Hidden Accounts": "非表示口座を表示します",
"Hide Hidden Accounts": "非表示口座を隠します", "Hide Hidden Accounts": "非表示口座を隠します",
"Set Accounts Included in Total": "Set Accounts Included in Total",
"Unable to retrieve account": "口座を取得できません", "Unable to retrieve account": "口座を取得できません",
"Unable to hide this account": "この口座は非表示にできません", "Unable to hide this account": "この口座は非表示にできません",
"Unable to unhide this account": "この口座は非表示を解除できません", "Unable to unhide this account": "この口座は非表示を解除できません",
@@ -1886,6 +1888,8 @@
"Show Confirmation Every Time": "確認を毎回表示", "Show Confirmation Every Time": "確認を毎回表示",
"Automatically Add Geolocation": "座標を自動的に追加", "Automatically Add Geolocation": "座標を自動的に追加",
"Always Show Transaction Pictures": "Always Show Transaction Pictures", "Always Show Transaction Pictures": "Always Show Transaction Pictures",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Exchange Rates Data Page": "為替レートデータページ", "Exchange Rates Data Page": "為替レートデータページ",
"Exchange Rate": "為替レート", "Exchange Rate": "為替レート",
"Enable Animation": "アニメーションの有効", "Enable Animation": "アニメーションの有効",
+4
View File
@@ -1372,6 +1372,7 @@
"All Types": "Todos os Tipos", "All Types": "Todos os Tipos",
"More": "Mais", "More": "Mais",
"All": "Todos", "All": "Todos",
"Partial": "Partial",
"Today": "Hoje", "Today": "Hoje",
"Yesterday": "Ontem", "Yesterday": "Ontem",
"Recent 7 days": "Últimos 7 dias", "Recent 7 days": "Últimos 7 dias",
@@ -1610,6 +1611,7 @@
"Unable to save account": "Não foi possível salvar conta", "Unable to save account": "Não foi possível salvar conta",
"Show Hidden Accounts": "Mostrar Contas Ocultas", "Show Hidden Accounts": "Mostrar Contas Ocultas",
"Hide Hidden Accounts": "Ocultar Contas Ocultas", "Hide Hidden Accounts": "Ocultar Contas Ocultas",
"Set Accounts Included in Total": "Set Accounts Included in Total",
"Unable to retrieve account": "Não foi possível recuperar conta", "Unable to retrieve account": "Não foi possível recuperar conta",
"Unable to hide this account": "Não foi possível ocultar esta conta", "Unable to hide this account": "Não foi possível ocultar esta conta",
"Unable to unhide this account": "Não foi possível desocultar esta conta", "Unable to unhide this account": "Não foi possível desocultar esta conta",
@@ -1886,6 +1888,8 @@
"Show Confirmation Every Time": "Mostrar Confirmação Toda Vez", "Show Confirmation Every Time": "Mostrar Confirmação Toda Vez",
"Automatically Add Geolocation": "Adicionar Geolocalização Automaticamente", "Automatically Add Geolocation": "Adicionar Geolocalização Automaticamente",
"Always Show Transaction Pictures": "Sempre Mostrar Imagens de Transações", "Always Show Transaction Pictures": "Sempre Mostrar Imagens de Transações",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Exchange Rates Data Page": "Página de Dados de Taxas de Câmbio", "Exchange Rates Data Page": "Página de Dados de Taxas de Câmbio",
"Exchange Rate": "Taxa de Câmbio", "Exchange Rate": "Taxa de Câmbio",
"Enable Animation": "Habilitar Animação", "Enable Animation": "Habilitar Animação",
+4
View File
@@ -1372,6 +1372,7 @@
"All Types": "Все типы", "All Types": "Все типы",
"More": "Еще", "More": "Еще",
"All": "Все", "All": "Все",
"Partial": "Partial",
"Today": "Сегодня", "Today": "Сегодня",
"Yesterday": "Вчера", "Yesterday": "Вчера",
"Recent 7 days": "Последние 7 дней", "Recent 7 days": "Последние 7 дней",
@@ -1610,6 +1611,7 @@
"Unable to save account": "Не удалось сохранить счет", "Unable to save account": "Не удалось сохранить счет",
"Show Hidden Accounts": "Показать скрытые счета", "Show Hidden Accounts": "Показать скрытые счета",
"Hide Hidden Accounts": "Скрыть скрытые счета", "Hide Hidden Accounts": "Скрыть скрытые счета",
"Set Accounts Included in Total": "Set Accounts Included in Total",
"Unable to retrieve account": "Не удалось получить счет", "Unable to retrieve account": "Не удалось получить счет",
"Unable to hide this account": "Не удалось скрыть этот счет", "Unable to hide this account": "Не удалось скрыть этот счет",
"Unable to unhide this account": "Не удалось отобразить этот счет", "Unable to unhide this account": "Не удалось отобразить этот счет",
@@ -1886,6 +1888,8 @@
"Show Confirmation Every Time": "Показывать подтверждение каждый раз", "Show Confirmation Every Time": "Показывать подтверждение каждый раз",
"Automatically Add Geolocation": "Автоматически добавлять геолокацию", "Automatically Add Geolocation": "Автоматически добавлять геолокацию",
"Always Show Transaction Pictures": "Always Show Transaction Pictures", "Always Show Transaction Pictures": "Always Show Transaction Pictures",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Exchange Rates Data Page": "Страница данных о курсах валют", "Exchange Rates Data Page": "Страница данных о курсах валют",
"Exchange Rate": "Курс обмена", "Exchange Rate": "Курс обмена",
"Enable Animation": "Включить анимацию", "Enable Animation": "Включить анимацию",
+4
View File
@@ -1372,6 +1372,7 @@
"All Types": "Усі типи", "All Types": "Усі типи",
"More": "Більше", "More": "Більше",
"All": "Усе", "All": "Усе",
"Partial": "Partial",
"Today": "Сьогодні", "Today": "Сьогодні",
"Yesterday": "Вчора", "Yesterday": "Вчора",
"Recent 7 days": "Останні 7 днів", "Recent 7 days": "Останні 7 днів",
@@ -1610,6 +1611,7 @@
"Unable to save account": "Не вдалося зберегти рахунок", "Unable to save account": "Не вдалося зберегти рахунок",
"Show Hidden Accounts": "Показати приховані рахунки", "Show Hidden Accounts": "Показати приховані рахунки",
"Hide Hidden Accounts": "Приховати приховані рахунки", "Hide Hidden Accounts": "Приховати приховані рахунки",
"Set Accounts Included in Total": "Set Accounts Included in Total",
"Unable to retrieve account": "Не вдалося отримати рахунок", "Unable to retrieve account": "Не вдалося отримати рахунок",
"Unable to hide this account": "Не вдалося приховати цей рахунок", "Unable to hide this account": "Не вдалося приховати цей рахунок",
"Unable to unhide this account": "Не вдалося відобразити цей рахунок", "Unable to unhide this account": "Не вдалося відобразити цей рахунок",
@@ -1886,6 +1888,8 @@
"Show Confirmation Every Time": "Показувати підтвердження щоразу", "Show Confirmation Every Time": "Показувати підтвердження щоразу",
"Automatically Add Geolocation": "Автоматично додавати геолокацію", "Automatically Add Geolocation": "Автоматично додавати геолокацію",
"Always Show Transaction Pictures": "Always Show Transaction Pictures", "Always Show Transaction Pictures": "Always Show Transaction Pictures",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Exchange Rates Data Page": "Сторінка курсів валют", "Exchange Rates Data Page": "Сторінка курсів валют",
"Exchange Rate": "Курс обміну", "Exchange Rate": "Курс обміну",
"Enable Animation": "Увімкнути анімацію", "Enable Animation": "Увімкнути анімацію",
+4
View File
@@ -1372,6 +1372,7 @@
"All Types": "Tất cả các loại", "All Types": "Tất cả các loại",
"More": "Thêm", "More": "Thêm",
"All": "Tất cả", "All": "Tất cả",
"Partial": "Partial",
"Today": "Hôm nay", "Today": "Hôm nay",
"Yesterday": "Hôm qua", "Yesterday": "Hôm qua",
"Recent 7 days": "7 ngày gần đây", "Recent 7 days": "7 ngày gần đây",
@@ -1610,6 +1611,7 @@
"Unable to save account": "Không thể lưu tài khoản", "Unable to save account": "Không thể lưu tài khoản",
"Show Hidden Accounts": "Hiển thị tài khoản ẩn", "Show Hidden Accounts": "Hiển thị tài khoản ẩn",
"Hide Hidden Accounts": "Ẩn tài khoản ẩn", "Hide Hidden Accounts": "Ẩn tài khoản ẩn",
"Set Accounts Included in Total": "Set Accounts Included in Total",
"Unable to retrieve account": "Không thể lấy tài khoản", "Unable to retrieve account": "Không thể lấy tài khoản",
"Unable to hide this account": "Không thể ẩn tài khoản này", "Unable to hide this account": "Không thể ẩn tài khoản này",
"Unable to unhide this account": "Không thể hiển thị tài khoản này", "Unable to unhide this account": "Không thể hiển thị tài khoản này",
@@ -1886,6 +1888,8 @@
"Show Confirmation Every Time": "Hiển thị xác nhận mỗi lần", "Show Confirmation Every Time": "Hiển thị xác nhận mỗi lần",
"Automatically Add Geolocation": "Tự động thêm vị trí địa lý", "Automatically Add Geolocation": "Tự động thêm vị trí địa lý",
"Always Show Transaction Pictures": "Always Show Transaction Pictures", "Always Show Transaction Pictures": "Always Show Transaction Pictures",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Exchange Rates Data Page": "Trang dữ liệu tỷ giá hối đoái", "Exchange Rates Data Page": "Trang dữ liệu tỷ giá hối đoái",
"Exchange Rate": "Tỷ giá hối đoái", "Exchange Rate": "Tỷ giá hối đoái",
"Enable Animation": "Bật hoạt ảnh", "Enable Animation": "Bật hoạt ảnh",
+4
View File
@@ -1372,6 +1372,7 @@
"All Types": "全部类型", "All Types": "全部类型",
"More": "更多", "More": "更多",
"All": "全部", "All": "全部",
"Partial": "部分",
"Today": "今天", "Today": "今天",
"Yesterday": "昨天", "Yesterday": "昨天",
"Recent 7 days": "最近7天", "Recent 7 days": "最近7天",
@@ -1610,6 +1611,7 @@
"Unable to save account": "无法保存账户", "Unable to save account": "无法保存账户",
"Show Hidden Accounts": "显示隐藏的账户", "Show Hidden Accounts": "显示隐藏的账户",
"Hide Hidden Accounts": "不显示隐藏的账户", "Hide Hidden Accounts": "不显示隐藏的账户",
"Set Accounts Included in Total": "设置计入总金额的账户",
"Unable to retrieve account": "无法获取账户", "Unable to retrieve account": "无法获取账户",
"Unable to hide this account": "无法隐藏账户", "Unable to hide this account": "无法隐藏账户",
"Unable to unhide this account": "无法取消隐藏账户", "Unable to unhide this account": "无法取消隐藏账户",
@@ -1886,6 +1888,8 @@
"Show Confirmation Every Time": "每次提示确认", "Show Confirmation Every Time": "每次提示确认",
"Automatically Add Geolocation": "自动添加地理位置", "Automatically Add Geolocation": "自动添加地理位置",
"Always Show Transaction Pictures": "总是显示交易图片", "Always Show Transaction Pictures": "总是显示交易图片",
"Account List Page": "账户列表页面",
"Accounts Included in Total": "计入总金额的账户",
"Exchange Rates Data Page": "汇率数据页面", "Exchange Rates Data Page": "汇率数据页面",
"Exchange Rate": "汇率", "Exchange Rate": "汇率",
"Enable Animation": "启用动画", "Enable Animation": "启用动画",
+4
View File
@@ -1372,6 +1372,7 @@
"All Types": "全部類型", "All Types": "全部類型",
"More": "更多", "More": "更多",
"All": "全部", "All": "全部",
"Partial": "部分",
"Today": "今天", "Today": "今天",
"Yesterday": "昨天", "Yesterday": "昨天",
"Recent 7 days": "最近7天", "Recent 7 days": "最近7天",
@@ -1610,6 +1611,7 @@
"Unable to save account": "無法儲存帳戶", "Unable to save account": "無法儲存帳戶",
"Show Hidden Accounts": "顯示隱藏的帳戶", "Show Hidden Accounts": "顯示隱藏的帳戶",
"Hide Hidden Accounts": "不顯示隱藏的帳戶", "Hide Hidden Accounts": "不顯示隱藏的帳戶",
"Set Accounts Included in Total": "設定計入總金額的帳戶",
"Unable to retrieve account": "無法取得帳戶", "Unable to retrieve account": "無法取得帳戶",
"Unable to hide this account": "無法隱藏帳戶", "Unable to hide this account": "無法隱藏帳戶",
"Unable to unhide this account": "無法取消隱藏帳戶", "Unable to unhide this account": "無法取消隱藏帳戶",
@@ -1886,6 +1888,8 @@
"Show Confirmation Every Time": "每次提示確認", "Show Confirmation Every Time": "每次提示確認",
"Automatically Add Geolocation": "自動新增地理位置", "Automatically Add Geolocation": "自動新增地理位置",
"Always Show Transaction Pictures": "總是顯示交易圖片", "Always Show Transaction Pictures": "總是顯示交易圖片",
"Account List Page": "帳戶清單頁面",
"Accounts Included in Total": "計入總金額的帳戶",
"Exchange Rates Data Page": "匯率資料頁面", "Exchange Rates Data Page": "匯率資料頁面",
"Exchange Rate": "匯率", "Exchange Rate": "匯率",
"Enable Animation": "啟用動畫", "Enable Animation": "啟用動畫",
+11 -3
View File
@@ -1,6 +1,7 @@
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { useSettingsStore } from './setting.ts';
import { useUserStore } from './user.ts'; import { useUserStore } from './user.ts';
import { useExchangeRatesStore } from './exchangeRates.ts'; import { useExchangeRatesStore } from './exchangeRates.ts';
@@ -21,6 +22,7 @@ import services from '@/lib/services.ts';
import logger from '@/lib/logger.ts'; import logger from '@/lib/logger.ts';
export const useAccountsStore = defineStore('accounts', () => { export const useAccountsStore = defineStore('accounts', () => {
const settingsStore = useSettingsStore();
const userStore = useUserStore(); const userStore = useUserStore();
const exchangeRatesStore = useExchangeRatesStore(); const exchangeRatesStore = useExchangeRatesStore();
@@ -484,7 +486,9 @@ export const useAccountsStore = defineStore('accounts', () => {
return '***'; return '***';
} }
const accountsBalance = getAllFilteredAccountsBalance(allCategorizedAccountsMap.value, () => true); const accountsBalance = getAllFilteredAccountsBalance(allCategorizedAccountsMap.value, account =>
!settingsStore.appSettings.totalAmountExcludeAccountIds[account.id]
);
let netAssets = 0; let netAssets = 0;
let hasUnCalculatedAmount = false; let hasUnCalculatedAmount = false;
@@ -515,7 +519,9 @@ export const useAccountsStore = defineStore('accounts', () => {
return '***'; 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 totalAssets = 0;
let hasUnCalculatedAmount = false; let hasUnCalculatedAmount = false;
@@ -546,7 +552,9 @@ export const useAccountsStore = defineStore('accounts', () => {
return '***'; 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 totalLiabilities = 0;
let hasUnCalculatedAmount = false; let hasUnCalculatedAmount = false;
+9
View File
@@ -220,6 +220,13 @@ export const useSettingsStore = defineStore('settings', () => {
updateUserApplicationCloudSettingValue('alwaysShowTransactionPicturesInMobileTransactionEditPage', value); 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 // Exchange Rates Data Page
function setCurrencySortByInExchangeRatesPage(value: number): void { function setCurrencySortByInExchangeRatesPage(value: number): void {
updateApplicationSettingsValue('currencySortByInExchangeRatesPage', value); updateApplicationSettingsValue('currencySortByInExchangeRatesPage', value);
@@ -429,6 +436,8 @@ export const useSettingsStore = defineStore('settings', () => {
setAutoSaveTransactionDraft, setAutoSaveTransactionDraft,
setAutoGetCurrentGeoLocation, setAutoGetCurrentGeoLocation,
setAlwaysShowTransactionPicturesInMobileTransactionEditPage, setAlwaysShowTransactionPicturesInMobileTransactionEditPage,
// -- Account List Page
setTotalAmountExcludeAccountIds,
// -- Exchange Rates Data Page // -- Exchange Rates Data Page
setCurrencySortByInExchangeRatesPage, setCurrencySortByInExchangeRatesPage,
// -- Statistics Settings // -- Statistics Settings
@@ -39,6 +39,10 @@ export function useAccountFilterSettingPageBase(type?: string) {
} }
}); });
const allowHiddenAccount = computed<boolean>(() => {
return type === 'statisticsDefault' || type === 'statisticsCurrent' || type === 'transactionListCurrent';
});
const allCategorizedAccounts = computed<AccountCategoriesWithVisibleCount[]>(() => getCategorizedAccountsWithVisibleCount(accountsStore.allCategorizedAccountsMap)); const allCategorizedAccounts = computed<AccountCategoriesWithVisibleCount[]>(() => getCategorizedAccountsWithVisibleCount(accountsStore.allCategorizedAccountsMap));
const hasAnyAvailableAccount = computed<boolean>(() => accountsStore.allAvailableAccountsCount > 0); const hasAnyAvailableAccount = computed<boolean>(() => accountsStore.allAvailableAccountsCount > 0);
@@ -64,6 +68,10 @@ export function useAccountFilterSettingPageBase(type?: string) {
const account = accountsStore.allAccountsMap[accountId]; const account = accountsStore.allAccountsMap[accountId];
if (!allowHiddenAccount.value && account.hidden) {
continue;
}
if (type === 'transactionListCurrent' && transactionsStore.allFilterAccountIdsCount > 0) { if (type === 'transactionListCurrent' && transactionsStore.allFilterAccountIdsCount > 0) {
allAccountIds[account.id] = true; allAccountIds[account.id] = true;
} else { } else {
@@ -91,6 +99,9 @@ export function useAccountFilterSettingPageBase(type?: string) {
} }
filterAccountIds.value = allAccountIds; filterAccountIds.value = allAccountIds;
return true; return true;
} else if (type === 'accountListTotalAmount') {
filterAccountIds.value = Object.assign(allAccountIds, settingsStore.appSettings.totalAmountExcludeAccountIds);
return true;
} else { } else {
return false; return false;
} }
@@ -109,6 +120,10 @@ export function useAccountFilterSettingPageBase(type?: string) {
const account = accountsStore.allAccountsMap[accountId]; const account = accountsStore.allAccountsMap[accountId];
if (!allowHiddenAccount.value && account.hidden) {
continue;
}
if (!isAccountOrSubAccountsAllChecked(account, filterAccountIds.value)) { if (!isAccountOrSubAccountsAllChecked(account, filterAccountIds.value)) {
filteredAccountIds[accountId] = true; filteredAccountIds[accountId] = true;
isAllSelected = false; isAllSelected = false;
@@ -135,6 +150,8 @@ export function useAccountFilterSettingPageBase(type?: string) {
if (changed) { if (changed) {
transactionsStore.updateTransactionListInvalidState(true); transactionsStore.updateTransactionListInvalidState(true);
} }
} else if (type === 'accountListTotalAmount') {
settingsStore.setTotalAmountExcludeAccountIds(filteredAccountIds);
} }
return changed; return changed;
@@ -148,6 +165,7 @@ export function useAccountFilterSettingPageBase(type?: string) {
// computed states // computed states
title, title,
applyText, applyText,
allowHiddenAccount,
allCategorizedAccounts, allCategorizedAccounts,
hasAnyAvailableAccount, hasAnyAvailableAccount,
hasAnyVisibleAccount, hasAnyVisibleAccount,
@@ -47,6 +47,12 @@ export const ALL_APPLICATION_CLOUD_SETTINGS: CategorizedApplicationCloudSettingI
{ settingKey: 'alwaysShowTransactionPicturesInMobileTransactionEditPage', settingName: 'Always Show Transaction Pictures', mobile: true, desktop: false } { settingKey: 'alwaysShowTransactionPicturesInMobileTransactionEditPage', settingName: 'Always Show Transaction Pictures', mobile: true, desktop: false }
] ]
}, },
{
categoryName: 'Account List Page',
items: [
{ settingKey: 'totalAmountExcludeAccountIds', settingName: 'Accounts Included in Total', mobile: true, desktop: true },
]
},
{ {
categoryName: 'Exchange Rates Data Page', categoryName: 'Exchange Rates Data Page',
items: [ items: [
+53 -2
View File
@@ -1,8 +1,9 @@
import { computed } from 'vue'; import { ref, computed } from 'vue';
import { useI18n } from '@/locales/helpers.ts'; import { useI18n } from '@/locales/helpers.ts';
import { useSettingsStore } from '@/stores/setting.ts'; import { useSettingsStore } from '@/stores/setting.ts';
import { useAccountsStore } from '@/stores/account.ts';
import { useTransactionsStore } from '@/stores/transaction.ts'; import { useTransactionsStore } from '@/stores/transaction.ts';
import { useOverviewStore } from '@/stores/overview.ts'; import { useOverviewStore } from '@/stores/overview.ts';
import { useStatisticsStore } from '@/stores/statistics.ts'; import { useStatisticsStore } from '@/stores/statistics.ts';
@@ -14,10 +15,13 @@ export function useAppSettingPageBase() {
const { tt, getAllTimezones, getAllTimezoneTypesUsedForStatistics, getAllCurrencySortingTypes, setTimeZone } = useI18n(); const { tt, getAllTimezones, getAllTimezoneTypesUsedForStatistics, getAllCurrencySortingTypes, setTimeZone } = useI18n();
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const accountsStore = useAccountsStore();
const transactionsStore = useTransactionsStore(); const transactionsStore = useTransactionsStore();
const overviewStore = useOverviewStore(); const overviewStore = useOverviewStore();
const statisticsStore = useStatisticsStore(); const statisticsStore = useStatisticsStore();
const loadingAccounts = ref<boolean>(false);
const allThemes = computed<NameValue[]>(() => { const allThemes = computed<NameValue[]>(() => {
return [ return [
{ name: tt('System Default'), value: 'auto' }, { name: tt('System Default'), value: 'auto' },
@@ -38,6 +42,8 @@ export function useAppSettingPageBase() {
]; ];
}); });
const hasAnyVisibleAccount = computed<boolean>(() => accountsStore.allVisibleAccountsCount > 0);
const timeZone = computed<string>({ const timeZone = computed<string>({
get: () => settingsStore.appSettings.timeZone, get: () => settingsStore.appSettings.timeZone,
set: (value) => { set: (value) => {
@@ -108,7 +114,50 @@ export function useAppSettingPageBase() {
set: (value: number) => settingsStore.setCurrencySortByInExchangeRatesPage(value) set: (value: number) => settingsStore.setCurrencySortByInExchangeRatesPage(value)
}); });
const accountsIncludedInTotalDisplayContent = computed<string>(() => {
if (loadingAccounts.value || !accountsStore.allVisiblePlainAccounts || !accountsStore.allVisiblePlainAccounts.length) {
return '';
}
const excludeAccountIds = settingsStore.appSettings.totalAmountExcludeAccountIds;
let hasExcludeAccount = false;
for (const accountId in excludeAccountIds) {
if (!Object.prototype.hasOwnProperty.call(excludeAccountIds, accountId)) {
continue;
}
if (excludeAccountIds[accountId]) {
hasExcludeAccount = true;
break;
}
}
if (!hasExcludeAccount) {
return tt('All');
}
let allVisibleAccountExcluded = true;
for (let i = 0; i < accountsStore.allVisiblePlainAccounts.length; i++) {
const account = accountsStore.allVisiblePlainAccounts[i];
if (!excludeAccountIds[account.id]) {
allVisibleAccountExcluded = false;
break;
}
}
if (allVisibleAccountExcluded) {
return tt('None');
}
return tt('Partial');
});
return { return {
// states
loadingAccounts,
// computed states // computed states
allThemes, allThemes,
allTimezones, allTimezones,
@@ -116,6 +165,7 @@ export function useAppSettingPageBase() {
allCurrencySortingTypes, allCurrencySortingTypes,
allAutoSaveTransactionDraftTypes, allAutoSaveTransactionDraftTypes,
timeZone, timeZone,
hasAnyVisibleAccount,
isAutoUpdateExchangeRatesData, isAutoUpdateExchangeRatesData,
showAccountBalance, showAccountBalance,
showAmountInHomePage, showAmountInHomePage,
@@ -125,6 +175,7 @@ export function useAppSettingPageBase() {
showTagInTransactionListPage, showTagInTransactionListPage,
autoSaveTransactionDraft, autoSaveTransactionDraft,
isAutoGetCurrentGeoLocation, isAutoGetCurrentGeoLocation,
currencySortByInExchangeRatesPage currencySortByInExchangeRatesPage,
accountsIncludedInTotalDisplayContent
}; };
} }
+13
View File
@@ -80,6 +80,10 @@
<v-list-item :prepend-icon="mdiEyeOffOutline" <v-list-item :prepend-icon="mdiEyeOffOutline"
:title="tt('Hide Hidden Accounts')" :title="tt('Hide Hidden Accounts')"
v-if="showHidden" @click="showHidden = false"></v-list-item> v-if="showHidden" @click="showHidden = false"></v-list-item>
<v-divider class="my-2" v-if="hasAnyVisibleAccount"/>
<v-list-item :prepend-icon="mdiCalculatorVariantOutline"
:title="tt('Set Accounts Included in Total')"
v-if="hasAnyVisibleAccount" @click="showAccountsIncludedInTotalDialog = true"></v-list-item>
</v-list> </v-list>
</v-menu> </v-menu>
</v-btn> </v-btn>
@@ -248,6 +252,11 @@
</v-col> </v-col>
</v-row> </v-row>
<v-dialog width="800" v-model="showAccountsIncludedInTotalDialog">
<account-filter-settings-card type="accountListTotalAmount" :dialog-mode="true"
@settings:change="showAccountsIncludedInTotalDialog = false" />
</v-dialog>
<edit-dialog ref="editDialog" /> <edit-dialog ref="editDialog" />
<confirm-dialog ref="confirmDialog"/> <confirm-dialog ref="confirmDialog"/>
@@ -258,6 +267,7 @@
import ConfirmDialog from '@/components/desktop/ConfirmDialog.vue'; import ConfirmDialog from '@/components/desktop/ConfirmDialog.vue';
import SnackBar from '@/components/desktop/SnackBar.vue'; import SnackBar from '@/components/desktop/SnackBar.vue';
import EditDialog from './list/dialogs/EditDialog.vue'; import EditDialog from './list/dialogs/EditDialog.vue';
import AccountFilterSettingsCard from '@/views/desktop/common/cards/AccountFilterSettingsCard.vue';
import { ref, computed, useTemplateRef, watch } from 'vue'; import { ref, computed, useTemplateRef, watch } from 'vue';
import { useDisplay } from 'vuetify'; import { useDisplay } from 'vuetify';
@@ -273,6 +283,7 @@ import type { Account } from '@/models/account.ts';
import { import {
mdiEyeOutline, mdiEyeOutline,
mdiEyeOffOutline, mdiEyeOffOutline,
mdiCalculatorVariantOutline,
mdiRefresh, mdiRefresh,
mdiSquareRounded, mdiSquareRounded,
mdiMenu, mdiMenu,
@@ -317,7 +328,9 @@ const activeTab = ref<string>('accountPage');
const activeSubAccount = ref<Record<string, string>>({}); const activeSubAccount = ref<Record<string, string>>({});
const alwaysShowNav = ref<boolean>(display.mdAndUp.value); const alwaysShowNav = ref<boolean>(display.mdAndUp.value);
const showNav = ref<boolean>(display.mdAndUp.value); const showNav = ref<boolean>(display.mdAndUp.value);
const showAccountsIncludedInTotalDialog = ref<boolean>(false);
const hasAnyVisibleAccount = computed<boolean>(() => accountsStore.allVisibleAccountsCount > 0);
const activeAccountCategory = computed<AccountCategory | undefined>(() => AccountCategory.valueOf(activeAccountCategoryType.value)); const activeAccountCategory = computed<AccountCategory | undefined>(() => AccountCategory.valueOf(activeAccountCategoryType.value));
const activeAccountCategoryTotalBalance = computed<string>(() => accountCategoryTotalBalance(activeAccountCategory.value)); const activeAccountCategoryTotalBalance = computed<string>(() => accountCategoryTotalBalance(activeAccountCategory.value));
@@ -192,6 +192,32 @@
</v-card> </v-card>
</v-col> </v-col>
<v-col cols="12">
<v-card :title="tt('Account List Page')">
<v-form>
<v-card-text>
<v-row>
<v-col cols="12" md="6">
<v-text-field
class="always-cursor-pointer"
item-title="displayName"
item-value="type"
persistent-placeholder
:loading="loadingAccounts"
:readonly="true"
:disabled="!hasAnyVisibleAccount"
:label="tt('Accounts Included in Total')"
:placeholder="tt('Accounts Included in Total')"
:model-value="accountsIncludedInTotalDisplayContent"
@click="showAccountsIncludedInTotalDialog = true"
/>
</v-col>
</v-row>
</v-card-text>
</v-form>
</v-card>
</v-col>
<v-col cols="12"> <v-col cols="12">
<v-card :title="tt('Exchange Rates Data Page')"> <v-card :title="tt('Exchange Rates Data Page')">
<v-form> <v-form>
@@ -214,30 +240,45 @@
</v-card> </v-card>
</v-col> </v-col>
</v-row> </v-row>
<v-dialog width="800" v-model="showAccountsIncludedInTotalDialog">
<account-filter-settings-card type="accountListTotalAmount" :dialog-mode="true"
@settings:change="showAccountsIncludedInTotalDialog = false" />
</v-dialog>
<snack-bar ref="snackbar" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed } from 'vue'; import SnackBar from '@/components/desktop/SnackBar.vue';
import AccountFilterSettingsCard from '@/views/desktop/common/cards/AccountFilterSettingsCard.vue';
import { ref, computed, useTemplateRef } from 'vue';
import { useTheme } from 'vuetify'; import { useTheme } from 'vuetify';
import { useI18n } from '@/locales/helpers.ts'; import { useI18n } from '@/locales/helpers.ts';
import { useAppSettingPageBase } from '@/views/base/settings/AppSettingsPageBase.ts'; import { useAppSettingPageBase } from '@/views/base/settings/AppSettingsPageBase.ts';
import { useSettingsStore } from '@/stores/setting.ts'; import { useSettingsStore } from '@/stores/setting.ts';
import { useAccountsStore } from '@/stores/account.ts';
import type { LocalizedSwitchOption } from '@/core/base.ts'; import type { LocalizedSwitchOption } from '@/core/base.ts';
import { ThemeType } from '@/core/theme.ts'; import { ThemeType } from '@/core/theme.ts';
import { getSystemTheme } from '@/lib/ui/common.ts'; import { getSystemTheme } from '@/lib/ui/common.ts';
type SnackBarType = InstanceType<typeof SnackBar>;
const theme = useTheme(); const theme = useTheme();
const { tt, getAllEnableDisableOptions } = useI18n(); const { tt, getAllEnableDisableOptions } = useI18n();
const { const {
loadingAccounts,
allThemes, allThemes,
allTimezones, allTimezones,
allTimezoneTypesUsedForStatistics, allTimezoneTypesUsedForStatistics,
allCurrencySortingTypes, allCurrencySortingTypes,
allAutoSaveTransactionDraftTypes, allAutoSaveTransactionDraftTypes,
hasAnyVisibleAccount,
timeZone, timeZone,
isAutoUpdateExchangeRatesData, isAutoUpdateExchangeRatesData,
showAccountBalance, showAccountBalance,
@@ -248,10 +289,16 @@ const {
showTagInTransactionListPage, showTagInTransactionListPage,
autoSaveTransactionDraft, autoSaveTransactionDraft,
isAutoGetCurrentGeoLocation, isAutoGetCurrentGeoLocation,
currencySortByInExchangeRatesPage currencySortByInExchangeRatesPage,
accountsIncludedInTotalDisplayContent
} = useAppSettingPageBase(); } = useAppSettingPageBase();
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const accountsStore = useAccountsStore();
const snackbar = useTemplateRef<SnackBarType>('snackbar');
const showAccountsIncludedInTotalDialog = ref<boolean>(false);
const enableDisableOptions = computed<LocalizedSwitchOption[]>(() => getAllEnableDisableOptions()); const enableDisableOptions = computed<LocalizedSwitchOption[]>(() => getAllEnableDisableOptions());
@@ -274,4 +321,22 @@ const showAddTransactionButtonInDesktopNavbar = computed<boolean>({
get: () => settingsStore.appSettings.showAddTransactionButtonInDesktopNavbar, get: () => settingsStore.appSettings.showAddTransactionButtonInDesktopNavbar,
set: (value) => settingsStore.setShowAddTransactionButtonInDesktopNavbar(value) set: (value) => settingsStore.setShowAddTransactionButtonInDesktopNavbar(value)
}); });
function init(): void {
loadingAccounts.value = true;
accountsStore.loadAllAccounts({
force: false
}).then(() => {
loadingAccounts.value = false;
}).catch(error => {
loadingAccounts.value = false;
if (!error.processed) {
snackbar.value?.showError(error);
}
});
}
init();
</script> </script>
@@ -22,13 +22,13 @@
:title="tt('Invert Selection')" :title="tt('Invert Selection')"
:disabled="!hasAnyVisibleAccount" :disabled="!hasAnyVisibleAccount"
@click="selectInvertAccounts"></v-list-item> @click="selectInvertAccounts"></v-list-item>
<v-divider class="my-2"/> <v-divider class="my-2" v-if="allowHiddenAccount"/>
<v-list-item :prepend-icon="mdiEyeOutline" <v-list-item :prepend-icon="mdiEyeOutline"
:title="tt('Show Hidden Accounts')" :title="tt('Show Hidden Accounts')"
v-if="!showHidden" @click="showHidden = true"></v-list-item> v-if="allowHiddenAccount && !showHidden" @click="showHidden = true"></v-list-item>
<v-list-item :prepend-icon="mdiEyeOffOutline" <v-list-item :prepend-icon="mdiEyeOffOutline"
:title="tt('Hide Hidden Accounts')" :title="tt('Hide Hidden Accounts')"
v-if="showHidden" @click="showHidden = false"></v-list-item> v-if="allowHiddenAccount && showHidden" @click="showHidden = false"></v-list-item>
</v-list> </v-list>
</v-menu> </v-menu>
</v-btn> </v-btn>
@@ -53,13 +53,13 @@
:title="tt('Invert Selection')" :title="tt('Invert Selection')"
:disabled="!hasAnyVisibleAccount" :disabled="!hasAnyVisibleAccount"
@click="selectInvertAccounts"></v-list-item> @click="selectInvertAccounts"></v-list-item>
<v-divider class="my-2"/> <v-divider class="my-2" v-if="allowHiddenAccount"/>
<v-list-item :prepend-icon="mdiEyeOutline" <v-list-item :prepend-icon="mdiEyeOutline"
:title="tt('Show Hidden Accounts')" :title="tt('Show Hidden Accounts')"
v-if="!showHidden" @click="showHidden = true"></v-list-item> v-if="allowHiddenAccount && !showHidden" @click="showHidden = true"></v-list-item>
<v-list-item :prepend-icon="mdiEyeOffOutline" <v-list-item :prepend-icon="mdiEyeOffOutline"
:title="tt('Hide Hidden Accounts')" :title="tt('Hide Hidden Accounts')"
v-if="showHidden" @click="showHidden = false"></v-list-item> v-if="allowHiddenAccount && showHidden" @click="showHidden = false"></v-list-item>
</v-list> </v-list>
</v-menu> </v-menu>
</v-btn> </v-btn>
@@ -196,6 +196,7 @@ const {
filterAccountIds, filterAccountIds,
title, title,
applyText, applyText,
allowHiddenAccount,
allCategorizedAccounts, allCategorizedAccounts,
hasAnyAvailableAccount, hasAnyAvailableAccount,
hasAnyVisibleAccount, hasAnyVisibleAccount,
@@ -245,7 +246,7 @@ function updateAccountSelected(account: Account, value: boolean | null): void {
} }
function selectAllAccounts(): void { function selectAllAccounts(): void {
selectAll(filterAccountIds.value, accountsStore.allAccountsMap); selectAll(filterAccountIds.value, accountsStore.allAccountsMap, !allowHiddenAccount.value);
if (props.autoSave) { if (props.autoSave) {
save(); save();
@@ -253,7 +254,7 @@ function selectAllAccounts(): void {
} }
function selectNoneAccounts(): void { function selectNoneAccounts(): void {
selectNone(filterAccountIds.value, accountsStore.allAccountsMap); selectNone(filterAccountIds.value, accountsStore.allAccountsMap, !allowHiddenAccount.value);
if (props.autoSave) { if (props.autoSave) {
save(); save();
@@ -261,7 +262,7 @@ function selectNoneAccounts(): void {
} }
function selectInvertAccounts(): void { function selectInvertAccounts(): void {
selectInvert(filterAccountIds.value, accountsStore.allAccountsMap); selectInvert(filterAccountIds.value, accountsStore.allAccountsMap, !allowHiddenAccount.value);
if (props.autoSave) { if (props.autoSave) {
save(); save();
+8
View File
@@ -159,6 +159,9 @@
<f7-actions-button v-if="!showHidden" @click="showHidden = true">{{ tt('Show Hidden Accounts') }}</f7-actions-button> <f7-actions-button v-if="!showHidden" @click="showHidden = true">{{ tt('Show Hidden Accounts') }}</f7-actions-button>
<f7-actions-button v-if="showHidden" @click="showHidden = false">{{ tt('Hide Hidden Accounts') }}</f7-actions-button> <f7-actions-button v-if="showHidden" @click="showHidden = false">{{ tt('Hide Hidden Accounts') }}</f7-actions-button>
</f7-actions-group> </f7-actions-group>
<f7-actions-group v-if="hasAnyVisibleAccount">
<f7-actions-button @click="setAccountsIncludedInTotal()">{{ tt('Set Accounts Included in Total') }}</f7-actions-button>
</f7-actions-group>
<f7-actions-group> <f7-actions-group>
<f7-actions-button bold close>{{ tt('Cancel') }}</f7-actions-button> <f7-actions-button bold close>{{ tt('Cancel') }}</f7-actions-button>
</f7-actions-group> </f7-actions-group>
@@ -223,6 +226,7 @@ const displayOrderSaving = ref<boolean>(false);
const firstShowingIds = computed<AccountShowingIds>(() => accountsStore.getFirstShowingIds(showHidden.value)); const firstShowingIds = computed<AccountShowingIds>(() => accountsStore.getFirstShowingIds(showHidden.value));
const lastShowingIds = computed<AccountShowingIds>(() => accountsStore.getLastShowingIds(showHidden.value)); const lastShowingIds = computed<AccountShowingIds>(() => accountsStore.getLastShowingIds(showHidden.value));
const hasAnyVisibleAccount = computed<boolean>(() => accountsStore.allVisibleAccountsCount > 0);
const noAvailableAccount = computed<boolean>(() => { const noAvailableAccount = computed<boolean>(() => {
if (showHidden.value) { if (showHidden.value) {
return accountsStore.allAvailableAccountsCount < 1; return accountsStore.allAvailableAccountsCount < 1;
@@ -383,6 +387,10 @@ function saveSortResult(): void {
}); });
} }
function setAccountsIncludedInTotal(): void {
props.f7router.navigate('/settings/filter/account?type=accountListTotalAmount');
}
function onSort(event: { el: { id: string }; from: number; to: number }): void { function onSort(event: { el: { id: string }; from: number; to: number }): void {
if (!event || !event.el || !event.el.id) { if (!event || !event.el || !event.el.id) {
showToast('Unable to move account'); showToast('Unable to move account');
@@ -120,7 +120,7 @@
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleAccount }" @click="selectNoneAccounts">{{ tt('Select None') }}</f7-actions-button> <f7-actions-button :class="{ 'disabled': !hasAnyVisibleAccount }" @click="selectNoneAccounts">{{ tt('Select None') }}</f7-actions-button>
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleAccount }" @click="selectInvertAccounts">{{ tt('Invert Selection') }}</f7-actions-button> <f7-actions-button :class="{ 'disabled': !hasAnyVisibleAccount }" @click="selectInvertAccounts">{{ tt('Invert Selection') }}</f7-actions-button>
</f7-actions-group> </f7-actions-group>
<f7-actions-group> <f7-actions-group v-if="allowHiddenAccount">
<f7-actions-button v-if="!showHidden" @click="showHidden = true">{{ tt('Show Hidden Accounts') }}</f7-actions-button> <f7-actions-button v-if="!showHidden" @click="showHidden = true">{{ tt('Show Hidden Accounts') }}</f7-actions-button>
<f7-actions-button v-if="showHidden" @click="showHidden = false">{{ tt('Hide Hidden Accounts') }}</f7-actions-button> <f7-actions-button v-if="showHidden" @click="showHidden = false">{{ tt('Hide Hidden Accounts') }}</f7-actions-button>
</f7-actions-group> </f7-actions-group>
@@ -171,6 +171,7 @@ const {
filterAccountIds, filterAccountIds,
title, title,
applyText, applyText,
allowHiddenAccount,
allCategorizedAccounts, allCategorizedAccounts,
hasAnyAvailableAccount, hasAnyAvailableAccount,
hasAnyVisibleAccount, hasAnyVisibleAccount,
@@ -245,15 +246,15 @@ function updateAccountSelected(e: Event): void {
} }
function selectAllAccounts(): void { function selectAllAccounts(): void {
selectAll(filterAccountIds.value, accountsStore.allAccountsMap); selectAll(filterAccountIds.value, accountsStore.allAccountsMap, !allowHiddenAccount.value);
} }
function selectNoneAccounts(): void { function selectNoneAccounts(): void {
selectNone(filterAccountIds.value, accountsStore.allAccountsMap); selectNone(filterAccountIds.value, accountsStore.allAccountsMap, !allowHiddenAccount.value);
} }
function selectInvertAccounts(): void { function selectInvertAccounts(): void {
selectInvert(filterAccountIds.value, accountsStore.allAccountsMap); selectInvert(filterAccountIds.value, accountsStore.allAccountsMap, !allowHiddenAccount.value);
} }
function save(): void { function save(): void {
+38 -1
View File
@@ -73,6 +73,18 @@
</f7-list-item> </f7-list-item>
</f7-list> </f7-list>
<f7-block-title>{{ tt('Account List Page') }}</f7-block-title>
<f7-list strong inset dividers>
<f7-list-item :disabled="!hasAnyVisibleAccount"
:title="tt('Accounts Included in Total')"
link="/settings/filter/account?type=accountListTotalAmount">
<template #after>
<f7-preloader v-if="loadingAccounts" />
<span v-else-if="!loadingAccounts">{{ accountsIncludedInTotalDisplayContent }}</span>
</template>
</f7-list-item>
</f7-list>
<f7-block-title>{{ tt('Exchange Rates Data Page') }}</f7-block-title> <f7-block-title>{{ tt('Exchange Rates Data Page') }}</f7-block-title>
<f7-list strong inset dividers> <f7-list strong inset dividers>
<f7-list-item <f7-list-item
@@ -101,14 +113,19 @@
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { useI18n } from '@/locales/helpers.ts'; import { useI18n } from '@/locales/helpers.ts';
import { useI18nUIComponents } from '@/lib/ui/mobile.ts';
import { useAppSettingPageBase } from '@/views/base/settings/AppSettingsPageBase.ts'; import { useAppSettingPageBase } from '@/views/base/settings/AppSettingsPageBase.ts';
import { useSettingsStore } from '@/stores/setting.ts'; import { useSettingsStore } from '@/stores/setting.ts';
import { useAccountsStore } from '@/stores/account.ts';
import { findNameByValue, findDisplayNameByType } from '@/lib/common.ts'; import { findNameByValue, findDisplayNameByType } from '@/lib/common.ts';
const { tt } = useI18n(); const { tt } = useI18n();
const { showToast } = useI18nUIComponents();
const { const {
loadingAccounts,
hasAnyVisibleAccount,
allTimezoneTypesUsedForStatistics, allTimezoneTypesUsedForStatistics,
allCurrencySortingTypes, allCurrencySortingTypes,
allAutoSaveTransactionDraftTypes, allAutoSaveTransactionDraftTypes,
@@ -118,10 +135,12 @@ const {
showTagInTransactionListPage, showTagInTransactionListPage,
autoSaveTransactionDraft, autoSaveTransactionDraft,
isAutoGetCurrentGeoLocation, isAutoGetCurrentGeoLocation,
currencySortByInExchangeRatesPage currencySortByInExchangeRatesPage,
accountsIncludedInTotalDisplayContent
} = useAppSettingPageBase(); } = useAppSettingPageBase();
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const accountsStore = useAccountsStore();
const showTimezoneUsedForStatisticsInHomePagePopup = ref<boolean>(false); const showTimezoneUsedForStatisticsInHomePagePopup = ref<boolean>(false);
const showAutoSaveTransactionDraftPopup = ref<boolean>(false); const showAutoSaveTransactionDraftPopup = ref<boolean>(false);
@@ -131,4 +150,22 @@ const alwaysShowTransactionPicturesInMobileTransactionEditPage = computed<boolea
get: () => settingsStore.appSettings.alwaysShowTransactionPicturesInMobileTransactionEditPage, get: () => settingsStore.appSettings.alwaysShowTransactionPicturesInMobileTransactionEditPage,
set: (value) => settingsStore.setAlwaysShowTransactionPicturesInMobileTransactionEditPage(value) set: (value) => settingsStore.setAlwaysShowTransactionPicturesInMobileTransactionEditPage(value)
}); });
function init(): void {
loadingAccounts.value = true;
accountsStore.loadAllAccounts({
force: false
}).then(() => {
loadingAccounts.value = false;
}).catch(error => {
loadingAccounts.value = false;
if (!error.processed) {
showToast(error.message || error);
}
});
}
init();
</script> </script>