support setting timezone type in reconciliation statement dialog / page

This commit is contained in:
MaysWind
2026-01-04 00:36:00 +08:00
parent 43154832b6
commit 43bc04012d
10 changed files with 213 additions and 124 deletions
@@ -44,6 +44,14 @@
:title="dateAggregationType.displayName"
@click="chartDataDateAggregationType = dateAggregationType.type"
v-for="dateAggregationType in allDateAggregationTypes"></v-list-item>
<v-divider class="my-2"/>
<v-list-subheader :title="tt('Timezone Used for Date Range')"/>
<v-list-item :key="timezoneType.type" :value="timezoneType.type"
:prepend-icon="timezoneTypeIconMap[timezoneType.type]"
:append-icon="timezoneUsedForDateRange === timezoneType.type ? mdiCheck : undefined"
:title="timezoneType.displayName"
v-for="timezoneType in allTimezoneTypesUsedForDateRange"
@click="timezoneUsedForDateRange = timezoneType.type"></v-list-item>
</v-list>
</v-menu>
</v-btn>
@@ -227,6 +235,7 @@
<account-balance-trends-chart
:type="chartType"
:date-aggregation-type="chartDataDateAggregationType"
:timezone-used-for-date-range="timezoneUsedForDateRange"
:fiscal-year-start="fiscalYearStart"
:items="[]"
:legend-name="isCurrentLiabilityAccount ? tt('Account Outstanding Balance') : tt('Account Balance')"
@@ -238,6 +247,7 @@
<account-balance-trends-chart
:type="chartType"
:date-aggregation-type="chartDataDateAggregationType"
:timezone-used-for-date-range="timezoneUsedForDateRange"
:fiscal-year-start="fiscalYearStart"
:items="reconciliationStatements?.transactions"
:legend-name="isCurrentLiabilityAccount ? tt('Account Outstanding Balance') : tt('Account Balance')"
@@ -280,6 +290,7 @@ import { useTransactionsStore } from '@/stores/transaction.ts';
import type { NameNumeralValue } from '@/core/base.ts';
import type { NumeralSystem } from '@/core/numeral.ts';
import { TimezoneTypeForStatistics } from '@/core/timezone.ts';
import { TransactionType } from '@/core/transaction.ts';
import { AccountBalanceTrendChartType, ChartDateAggregationType } from '@/core/statistics.ts';
import { KnownFileType } from '@/core/file.ts';
@@ -300,6 +311,8 @@ import {
mdiChartWaterfall,
mdiCalendarTodayOutline,
mdiCalendarMonthOutline,
mdiHomeClockOutline,
mdiInvoiceTextClockOutline,
mdiLayersTripleOutline,
mdiInvoiceTextPlusOutline,
mdiInvoiceTextEditOutline,
@@ -323,9 +336,12 @@ const {
startTime,
endTime,
reconciliationStatements,
chartDataDateAggregationType,
timezoneUsedForDateRange,
fiscalYearStart,
allChartTypes,
allDateAggregationTypes,
allTimezoneTypesUsedForDateRange,
currentAccount,
currentAccountCurrency,
isCurrentLiabilityAccount,
@@ -366,6 +382,11 @@ const chartDataDateAggregationTypeIconMap = {
[ChartDateAggregationType.FiscalYear.type]: mdiLayersTripleOutline,
};
const timezoneTypeIconMap = {
[TimezoneTypeForStatistics.ApplicationTimezone.type]: mdiHomeClockOutline,
[TimezoneTypeForStatistics.TransactionTimezone.type]: mdiInvoiceTextClockOutline
};
const amountInputDialog = useTemplateRef<AmountInputDialogType>('amountInputDialog');
const snackbar = useTemplateRef<SnackBarType>('snackbar');
const editDialog = useTemplateRef<EditDialogType>('editDialog');
@@ -376,7 +397,6 @@ const currentPage = ref<number>(1);
const countPerPage = ref<number>(10);
const showAccountBalanceTrendsCharts = ref<boolean>(false);
const chartType = ref<number>(AccountBalanceTrendChartType.Default.type);
const chartDataDateAggregationType = ref<number>(ChartDateAggregationType.Day.type);
let rejectFunc: ((reason?: unknown) => void) | null = null;
@@ -462,6 +482,7 @@ function open(options: { accountId: string, startTime: number, endTime: number }
showAccountBalanceTrendsCharts.value = false;
chartType.value = AccountBalanceTrendChartType.Default.type;
chartDataDateAggregationType.value = ChartDateAggregationType.Day.type;
timezoneUsedForDateRange.value = TimezoneTypeForStatistics.ApplicationTimezone.type;
showState.value = true;
loading.value = true;
+2 -2
View File
@@ -691,7 +691,7 @@ import {
import {
getCurrentUnixTime,
parseDateTimeFromUnixTime,
getDayFirstUnixTimeBySpecifiedUnixTime,
getDayFirstDateTimeBySpecifiedUnixTime,
getYearMonthFirstUnixTime,
getYearMonthLastUnixTime,
getShiftedDateRangeAndDateType,
@@ -1233,7 +1233,7 @@ function changeDateFilter(dateRange: TimeRangeAndDateType | number | null): void
if (dateRange === DateRange.Custom.type || (isObject(dateRange) && dateRange.dateType === DateRange.Custom.type && !dateRange.minTime && !dateRange.maxTime)) { // Custom
if (!query.value.minTime || !query.value.maxTime) {
customMaxDatetime.value = getCurrentUnixTime();
customMinDatetime.value = getDayFirstUnixTimeBySpecifiedUnixTime(customMaxDatetime.value);
customMinDatetime.value = getDayFirstDateTimeBySpecifiedUnixTime(customMaxDatetime.value).getUnixTime();
} else {
customMaxDatetime.value = query.value.maxTime;
customMinDatetime.value = query.value.minTime;