add billing cycle date range filter

This commit is contained in:
MaysWind
2024-12-16 23:44:20 +08:00
parent 8fdbb39ee4
commit 647cd3c33f
12 changed files with 226 additions and 23 deletions
+41
View File
@@ -381,6 +381,47 @@ export const useAccountsStore = defineStore('accounts', {
return ret;
},
getAccountStatementDate(accountId) {
if (!accountId) {
return null;
}
const accountIds = accountId.split(',');
let mainAccount = null;
for (let i = 0; i < accountIds.length; i++) {
const id = accountIds[i];
let account = this.allAccountsMap[id];
if (!account) {
return null;
}
if (account.parentId !== '0') {
account = this.allAccountsMap[account.parentId];
}
if (mainAccount !== null) {
if (mainAccount.id !== account.id) {
return null;
} else {
continue;
}
}
mainAccount = account;
}
if (!mainAccount) {
return null;
}
if (mainAccount.category === accountConstants.creditCardCategoryType) {
return mainAccount.creditCardStatementDate;
}
return null;
},
getNetAssets(showAccountBalance) {
if (!showAccountBalance) {
return '***';
+1 -1
View File
@@ -825,7 +825,7 @@ export const useTransactionsStore = defineStore('transactions', {
querys.push('dateType=' + this.transactionsFilter.dateType);
if (this.transactionsFilter.dateType === datetimeConstants.allDateRanges.Custom.type) {
if (datetimeConstants.allBillingCycleDateRangesMap[this.transactionsFilter.dateType] || this.transactionsFilter.dateType === datetimeConstants.allDateRanges.Custom.type) {
querys.push('maxTime=' + this.transactionsFilter.maxTime);
querys.push('minTime=' + this.transactionsFilter.minTime);
}