mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-13 22:47:33 +08:00
support configuring the default behavior of the reconciliation statement button and the default time range for the reconciliation statement page
This commit is contained in:
@@ -41,9 +41,11 @@ var ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES = map[string]UserApplicationClo
|
||||
"insightsExplorerDefaultDateRangeType": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
|
||||
"showTagInInsightsExplorerPage": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
|
||||
// Account List Page
|
||||
"totalAmountExcludeAccountIds": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP,
|
||||
"accountCategoryOrders": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING,
|
||||
"hideCategoriesWithoutAccounts": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
|
||||
"totalAmountExcludeAccountIds": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP,
|
||||
"accountCategoryOrders": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING,
|
||||
"hideCategoriesWithoutAccounts": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
|
||||
"reconciliationStatementButtonDefaultDateRangeTypeInDesktop": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
|
||||
"reconciliationStatementPageDefaultDateRangeTypeInMobile": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
|
||||
// Exchange Rates Data Page
|
||||
"currencySortByInExchangeRatesPage": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
|
||||
// Browser Cache Management
|
||||
|
||||
+9
-1
@@ -12,7 +12,9 @@ import {
|
||||
ChartSortingType,
|
||||
DEFAULT_CATEGORICAL_CHART_DATA_RANGE,
|
||||
DEFAULT_TREND_CHART_DATA_RANGE,
|
||||
DEFAULT_ASSET_TRENDS_CHART_DATA_RANGE
|
||||
DEFAULT_ASSET_TRENDS_CHART_DATA_RANGE,
|
||||
DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_DESKTOP,
|
||||
DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_MOBILE,
|
||||
} from './statistics.ts';
|
||||
import { DEFAULT_TRANSACTION_EXPLORER_DATE_RANGE } from './explorer.ts';
|
||||
import { DEFAULT_CURRENCY_CODE } from '@/consts/currency.ts';
|
||||
@@ -66,6 +68,8 @@ export interface ApplicationSettings extends BaseApplicationSetting {
|
||||
totalAmountExcludeAccountIds: Record<string, boolean>;
|
||||
accountCategoryOrders: string;
|
||||
hideCategoriesWithoutAccounts: boolean;
|
||||
reconciliationStatementButtonDefaultDateRangeTypeInDesktop: number;
|
||||
reconciliationStatementPageDefaultDateRangeTypeInMobile: number;
|
||||
// Exchange Rates Data Page
|
||||
currencySortByInExchangeRatesPage: number;
|
||||
// Browser Cache Management
|
||||
@@ -144,6 +148,8 @@ export const ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES: Record<string, UserAp
|
||||
'totalAmountExcludeAccountIds': UserApplicationCloudSettingType.StringBooleanMap,
|
||||
'accountCategoryOrders': UserApplicationCloudSettingType.String,
|
||||
'hideCategoriesWithoutAccounts': UserApplicationCloudSettingType.Boolean,
|
||||
'reconciliationStatementButtonDefaultDateRangeTypeInDesktop': UserApplicationCloudSettingType.Number,
|
||||
'reconciliationStatementPageDefaultDateRangeTypeInMobile': UserApplicationCloudSettingType.Number,
|
||||
// Exchange Rates Data Page
|
||||
'currencySortByInExchangeRatesPage': UserApplicationCloudSettingType.Number,
|
||||
// Browser Cache Management
|
||||
@@ -204,6 +210,8 @@ export const DEFAULT_APPLICATION_SETTINGS: ApplicationSettings = {
|
||||
totalAmountExcludeAccountIds: {},
|
||||
accountCategoryOrders: '',
|
||||
hideCategoriesWithoutAccounts: false,
|
||||
reconciliationStatementButtonDefaultDateRangeTypeInDesktop: DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_DESKTOP.type,
|
||||
reconciliationStatementPageDefaultDateRangeTypeInMobile: DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_MOBILE.type,
|
||||
// Exchange Rates Data Page
|
||||
currencySortByInExchangeRatesPage: CurrencySortingType.Default.type,
|
||||
// Browser Cache Management
|
||||
|
||||
@@ -297,3 +297,6 @@ export enum ExportMermaidChartType {
|
||||
export const DEFAULT_CATEGORICAL_CHART_DATA_RANGE: DateRange = DateRange.ThisMonth;
|
||||
export const DEFAULT_TREND_CHART_DATA_RANGE: DateRange = DateRange.ThisYear;
|
||||
export const DEFAULT_ASSET_TRENDS_CHART_DATA_RANGE: DateRange = DateRange.ThisYear;
|
||||
|
||||
export const DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_DESKTOP: DateRange = DateRange.Custom;
|
||||
export const DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_MOBILE: DateRange = DateRange.ThisMonth;
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Kontokategorie-Reihenfolge gespeichert",
|
||||
"Unable to move account category": "Kontokategorie kann nicht verschoben werden",
|
||||
"Hide Categories Without Accounts": "Kategorien ohne Konten ausblenden",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Wechselkursdatenseite",
|
||||
"Exchange Rate": "Wechselkurs",
|
||||
"Enable Swipe Back": "Zurückwischen aktivieren",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Account category order saved",
|
||||
"Unable to move account category": "Unable to move account category",
|
||||
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Exchange Rates Data Page",
|
||||
"Exchange Rate": "Exchange Rate",
|
||||
"Enable Swipe Back": "Enable Swipe Back",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Account category order saved",
|
||||
"Unable to move account category": "Unable to move account category",
|
||||
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Página de Tipos de Cambio",
|
||||
"Exchange Rate": "Tipo de Cambio",
|
||||
"Enable Swipe Back": "Deslizar para Regresar",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Account category order saved",
|
||||
"Unable to move account category": "Unable to move account category",
|
||||
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Page des données de taux de change",
|
||||
"Exchange Rate": "Taux de change",
|
||||
"Enable Swipe Back": "Activer le balayage de retour",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Account category order saved",
|
||||
"Unable to move account category": "Unable to move account category",
|
||||
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Pagina dati tassi di cambio",
|
||||
"Exchange Rate": "Tasso di cambio",
|
||||
"Enable Swipe Back": "Enable Swipe Back",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Account category order saved",
|
||||
"Unable to move account category": "Unable to move account category",
|
||||
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "為替レートデータページ",
|
||||
"Exchange Rate": "為替レート",
|
||||
"Enable Swipe Back": "Enable Swipe Back",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Account category order saved",
|
||||
"Unable to move account category": "Unable to move account category",
|
||||
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "ವಿನಿಮಯ ದರಗಳ ಪುಟ",
|
||||
"Exchange Rate": "ವಿನಿಮಯ ದರ",
|
||||
"Enable Swipe Back": "ಸ್ವೈಪ್ ಬ್ಯಾಕ್ ಸಕ್ರಿಯಗೊಳಿಸಿ",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "계좌 범주 순서가 저장되었습니다",
|
||||
"Unable to move account category": "계좌 범주를 이동할 수 없습니다",
|
||||
"Hide Categories Without Accounts": "계좌가 없는 범주 숨기기",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "환율 데이터 페이지",
|
||||
"Exchange Rate": "환율",
|
||||
"Enable Swipe Back": "스와이프 뒤로 가기 활성화",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Account category order saved",
|
||||
"Unable to move account category": "Unable to move account category",
|
||||
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Wisselkoersgegevenspagina",
|
||||
"Exchange Rate": "Wisselkoers",
|
||||
"Enable Swipe Back": "Enable Swipe Back",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Ordem das categorias de conta salva",
|
||||
"Unable to move account category": "Não foi possível mover a categoria de conta",
|
||||
"Hide Categories Without Accounts": "Ocultar Categorias sem Contas",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Página de Dados de Taxas de Câmbio",
|
||||
"Exchange Rate": "Taxa de Câmbio",
|
||||
"Enable Swipe Back": "Ativar Deslizar para Voltar",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Порядок категорий счетов сохранен",
|
||||
"Unable to move account category": "Не удалось переместить категорию счёта",
|
||||
"Hide Categories Without Accounts": "Скрыть категории без счетов",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Страница данных о курсах валют",
|
||||
"Exchange Rate": "Курс обмена",
|
||||
"Enable Swipe Back": "Включить свайп назад",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Vrstni red kategorij računov je shranjen",
|
||||
"Unable to move account category": "Kategorije računa ni mogoče premakniti",
|
||||
"Hide Categories Without Accounts": "Skrij kategorije brez računov",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Stran z menjalnimi tečaji",
|
||||
"Exchange Rate": "Menjalni tečaj",
|
||||
"Enable Swipe Back": "Omogoči podrsanje nazaj",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "கணக்கு வகை வரிசை சேமிக்கப்பட்டது",
|
||||
"Unable to move account category": "கணக்கு வகை நகர்த்த முடியவில்லை",
|
||||
"Hide Categories Without Accounts": "கணக்குகள் இல்லாத வகைகளை மறை",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "மாற்று விகிதம்களின் பக்கம்",
|
||||
"Exchange Rate": "மாற்று விகிதம்",
|
||||
"Enable Swipe Back": "ஸ்வைப் பின் செயலில்ப்படுத்து",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Account category order saved",
|
||||
"Unable to move account category": "Unable to move account category",
|
||||
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "หน้าข้อมูลอัตราแลกเปลี่ยน",
|
||||
"Exchange Rate": "อัตราแลกเปลี่ยน",
|
||||
"Enable Swipe Back": "เปิดใช้งานปัดย้อนกลับ",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Account category order saved",
|
||||
"Unable to move account category": "Unable to move account category",
|
||||
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Döviz Kuru Verileri Sayfası",
|
||||
"Exchange Rate": "Döviz Kuru",
|
||||
"Enable Swipe Back": "Geri Kaydırmayı Etkinleştir",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Account category order saved",
|
||||
"Unable to move account category": "Unable to move account category",
|
||||
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Сторінка курсів валют",
|
||||
"Exchange Rate": "Курс обміну",
|
||||
"Enable Swipe Back": "Enable Swipe Back",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "Account category order saved",
|
||||
"Unable to move account category": "Unable to move account category",
|
||||
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
|
||||
"Default Date Range for Reconciliation Statement Button": "Default Date Range for Reconciliation Statement Button",
|
||||
"Default Date Range for Reconciliation Statement Page": "Default Date Range for Reconciliation Statement Page",
|
||||
"Exchange Rates Data Page": "Trang dữ liệu tỷ giá hối đoái",
|
||||
"Exchange Rate": "Tỷ giá hối đoái",
|
||||
"Enable Swipe Back": "Enable Swipe Back",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "账户分类顺序已保存",
|
||||
"Unable to move account category": "无法移动账户分类",
|
||||
"Hide Categories Without Accounts": "隐藏没有账户的分类",
|
||||
"Default Date Range for Reconciliation Statement Button": "对账单按钮默认时间范围",
|
||||
"Default Date Range for Reconciliation Statement Page": "对账单页面默认时间范围",
|
||||
"Exchange Rates Data Page": "汇率数据页面",
|
||||
"Exchange Rate": "汇率",
|
||||
"Enable Swipe Back": "启用侧滑返回",
|
||||
|
||||
@@ -2356,6 +2356,8 @@
|
||||
"Account category order saved": "帳戶分類順序已儲存",
|
||||
"Unable to move account category": "無法移動帳戶分類",
|
||||
"Hide Categories Without Accounts": "隱藏沒有帳戶的分類",
|
||||
"Default Date Range for Reconciliation Statement Button": "對帳單按鈕預設日期範圍",
|
||||
"Default Date Range for Reconciliation Statement Page": "對帳單頁面預設日期範圍",
|
||||
"Exchange Rates Data Page": "匯率資料頁面",
|
||||
"Exchange Rate": "匯率",
|
||||
"Enable Swipe Back": "啟用滑動返回",
|
||||
|
||||
@@ -317,6 +317,18 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
updateUserApplicationCloudSettingValue('hideCategoriesWithoutAccounts', value);
|
||||
}
|
||||
|
||||
function setReconciliationStatementButtonDefaultDateRangeTypeInDesktop(value: number): void {
|
||||
updateApplicationSettingsValue('reconciliationStatementButtonDefaultDateRangeTypeInDesktop', value);
|
||||
appSettings.value.reconciliationStatementButtonDefaultDateRangeTypeInDesktop = value;
|
||||
updateUserApplicationCloudSettingValue('reconciliationStatementButtonDefaultDateRangeTypeInDesktop', value);
|
||||
}
|
||||
|
||||
function setReconciliationStatementPageDefaultDateRangeTypeInMobile(value: number): void {
|
||||
updateApplicationSettingsValue('reconciliationStatementPageDefaultDateRangeTypeInMobile', value);
|
||||
appSettings.value.reconciliationStatementPageDefaultDateRangeTypeInMobile = value;
|
||||
updateUserApplicationCloudSettingValue('reconciliationStatementPageDefaultDateRangeTypeInMobile', value);
|
||||
}
|
||||
|
||||
// Exchange Rates Data Page
|
||||
function setCurrencySortByInExchangeRatesPage(value: number): void {
|
||||
updateApplicationSettingsValue('currencySortByInExchangeRatesPage', value);
|
||||
@@ -558,6 +570,8 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
setTotalAmountExcludeAccountIds,
|
||||
setAccountCategoryOrders,
|
||||
setHideCategoriesWithoutAccounts,
|
||||
setReconciliationStatementButtonDefaultDateRangeTypeInDesktop,
|
||||
setReconciliationStatementPageDefaultDateRangeTypeInMobile,
|
||||
// -- Exchange Rates Data Page
|
||||
setCurrencySortByInExchangeRatesPage,
|
||||
// -- Browser Cache Management
|
||||
|
||||
@@ -78,7 +78,9 @@ export const ALL_APPLICATION_CLOUD_SETTINGS: CategorizedApplicationCloudSettingI
|
||||
items: [
|
||||
{ settingKey: 'totalAmountExcludeAccountIds', settingName: 'Accounts Included in Total', mobile: true, desktop: true },
|
||||
{ settingKey: 'accountCategoryOrders', settingName: 'Account Category Order', mobile: true, desktop: true },
|
||||
{ settingKey: 'hideCategoriesWithoutAccounts', settingName: 'Hide Categories Without Accounts', mobile: false, desktop: true }
|
||||
{ settingKey: 'hideCategoriesWithoutAccounts', settingName: 'Hide Categories Without Accounts', mobile: false, desktop: true },
|
||||
{ settingKey: 'reconciliationStatementButtonDefaultDateRangeTypeInDesktop', settingName: 'Default Date Range for Reconciliation Statement Button', mobile: false, desktop: true },
|
||||
{ settingKey: 'reconciliationStatementPageDefaultDateRangeTypeInMobile', settingName: 'Default Date Range for Reconciliation Statement Page', mobile: true, desktop: false }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ref, computed } from 'vue';
|
||||
import { useI18n } from '@/locales/helpers.ts';
|
||||
|
||||
import { useSettingsStore } from '@/stores/setting.ts';
|
||||
import { useUserStore } from '@/stores/user.ts';
|
||||
import { useAccountsStore } from '@/stores/account.ts';
|
||||
import { useTransactionsStore } from '@/stores/transaction.ts';
|
||||
import { useTransactionCategoriesStore } from '@/stores/transactionCategory.ts';
|
||||
@@ -10,6 +11,7 @@ import { useOverviewStore } from '@/stores/overview.ts';
|
||||
import { useStatisticsStore } from '@/stores/statistics.ts';
|
||||
|
||||
import { type NameValue, type TypeAndDisplayName, keysIfValueEquals, values } from '@/core/base.ts';
|
||||
import { DateRangeScene, DateRange } from '@/core/datetime.ts';
|
||||
import type { LocalizedTimezoneInfo } from '@/core/timezone.ts';
|
||||
import { CategoryType } from '@/core/category.ts';
|
||||
import type { Account } from '@/models/account.ts';
|
||||
@@ -18,9 +20,17 @@ import { isObjectEmpty } from '@/lib/common.ts';
|
||||
import { getCurrentUnixTime } from '@/lib/datetime.ts';
|
||||
|
||||
export function useAppSettingPageBase() {
|
||||
const { tt, getAllTimezones, getAllTimezoneTypesUsedForStatistics, getAllCurrencySortingTypes, setTimeZone } = useI18n();
|
||||
const {
|
||||
tt,
|
||||
getAllDateRanges,
|
||||
getAllTimezones,
|
||||
getAllTimezoneTypesUsedForStatistics,
|
||||
getAllCurrencySortingTypes,
|
||||
setTimeZone
|
||||
} = useI18n();
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
const userStore = useUserStore();
|
||||
const accountsStore = useAccountsStore();
|
||||
const transactionsStore = useTransactionsStore();
|
||||
const transactionCategoriesStore = useTransactionCategoriesStore();
|
||||
@@ -50,6 +60,12 @@ export function useAppSettingPageBase() {
|
||||
];
|
||||
});
|
||||
|
||||
const allReconciliationStatementDateRanges = computed(() => getAllDateRanges(DateRangeScene.Normal, {
|
||||
includeCustom: true,
|
||||
includeBillingCycle: true,
|
||||
includeLastReconciledTimeRange: userStore.currentUserUseLastReconciledTime
|
||||
}));
|
||||
|
||||
const hasAnyAccount = computed<boolean>(() => accountsStore.allPlainAccounts.length > 0);
|
||||
const hasAnyVisibleAccount = computed<boolean>(() => accountsStore.allVisibleAccountsCount > 0);
|
||||
const hasAnyTransactionCategory = computed<boolean>(() => !isObjectEmpty(transactionCategoriesStore.allTransactionCategoriesMap));
|
||||
@@ -219,6 +235,14 @@ export function useAppSettingPageBase() {
|
||||
return tt('Partial');
|
||||
}
|
||||
|
||||
function getValidReconciliationStatementPageDefaultDateRangeType(value: number, defaultValue: number): number {
|
||||
if (DateRange.isLastReconciledTimeRange(value) && !userStore.currentUserUseLastReconciledTime) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
// states
|
||||
loadingAccounts,
|
||||
@@ -229,6 +253,7 @@ export function useAppSettingPageBase() {
|
||||
allTimezoneTypesUsedForStatistics,
|
||||
allCurrencySortingTypes,
|
||||
allAutoSaveTransactionDraftTypes,
|
||||
allReconciliationStatementDateRanges,
|
||||
timeZone,
|
||||
hasAnyAccount,
|
||||
hasAnyVisibleAccount,
|
||||
@@ -246,6 +271,7 @@ export function useAppSettingPageBase() {
|
||||
accountsIncludedInHomePageOverviewDisplayContent,
|
||||
accountsIncludedInTotalDisplayContent,
|
||||
accountCategorysDisplayOrderContent,
|
||||
transactionCategoriesIncludedInHomePageOverviewDisplayContent
|
||||
transactionCategoriesIncludedInHomePageOverviewDisplayContent,
|
||||
getValidReconciliationStatementPageDefaultDateRangeType
|
||||
};
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ export function useTransactionListPageBase() {
|
||||
const allDateRanges = computed<LocalizedDateRange[]>(() => getAllDateRanges(DateRangeScene.Normal, {
|
||||
includeCustom: true,
|
||||
includeBillingCycle: !!accountsStore.getAccountStatementDate(query.value.accountIds),
|
||||
includeLastReconciledTimeRange: !!allAccountsMap.value[query.value.accountIds]?.lastReconciledTime
|
||||
includeLastReconciledTimeRange: userStore.currentUserUseLastReconciledTime && !!allAccountsMap.value[query.value.accountIds]?.lastReconciledTime
|
||||
}));
|
||||
|
||||
const allAccounts = computed<Account[]>(() => accountsStore.allMixedPlainAccounts);
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
</v-btn>
|
||||
<v-btn class="px-2 ms-1" density="comfortable" color="default" variant="text"
|
||||
:disabled="loading" :prepend-icon="mdiInvoiceListOutline"
|
||||
@click="showReconciliationStatementCustomDateRangeDialog(element.getAccountOrSubAccount(activeSubAccount[element.id]))"
|
||||
@click="showReconciliationStatementDialog(element.getAccountOrSubAccount(activeSubAccount[element.id]))"
|
||||
v-if="element.type === AccountType.SingleAccount.type || element.getSubAccount(activeSubAccount[element.id])">
|
||||
{{ tt('Reconciliation Statement') }}
|
||||
<v-menu activator="parent" :open-on-hover="true">
|
||||
@@ -224,7 +224,7 @@
|
||||
<v-list-item class="text-sm" density="compact"
|
||||
:value="dateRange.type">
|
||||
<v-list-item-title class="cursor-pointer"
|
||||
@click="showReconciliationStatementCustomDateRangeDialog(element.getAccountOrSubAccount(activeSubAccount[element.id]), dateRange.type)">
|
||||
@click="showReconciliationStatementDialog(element.getAccountOrSubAccount(activeSubAccount[element.id]), dateRange.type)">
|
||||
<div class="d-flex align-center">
|
||||
<span class="text-sm ms-3">{{ dateRange.displayName }}</span>
|
||||
</div>
|
||||
@@ -335,10 +335,12 @@ import { useI18n } from '@/locales/helpers.ts';
|
||||
import { useAccountListPageBase } from '@/views/base/accounts/AccountListPageBase.ts';
|
||||
|
||||
import { useSettingsStore } from '@/stores/setting.ts';
|
||||
import { useUserStore } from '@/stores/user.ts';
|
||||
import { useAccountsStore } from '@/stores/account.ts';
|
||||
|
||||
import { DateRange, DateRangeScene, type LocalizedDateRange, type TimeRangeAndDateType } from '@/core/datetime.ts';
|
||||
import { AccountType, AccountCategory } from '@/core/account.ts';
|
||||
import { DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_DESKTOP } from '@/core/statistics.ts';
|
||||
import type { Account } from '@/models/account.ts';
|
||||
|
||||
import { isNumber } from '@/lib/common.ts';
|
||||
@@ -400,6 +402,7 @@ const {
|
||||
} = useAccountListPageBase();
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
const userStore = useUserStore();
|
||||
const accountsStore = useAccountsStore();
|
||||
|
||||
const confirmDialog = useTemplateRef<ConfirmDialogType>('confirmDialog');
|
||||
@@ -502,7 +505,7 @@ function accountReconciliationStatementDateRanges(account: Account): LocalizedDa
|
||||
return getAllDateRanges(DateRangeScene.Normal, {
|
||||
includeCustom: true,
|
||||
includeBillingCycle: !!accountsStore.getAccountStatementDate(account.id),
|
||||
includeLastReconciledTimeRange: !!account.lastReconciledTime
|
||||
includeLastReconciledTimeRange: userStore.currentUserUseLastReconciledTime && !!account.lastReconciledTime
|
||||
});
|
||||
}
|
||||
|
||||
@@ -539,7 +542,21 @@ function edit(account: Account): void {
|
||||
});
|
||||
}
|
||||
|
||||
function showReconciliationStatementCustomDateRangeDialog(account: Account, dateRangeType?: number): void {
|
||||
function showReconciliationStatementDialog(account: Account, dateRangeType?: number): void {
|
||||
if (!isNumber(dateRangeType)) {
|
||||
const defualtDateRange = DateRange.valueOf(settingsStore.appSettings.reconciliationStatementButtonDefaultDateRangeTypeInDesktop);
|
||||
|
||||
if (!defualtDateRange) {
|
||||
dateRangeType = DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_DESKTOP.type;
|
||||
} else if (defualtDateRange.isBillingCycle && !accountsStore.getAccountStatementDate(account.id)) {
|
||||
dateRangeType = DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_DESKTOP.type;
|
||||
} else if (defualtDateRange.isLastReconciledTimeRange && (!userStore.currentUserUseLastReconciledTime || !account.lastReconciledTime)) {
|
||||
dateRangeType = DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_DESKTOP.type;
|
||||
} else {
|
||||
dateRangeType = defualtDateRange.type;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isNumber(dateRangeType) || dateRangeType === DateRange.Custom.type) {
|
||||
accountToShowReconciliationStatement.value = account;
|
||||
showCustomDateRangeDialog.value = true;
|
||||
|
||||
@@ -323,6 +323,17 @@
|
||||
v-model="hideCategoriesWithoutAccounts"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col cols="12" md="6">
|
||||
<v-select
|
||||
item-title="displayName"
|
||||
item-value="type"
|
||||
persistent-placeholder
|
||||
:label="tt('Default Date Range for Reconciliation Statement Button')"
|
||||
:placeholder="tt('Default Date Range for Reconciliation Statement Button')"
|
||||
:items="allReconciliationStatementDateRanges"
|
||||
v-model="reconciliationStatementButtonDefaultDateRangeTypeInDesktop"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-form>
|
||||
@@ -392,6 +403,7 @@ import type { LocalizedSwitchOption } from '@/core/base.ts';
|
||||
import { ThemeType } from '@/core/theme.ts';
|
||||
import { type LocalizedDateRange, DateRangeScene } from '@/core/datetime.ts';
|
||||
import { CategoryType } from '@/core/category.ts';
|
||||
import { DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_DESKTOP } from '@/core/statistics.ts';
|
||||
|
||||
import { getSystemTheme } from '@/lib/ui/common.ts';
|
||||
|
||||
@@ -409,6 +421,7 @@ const {
|
||||
allTimezoneTypesUsedForStatistics,
|
||||
allCurrencySortingTypes,
|
||||
allAutoSaveTransactionDraftTypes,
|
||||
allReconciliationStatementDateRanges,
|
||||
hasAnyAccount,
|
||||
hasAnyVisibleAccount,
|
||||
hasAnyTransactionCategory,
|
||||
@@ -426,7 +439,8 @@ const {
|
||||
accountsIncludedInHomePageOverviewDisplayContent,
|
||||
accountsIncludedInTotalDisplayContent,
|
||||
accountCategorysDisplayOrderContent,
|
||||
transactionCategoriesIncludedInHomePageOverviewDisplayContent
|
||||
transactionCategoriesIncludedInHomePageOverviewDisplayContent,
|
||||
getValidReconciliationStatementPageDefaultDateRangeType
|
||||
} = useAppSettingPageBase();
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
@@ -483,6 +497,11 @@ const hideCategoriesWithoutAccounts = computed<boolean>({
|
||||
set: (value) => settingsStore.setHideCategoriesWithoutAccounts(value)
|
||||
});
|
||||
|
||||
const reconciliationStatementButtonDefaultDateRangeTypeInDesktop = computed<number>({
|
||||
get: () => getValidReconciliationStatementPageDefaultDateRangeType(settingsStore.appSettings.reconciliationStatementButtonDefaultDateRangeTypeInDesktop, DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_DESKTOP.type),
|
||||
set: (value: number) => settingsStore.setReconciliationStatementButtonDefaultDateRangeTypeInDesktop(value)
|
||||
});
|
||||
|
||||
function init(): void {
|
||||
loadingAccounts.value = true;
|
||||
|
||||
|
||||
@@ -357,13 +357,15 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref, computed, nextTick } from 'vue';
|
||||
import type { Router } from 'framework7/types';
|
||||
|
||||
import { useI18n } from '@/locales/helpers.ts';
|
||||
import { useI18nUIComponents, showLoading, hideLoading, onSwipeoutDeleted } from '@/lib/ui/mobile.ts';
|
||||
import { useReconciliationStatementPageBase } from '@/views/base/accounts/ReconciliationStatementPageBase.ts';
|
||||
|
||||
import { useSettingsStore } from '@/stores/setting.ts';
|
||||
import { useUserStore } from '@/stores/user.ts';
|
||||
import { useAccountsStore } from '@/stores/account.ts';
|
||||
import { useTransactionCategoriesStore } from '@/stores/transactionCategory.ts';
|
||||
import { useTransactionsStore } from '@/stores/transaction.ts';
|
||||
@@ -372,6 +374,7 @@ import { TextDirection } from '@/core/text.ts';
|
||||
import { type TimeRangeAndDateType, DateRange, DateRangeScene } from '@/core/datetime.ts';
|
||||
import { AccountType } from '@/core/account.ts';
|
||||
import { TransactionType } from '@/core/transaction.ts';
|
||||
import { DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_MOBILE } from '@/core/statistics.ts';
|
||||
import { TRANSACTION_MIN_AMOUNT, TRANSACTION_MAX_AMOUNT } from '@/consts/transaction.ts';
|
||||
import { type TransactionReconciliationStatementResponseItemWithInfo } from '@/models/transaction.ts';
|
||||
|
||||
@@ -448,6 +451,8 @@ const {
|
||||
getDisplayAccountBalance
|
||||
} = useReconciliationStatementPageBase();
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
const userStore = useUserStore();
|
||||
const accountsStore = useAccountsStore();
|
||||
const transactionCategoriesStore = useTransactionCategoriesStore();
|
||||
const transactionsStore = useTransactionsStore();
|
||||
@@ -455,7 +460,7 @@ const transactionsStore = useTransactionsStore();
|
||||
const finishQuery = ref<boolean>(false);
|
||||
const loading = ref<boolean>(false);
|
||||
const loadingError = ref<unknown | null>(null);
|
||||
const queryDateRangeType = ref<number>(DateRange.ThisMonth.type);
|
||||
const queryDateRangeType = ref<number>(DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_MOBILE.type);
|
||||
const showAccountBalanceTrendsCharts = ref<boolean>(false);
|
||||
const updatingLastReconciledTime = ref<boolean>(false);
|
||||
const transactionToDelete = ref<TransactionReconciliationStatementResponseItemWithInfo | null>(null);
|
||||
@@ -474,7 +479,7 @@ const validQuery = computed(() => currentAccount.value && currentAccount.value.t
|
||||
const allAvailableDateRanges = computed(() => getAllDateRanges(DateRangeScene.Normal, {
|
||||
includeCustom: true,
|
||||
includeBillingCycle: !!accountsStore.getAccountStatementDate(accountId.value),
|
||||
includeLastReconciledTimeRange: !!currentAccountLastReconciledTime.value
|
||||
includeLastReconciledTimeRange: userStore.currentUserUseLastReconciledTime && !!currentAccountLastReconciledTime.value
|
||||
}));
|
||||
|
||||
const allReconciliationStatementVirtualListItems = computed<ReconciliationStatementVirtualListItem[]>(() => {
|
||||
@@ -529,6 +534,8 @@ function init(): void {
|
||||
endTime.value = defaultDateRange?.maxTime || 0;
|
||||
reconciliationStatements.value = undefined;
|
||||
|
||||
initDateFilter();
|
||||
|
||||
Promise.all([
|
||||
accountsStore.loadAllAccounts({ force: false }),
|
||||
transactionCategoriesStore.loadAllCategories({ force: false })
|
||||
@@ -538,6 +545,25 @@ function init(): void {
|
||||
});
|
||||
}
|
||||
|
||||
function initDateFilter(): void {
|
||||
let defaultDateRangeType = settingsStore.appSettings.reconciliationStatementPageDefaultDateRangeTypeInMobile;
|
||||
const defualtDateRange = DateRange.valueOf(defaultDateRangeType);
|
||||
|
||||
if (!defualtDateRange) {
|
||||
defaultDateRangeType = DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_MOBILE.type;
|
||||
} else if (defualtDateRange.isBillingCycle && !accountsStore.getAccountStatementDate(accountId.value)) {
|
||||
defaultDateRangeType = DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_MOBILE.type;
|
||||
} else if (defualtDateRange.isLastReconciledTimeRange && (!userStore.currentUserUseLastReconciledTime || !currentAccount.value || !currentAccount.value.lastReconciledTime)) {
|
||||
defaultDateRangeType = DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_MOBILE.type;
|
||||
} else {
|
||||
defaultDateRangeType = defualtDateRange.type;
|
||||
}
|
||||
|
||||
nextTick(() => {
|
||||
changeDateFilter(defaultDateRangeType);
|
||||
});
|
||||
}
|
||||
|
||||
function changeDateFilter(dateRangeType: number): void {
|
||||
if (dateRangeType === DateRange.Custom.type) {
|
||||
showCustomDateRangeSheet.value = true;
|
||||
|
||||
@@ -218,6 +218,31 @@
|
||||
<div>{{ accountCategorysDisplayOrderContent }}</div>
|
||||
</template>
|
||||
</f7-list-item>
|
||||
<f7-list-item
|
||||
class="item-truncate-after-text"
|
||||
link="#"
|
||||
@click="showReconciliationStatementDefaultDateRangePopup = true"
|
||||
>
|
||||
<template #after-title>
|
||||
<div class="item-actual-title">
|
||||
<span>{{ tt('Default Date Range for Reconciliation Statement Page') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #after>
|
||||
{{ findDisplayNameByType(allReconciliationStatementDateRanges, reconciliationStatementPageDefaultDateRangeTypeInMobile) }}
|
||||
</template>
|
||||
<list-item-selection-popup value-type="item"
|
||||
key-field="type" value-field="type"
|
||||
title-field="displayName"
|
||||
:title="tt('Default Date Range')"
|
||||
:enable-filter="true"
|
||||
:filter-placeholder="tt('Date Range')"
|
||||
:filter-no-items-text="tt('No results')"
|
||||
:items="allReconciliationStatementDateRanges"
|
||||
v-model:show="showReconciliationStatementDefaultDateRangePopup"
|
||||
v-model="reconciliationStatementPageDefaultDateRangeTypeInMobile">
|
||||
</list-item-selection-popup>
|
||||
</f7-list-item>
|
||||
</f7-list>
|
||||
|
||||
<f7-block-title>{{ tt('Exchange Rates Data Page') }}</f7-block-title>
|
||||
@@ -265,6 +290,7 @@ import { useTransactionCategoriesStore } from '@/stores/transactionCategory.ts';
|
||||
import type { TypeAndDisplayName } from '@/core/base.ts';
|
||||
import { CategoryType } from '@/core/category.ts';
|
||||
import { TransactionQuickSaveButtonStyle } from '@/core/transaction.ts';
|
||||
import { DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_MOBILE } from '@/core/statistics.ts';
|
||||
|
||||
import { findNameByValue, findDisplayNameByType } from '@/lib/common.ts';
|
||||
|
||||
@@ -283,6 +309,7 @@ const {
|
||||
allTimezoneTypesUsedForStatistics,
|
||||
allCurrencySortingTypes,
|
||||
allAutoSaveTransactionDraftTypes,
|
||||
allReconciliationStatementDateRanges,
|
||||
showAmountInHomePage,
|
||||
timezoneUsedForStatisticsInHomePage,
|
||||
showTotalAmountInTransactionListPage,
|
||||
@@ -293,7 +320,8 @@ const {
|
||||
accountsIncludedInHomePageOverviewDisplayContent,
|
||||
accountsIncludedInTotalDisplayContent,
|
||||
accountCategorysDisplayOrderContent,
|
||||
transactionCategoriesIncludedInHomePageOverviewDisplayContent
|
||||
transactionCategoriesIncludedInHomePageOverviewDisplayContent,
|
||||
getValidReconciliationStatementPageDefaultDateRangeType
|
||||
} = useAppSettingPageBase();
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
@@ -304,6 +332,7 @@ const showTimezoneUsedForStatisticsInHomePagePopup = ref<boolean>(false);
|
||||
const showQuickSaveButtonStyleInMobileTransactionListPagePopup = ref<boolean>(false);
|
||||
const showQuickAddButtonActionInMobileTransactionEditPagePopup = ref<boolean>(false);
|
||||
const showAutoSaveTransactionDraftPopup = ref<boolean>(false);
|
||||
const showReconciliationStatementDefaultDateRangePopup = ref<boolean>(false);
|
||||
const showCurrencySortByInExchangeRatesPagePopup = ref<boolean>(false);
|
||||
|
||||
const allTransactionQuickSaveButtonStyles = computed<TypeAndDisplayName[]>(() => getAllTransactionQuickSaveButtonStyles());
|
||||
@@ -324,6 +353,11 @@ const alwaysShowTransactionPicturesInMobileTransactionEditPage = computed<boolea
|
||||
set: (value) => settingsStore.setAlwaysShowTransactionPicturesInMobileTransactionEditPage(value)
|
||||
});
|
||||
|
||||
const reconciliationStatementPageDefaultDateRangeTypeInMobile = computed<number>({
|
||||
get: () => getValidReconciliationStatementPageDefaultDateRangeType(settingsStore.appSettings.reconciliationStatementPageDefaultDateRangeTypeInMobile, DEFAULT_RECONCILIATION_STATEMENT_DATE_RANGE_IN_MOBILE.type),
|
||||
set: (value: number) => settingsStore.setReconciliationStatementPageDefaultDateRangeTypeInMobile(value)
|
||||
});
|
||||
|
||||
function init(): void {
|
||||
loadingAccounts.value = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user