From 22f9c5243aa0721b151a54dfd52f6dd543e9425f Mon Sep 17 00:00:00 2001 From: MaysWind Date: Mon, 28 Jul 2025 00:37:51 +0800 Subject: [PATCH] add reconciliation statement page for mobile version --- src/locales/de.json | 1 + src/locales/en.json | 1 + src/locales/es.json | 1 + src/locales/it.json | 1 + src/locales/ja.json | 1 + src/locales/pt_BR.json | 1 + src/locales/ru.json | 1 + src/locales/uk.json | 1 + src/locales/vi.json | 1 + src/locales/zh_Hans.json | 1 + src/locales/zh_Hant.json | 1 + src/mobile-main.ts | 2 + src/router/mobile.ts | 6 + .../ReconciliationStatementPageBase.ts | 18 +- src/views/mobile/accounts/ListPage.vue | 36 ++ .../accounts/ReconciliationStatementPage.vue | 491 ++++++++++++++++++ 16 files changed, 563 insertions(+), 1 deletion(-) create mode 100644 src/views/mobile/accounts/ReconciliationStatementPage.vue diff --git a/src/locales/de.json b/src/locales/de.json index b45b622f..2126f62a 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -1577,6 +1577,7 @@ "Savings Account": "Sparkonto", "Certificate of Deposit": "Einlagenzertifikat", "Balance": "Saldo", + "Outstanding Balance": "Outstanding Balance", "Unable to retrieve account list": "Kontoliste kann nicht abgerufen werden", "Account list is up to date": "Kontoliste ist aktuell", "Account list has been updated": "Kontoliste wurde aktualisiert", diff --git a/src/locales/en.json b/src/locales/en.json index 7c7e1f9d..099e18c1 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1577,6 +1577,7 @@ "Savings Account": "Savings Account", "Certificate of Deposit": "Certificate of Deposit", "Balance": "Balance", + "Outstanding Balance": "Outstanding Balance", "Unable to retrieve account list": "Unable to retrieve account list", "Account list is up to date": "Account list is up to date", "Account list has been updated": "Account list has been updated", diff --git a/src/locales/es.json b/src/locales/es.json index 44db578d..20c525cc 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -1577,6 +1577,7 @@ "Savings Account": "Cuenta de ahorros", "Certificate of Deposit": "Certificado de Depósito", "Balance": "Balance", + "Outstanding Balance": "Outstanding Balance", "Unable to retrieve account list": "No se puede recuperar la lista de cuentas", "Account list is up to date": "La lista de cuentas está actualizada.", "Account list has been updated": "La lista de cuentas ha sido actualizada.", diff --git a/src/locales/it.json b/src/locales/it.json index b7538f8a..6419addc 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -1577,6 +1577,7 @@ "Savings Account": "Conto di risparmio", "Certificate of Deposit": "Certificato di deposito", "Balance": "Saldo", + "Outstanding Balance": "Outstanding Balance", "Unable to retrieve account list": "Impossibile recuperare l'elenco degli account", "Account list is up to date": "Elenco account aggiornato", "Account list has been updated": "Elenco account aggiornato", diff --git a/src/locales/ja.json b/src/locales/ja.json index 2dc8ea17..f2115c82 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -1577,6 +1577,7 @@ "Savings Account": "普通預金口座", "Certificate of Deposit": "預金証書", "Balance": "残高", + "Outstanding Balance": "Outstanding Balance", "Unable to retrieve account list": "口座リストを取得できません", "Account list is up to date": "口座リストは最新です", "Account list has been updated": "口座リストが更新されました", diff --git a/src/locales/pt_BR.json b/src/locales/pt_BR.json index 1d7f55e9..f56794f6 100644 --- a/src/locales/pt_BR.json +++ b/src/locales/pt_BR.json @@ -1577,6 +1577,7 @@ "Savings Account": "Conta Poupança", "Certificate of Deposit": "Certificado de Depósito", "Balance": "Saldo", + "Outstanding Balance": "Outstanding Balance", "Unable to retrieve account list": "Não foi possível recuperar a lista de contas", "Account list is up to date": "A lista de contas está atualizada", "Account list has been updated": "A lista de contas foi atualizada", diff --git a/src/locales/ru.json b/src/locales/ru.json index 1aa73415..44c648ce 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -1577,6 +1577,7 @@ "Savings Account": "Сберегательный счет", "Certificate of Deposit": "Депозитный сертификат", "Balance": "Баланс", + "Outstanding Balance": "Outstanding Balance", "Unable to retrieve account list": "Не удается получить список счетов", "Account list is up to date": "Список счетов актуален", "Account list has been updated": "Список счетов обновлен", diff --git a/src/locales/uk.json b/src/locales/uk.json index 002fd3b9..3009c442 100644 --- a/src/locales/uk.json +++ b/src/locales/uk.json @@ -1577,6 +1577,7 @@ "Savings Account": "Ощадний рахунок", "Certificate of Deposit": "Депозитний сертифікат", "Balance": "Баланс", + "Outstanding Balance": "Outstanding Balance", "Unable to retrieve account list": "Не вдалося отримати список рахунків", "Account list is up to date": "Список рахунків актуальний", "Account list has been updated": "Список рахунків оновлено", diff --git a/src/locales/vi.json b/src/locales/vi.json index c54b7e05..45eeddc1 100644 --- a/src/locales/vi.json +++ b/src/locales/vi.json @@ -1577,6 +1577,7 @@ "Savings Account": "Tài khoản tiết kiệm", "Certificate of Deposit": "Giấy chứng nhận tiền gửi", "Balance": "Số dư", + "Outstanding Balance": "Outstanding Balance", "Unable to retrieve account list": "Không thể lấy danh sách tài khoản", "Account list is up to date": "Danh sách tài khoản đã được cập nhật", "Account list has been updated": "Danh sách tài khoản đã được cập nhật", diff --git a/src/locales/zh_Hans.json b/src/locales/zh_Hans.json index 9e3d754f..98b568a1 100644 --- a/src/locales/zh_Hans.json +++ b/src/locales/zh_Hans.json @@ -1577,6 +1577,7 @@ "Savings Account": "储蓄账户", "Certificate of Deposit": "定期存款", "Balance": "余额", + "Outstanding Balance": "未清余额", "Unable to retrieve account list": "无法获取账户列表", "Account list is up to date": "账户列表已是最新", "Account list has been updated": "账户列表已更新", diff --git a/src/locales/zh_Hant.json b/src/locales/zh_Hant.json index 2e36433f..781ce88d 100644 --- a/src/locales/zh_Hant.json +++ b/src/locales/zh_Hant.json @@ -1577,6 +1577,7 @@ "Savings Account": "儲蓄帳戶", "Certificate of Deposit": "定期存款", "Balance": "餘額", + "Outstanding Balance": "未清餘額", "Unable to retrieve account list": "無法取得帳戶清單", "Account list is up to date": "帳戶清單已是最新", "Account list has been updated": "帳戶清單已更新", diff --git a/src/mobile-main.ts b/src/mobile-main.ts index 7e303691..50eb2ade 100644 --- a/src/mobile-main.ts +++ b/src/mobile-main.ts @@ -34,6 +34,7 @@ import Framework7Skeleton from 'framework7/components/skeleton'; import Framework7Treeview from 'framework7/components/treeview'; import Framework7Typography from 'framework7/components/typography'; import Framework7Swiper from 'framework7/components/swiper'; +import Framework7VirtualList from 'framework7/components/virtual-list'; import Framework7PhotoBrowser from 'framework7/components/photo-browser'; // @ts-expect-error there is a function called "registerComponents" in the framework7-vue package, but it is not declared in the type definition file import Framework7Vue, { registerComponents } from 'framework7-vue/bundle'; @@ -155,6 +156,7 @@ Framework7.use([ Framework7Treeview, Framework7Typography, Framework7Swiper, + Framework7VirtualList, Framework7PhotoBrowser, Framework7Vue ]); diff --git a/src/router/mobile.ts b/src/router/mobile.ts index 537fd43c..8bd28013 100644 --- a/src/router/mobile.ts +++ b/src/router/mobile.ts @@ -13,6 +13,7 @@ import TransactionAmountFilterPage from '@/views/mobile/transactions/AmountFilte import AccountListPage from '@/views/mobile/accounts/ListPage.vue'; import AccountEditPage from '@/views/mobile/accounts/EditPage.vue'; +import AccountReconciliationStatementPage from '@/views/mobile/accounts/ReconciliationStatementPage.vue'; import StatisticsTransactionPage from '@/views/mobile/statistics/TransactionPage.vue'; import StatisticsSettingsPage from '@/views/mobile/statistics/SettingsPage.vue'; @@ -191,6 +192,11 @@ const routes: Router.RouteParameters[] = [ async: asyncResolve(AccountEditPage), beforeEnter: [checkLogin] }, + { + path: '/account/reconciliation_statements', + async: asyncResolve(AccountReconciliationStatementPage), + beforeEnter: [checkLogin] + }, { path: '/statistic/transaction', async: asyncResolve(StatisticsTransactionPage), diff --git a/src/views/base/transactions/ReconciliationStatementPageBase.ts b/src/views/base/transactions/ReconciliationStatementPageBase.ts index fe358f5f..f6924ecf 100644 --- a/src/views/base/transactions/ReconciliationStatementPageBase.ts +++ b/src/views/base/transactions/ReconciliationStatementPageBase.ts @@ -7,7 +7,7 @@ import { useUserStore } from '@/stores/user.ts'; import { useAccountsStore } from '@/stores/account.ts'; import { useTransactionCategoriesStore } from '@/stores/transactionCategory.ts'; -import { KnownDateTimeFormat } from '@/core/datetime.ts'; +import { type WeekDayValue, KnownDateTimeFormat } from '@/core/datetime.ts'; import { TransactionType } from '@/core/transaction.ts'; import { KnownFileType } from '@/core/file.ts'; import type { Account } from '@/models/account.ts'; @@ -32,6 +32,8 @@ export function useReconciliationStatementPageBase() { tt, getCurrentDigitGroupingSymbol, formatUnixTimeToLongDateTime, + formatUnixTimeToLongDate, + formatUnixTimeToShortTime, formatAmount, formatAmountWithCurrency } = useI18n(); @@ -48,6 +50,8 @@ export function useReconciliationStatementPageBase() { const openingBalance = ref(0); const closingBalance = ref(0); + const firstDayOfWeek = computed(() => userStore.currentUserFirstDayOfWeek); + const fiscalYearStart = computed(() => userStore.currentUserFiscalYearStart); const currentTimezoneOffsetMinutes = computed(() => getTimezoneOffsetMinutes(settingsStore.appSettings.timeZone)); const defaultCurrency = computed(() => userStore.currentUserDefaultCurrency); @@ -143,6 +147,14 @@ export function useReconciliationStatementPageBase() { return formatUnixTimeToLongDateTime(transactionTime); } + function getDisplayDate(transaction: TransactionReconciliationStatementResponseItem): string { + return formatUnixTimeToLongDate(transaction.time, transaction.utcOffset, currentTimezoneOffsetMinutes.value); + } + + function getDisplayTime(transaction: TransactionReconciliationStatementResponseItem): string { + return formatUnixTimeToShortTime(transaction.time, transaction.utcOffset, currentTimezoneOffsetMinutes.value); + } + function getDisplayTimezone(transaction: TransactionReconciliationStatementResponseItem): string { return `UTC${getUtcOffsetByUtcOffsetMinutes(transaction.utcOffset)}`; } @@ -276,6 +288,8 @@ export function useReconciliationStatementPageBase() { openingBalance, closingBalance, // computed states + firstDayOfWeek, + fiscalYearStart, currentTimezoneOffsetMinutes, defaultCurrency, currentAccount, @@ -293,6 +307,8 @@ export function useReconciliationStatementPageBase() { displayClosingBalance, // functions getDisplayDateTime, + getDisplayDate, + getDisplayTime, getDisplayTimezone, getDisplaySourceAmount, getDisplayDestinationAmount, diff --git a/src/views/mobile/accounts/ListPage.vue b/src/views/mobile/accounts/ListPage.vue index 392c465e..aae38325 100644 --- a/src/views/mobile/accounts/ListPage.vue +++ b/src/views/mobile/accounts/ListPage.vue @@ -145,6 +145,7 @@ + @@ -153,6 +154,23 @@ + + + {{ tt('Reconciliation Statement') }} + + + + {{ tt('Cancel') }} + + + {{ tt('Sort') }} @@ -219,7 +237,9 @@ const accountsStore = useAccountsStore(); const loadingError = ref(null); const sortable = ref(false); +const accountForMoreActionSheet = ref(null); const accountToDelete = ref(null); +const showAccountMoreActionSheet = ref(false); const showMoreActionSheet = ref(false); const showDeleteActionSheet = ref(false); const displayOrderSaving = ref(false); @@ -301,6 +321,22 @@ function edit(account: Account): void { props.f7router.navigate('/account/edit?id=' + account.id); } +function showMoreActionSheetForAccount(account: Account): void { + accountForMoreActionSheet.value = account; + showAccountMoreActionSheet.value = true; +} + +function showReconciliationStatement(account: Account | null): void { + if (!account) { + showAlert('An error occurred'); + return; + } + + props.f7router.navigate('/account/reconciliation_statements?accountId=' + account.id); + showAccountMoreActionSheet.value = false; + accountForMoreActionSheet.value = null; +} + function hide(account: Account, hidden: boolean): void { showLoading(); diff --git a/src/views/mobile/accounts/ReconciliationStatementPage.vue b/src/views/mobile/accounts/ReconciliationStatementPage.vue new file mode 100644 index 00000000..89ff33c8 --- /dev/null +++ b/src/views/mobile/accounts/ReconciliationStatementPage.vue @@ -0,0 +1,491 @@ + + + + +