support displaying transactions since the last reconciled time

This commit is contained in:
MaysWind
2026-05-08 00:58:04 +08:00
parent de132dd7fd
commit 75d801f775
45 changed files with 608 additions and 107 deletions
+35
View File
@@ -164,6 +164,7 @@
<f7-actions close-by-outside-click close-on-escape :opened="showAccountMoreActionSheet" @actions:closed="showAccountMoreActionSheet = false">
<f7-actions-group v-if="accountForMoreActionSheet && accountForMoreActionSheet.type === AccountType.SingleAccount.type">
<f7-actions-button @click="showReconciliationStatement(accountForMoreActionSheet)">{{ tt('Reconciliation Statement') }}</f7-actions-button>
<f7-actions-button @click="updateLastReconciledTime(accountForMoreActionSheet)" v-if="useLastReconciledTime">{{ tt('Mark as Reconciled') }}</f7-actions-button>
</f7-actions-group>
<f7-actions-group v-if="accountForMoreActionSheet && accountForMoreActionSheet.type === AccountType.SingleAccount.type">
<f7-actions-button @click="moveAllTransactions(accountForMoreActionSheet)">{{ tt('Move All Transactions') }}</f7-actions-button>
@@ -175,6 +176,7 @@
v-show="showHidden || !subAccount.hidden">
<f7-actions-label>{{ subAccount.name }}</f7-actions-label>
<f7-actions-button @click="showReconciliationStatement(subAccount)">{{ tt('Reconciliation Statement') }}</f7-actions-button>
<f7-actions-button @click="updateLastReconciledTime(subAccount)" v-if="useLastReconciledTime">{{ tt('Mark as Reconciled') }}</f7-actions-button>
<f7-actions-button @click="moveAllTransactions(subAccount)">{{ tt('Move All Transactions') }}</f7-actions-button>
<f7-actions-button color="red" @click="showPasswordSheetForClearAllTransaction(subAccount)">{{ tt('Clear All Transactions') }}</f7-actions-button>
</f7-actions-group>
@@ -235,6 +237,7 @@ import { TextDirection } from '@/core/text.ts';
import { AccountType, AccountCategory } from '@/core/account.ts';
import type { Account, AccountShowingIds } from '@/models/account.ts';
import { getCurrentUnixTime } from '@/lib/datetime.ts';
import { onSwipeoutDeleted } from '@/lib/ui/mobile.ts';
const props = defineProps<{
@@ -250,6 +253,7 @@ const {
displayOrderModified,
showAccountBalance,
customAccountCategoryOrder,
useLastReconciledTime,
allCategorizedAccountsMap,
allAccountCount,
maxCategoryAccountCount,
@@ -269,6 +273,7 @@ const accountForMoreActionSheet = ref<Account | null>(null);
const accountToDelete = ref<Account | null>(null);
const accountToClearTransactions = ref<Account | null>(null);
const currentPasswordForClearData = ref<string>('');
const updatingLastReconciledTime = ref<boolean>(false);
const clearingData = ref<boolean>(false);
const showAccountMoreActionSheet = ref<boolean>(false);
const showMoreActionSheet = ref<boolean>(false);
@@ -370,6 +375,36 @@ function showReconciliationStatement(account: Account | null): void {
accountForMoreActionSheet.value = null;
}
function updateLastReconciledTime(account: Account | null): void {
if (!account) {
showAlert('An error occurred');
return;
}
updatingLastReconciledTime.value = true;
showLoading(() => updatingLastReconciledTime.value);
accountsStore.updateAccountLastReconciledTime(account.id, getCurrentUnixTime()).then(() => {
updatingLastReconciledTime.value = false;
hideLoading();
showToast('Last reconciled time have been updated');
if (accountsStore.accountListStateInvalid && !loading.value) {
reload();
}
}).catch(error => {
updatingLastReconciledTime.value = false;
hideLoading();
if (!error.processed) {
showToast(error.message || error);
}
});
showAccountMoreActionSheet.value = false;
accountForMoreActionSheet.value = null;
}
function moveAllTransactions(account: Account | null): void {
if (!account) {
showAlert('An error occurred');