mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
add billing cycle date range filter
This commit is contained in:
@@ -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 '***';
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user