@@ -270,8 +270,8 @@
@@ -347,8 +347,8 @@
- {{ getDisplayAmount(transaction.sourceAmount, transaction.sourceAccount.currency, transaction.hideAmount) }}
- {{ getDisplayAmount(transaction.destinationAmount, transaction.destinationAccount.currency, transaction.hideAmount) }}
+ {{ getDisplayAmount(transaction.sourceAmount, transaction.sourceAccount.currency, transaction.hideAmount) }}
+ {{ getDisplayAmount(transaction.destinationAmount, transaction.destinationAccount.currency, transaction.hideAmount) }}
|
@@ -404,7 +404,6 @@ import { useTransactionsStore } from '@/stores/transaction.js';
import numeralConstants from '@/consts/numeral.js';
import datetimeConstants from '@/consts/datetime.js';
-import currencyConstants from '@/consts/currency.js';
import accountConstants from '@/consts/account.js';
import transactionConstants from '@/consts/transaction.js';
import { isString, getNameByKeyValue } from '@/lib/common.js';
@@ -431,6 +430,7 @@ import {
categoryTypeToTransactionType,
transactionTypeToCategoryType
} from '@/lib/category.js';
+import { getUnifiedSelectedAccountsCurrencyOrDefaultCurrency } from '@/lib/account.js';
import { scrollToSelectedItem } from '@/lib/ui.desktop.js';
import {
@@ -499,19 +499,15 @@ export default {
computed: {
...mapStores(useSettingsStore, useUserStore, useAccountsStore, useTransactionCategoriesStore, useTransactionsStore),
defaultCurrency() {
- if (this.query.accountId && this.query.accountId !== '0') {
- const account = this.allAccounts[this.query.accountId];
-
- if (account && account.currency && account.currency !== currencyConstants.parentAccountCurrencyPlaceholder) {
- return account.currency;
- }
- }
-
- return this.userStore.currentUserDefaultCurrency;
+ return getUnifiedSelectedAccountsCurrencyOrDefaultCurrency(this.allAccounts, this.queryAllFilterAccountIds, this.userStore.currentUserDefaultCurrency);
},
canAddTransaction() {
- if (this.query.accountId && this.query.accountId !== '0') {
- const account = this.allAccounts[this.query.accountId];
+ if (this.queryAllFilterCategoryIdsCount > 1 || this.queryAllFilterAccountIdsCount > 1) {
+ return false;
+ }
+
+ if (this.query.accountIds) {
+ const account = this.allAccounts[this.query.accountIds];
if (account && account.type === accountConstants.allAccountTypes.MultiSubAccounts) {
return false;
@@ -547,11 +543,31 @@ export default {
queryMaxTime() {
return this.$locale.formatUnixTimeToLongDateTime(this.userStore, this.query.maxTime);
},
+ queryAllFilterCategoryIds() {
+ return this.transactionsStore.allFilterCategoryIds;
+ },
+ queryAllFilterAccountIds() {
+ return this.transactionsStore.allFilterAccountIds;
+ },
+ queryAllFilterCategoryIdsCount() {
+ return this.transactionsStore.allFilterCategoryIdsCount;
+ },
+ queryAllFilterAccountIdsCount() {
+ return this.transactionsStore.allFilterAccountIdsCount;
+ },
queryCategoryName() {
- return getNameByKeyValue(this.allCategories, this.query.categoryId, null, 'name', this.$t('Category'));
+ if (this.queryAllFilterCategoryIdsCount > 1) {
+ return this.$t('Multiple Categories');
+ }
+
+ return getNameByKeyValue(this.allCategories, this.query.categoryIds, null, 'name', this.$t('Category'));
},
queryAccountName() {
- return getNameByKeyValue(this.allAccounts, this.query.accountId, null, 'name', this.$t('Account'));
+ if (this.queryAllFilterAccountIdsCount > 1) {
+ return this.$t('Multiple Accounts');
+ }
+
+ return getNameByKeyValue(this.allAccounts, this.query.accountIds, null, 'name', this.$t('Account'));
},
queryAmount() {
if (!this.query.amountFilter) {
@@ -769,8 +785,8 @@ export default {
maxTime: dateRange ? dateRange.maxTime : undefined,
minTime: dateRange ? dateRange.minTime : undefined,
type: parseInt(query.type) > 0 ? parseInt(query.type) : undefined,
- categoryId: query.categoryIds,
- accountId: query.accountIds,
+ categoryIds: query.categoryIds,
+ accountIds: query.accountIds,
amountFilter: query.amountFilter || '',
keyword: query.keyword || ''
});
@@ -912,17 +928,24 @@ export default {
changeTypeFilter(type) {
let removeCategoryFilter = false;
- if (type && this.query.categoryId) {
- const category = this.allCategories[this.query.categoryId];
+ if (type && this.query.categoryIds) {
+ for (let categoryId in this.queryAllFilterCategoryIds) {
+ if (!Object.prototype.hasOwnProperty.call(this.queryAllFilterCategoryIds, categoryId)) {
+ continue;
+ }
+
+ const category = this.allCategories[categoryId];
- if (category && category.type !== transactionTypeToCategoryType(type)) {
- removeCategoryFilter = true;
+ if (category && category.type !== transactionTypeToCategoryType(type)) {
+ removeCategoryFilter = true;
+ break;
+ }
}
}
this.transactionsStore.updateTransactionListFilter({
type: type,
- categoryId: removeCategoryFilter ? '0' : undefined
+ categoryIds: removeCategoryFilter ? '' : undefined
});
this.loading = true;
@@ -930,15 +953,15 @@ export default {
this.transactionsStore.clearTransactions();
this.$router.push(this.getFilterLinkUrl());
},
- changeCategoryFilter(categoryId) {
+ changeCategoryFilter(categoryIds) {
this.categoryMenuState = false;
- if (this.query.categoryId === categoryId) {
+ if (this.query.categoryIds === categoryIds) {
return;
}
this.transactionsStore.updateTransactionListFilter({
- categoryId: categoryId
+ categoryIds: categoryIds
});
this.loading = true;
@@ -990,13 +1013,13 @@ export default {
this.transactionsStore.clearTransactions();
this.$router.push(this.getFilterLinkUrl());
},
- changeAccountFilter(accountId) {
- if (this.query.accountId === accountId) {
+ changeAccountFilter(accountIds) {
+ if (this.query.accountIds === accountIds) {
return;
}
this.transactionsStore.updateTransactionListFilter({
- accountId: accountId
+ accountIds: accountIds
});
this.loading = true;
@@ -1023,8 +1046,8 @@ export default {
self.$refs.editDialog.open({
type: self.query.type,
- categoryId: self.query.categoryId,
- accountId: self.query.accountId
+ categoryId: self.query.categoryIds,
+ accountId: self.query.accountIds
}).then(result => {
if (result && result.message) {
self.$refs.snackbar.showMessage(result.message);
@@ -1149,8 +1172,8 @@ export default {
getTransactionTypeFromCategoryType(categoryType) {
return categoryTypeToTransactionType(parseInt(categoryType));
},
- getCategoryListItemCheckedClass(category, queryCategoryId) {
- if (category.id === queryCategoryId) {
+ getCategoryListItemCheckedClass(category, queryCategoryIds) {
+ if (queryCategoryIds && queryCategoryIds[category.id]) {
return {
'list-item-selected': true,
'has-children-item-selected': true
@@ -1158,7 +1181,7 @@ export default {
}
for (let i = 0; i < category.subCategories.length; i++) {
- if (category.subCategories[i].id === queryCategoryId) {
+ if (queryCategoryIds && queryCategoryIds[category.subCategories[i].id]) {
return {
'list-item-selected': true,
'has-children-item-selected': true
diff --git a/src/views/mobile/transactions/ListPage.vue b/src/views/mobile/transactions/ListPage.vue
index 0c85c9fc..1535bded 100644
--- a/src/views/mobile/transactions/ListPage.vue
+++ b/src/views/mobile/transactions/ListPage.vue
@@ -11,7 +11,7 @@
-
+
@@ -36,10 +36,10 @@
- {{ queryCategoryName }}
+ {{ queryCategoryName }}
- {{ queryAccountName }}
+ {{ queryAccountName }}
@@ -200,8 +200,8 @@
- {{ getDisplayAmount(transaction.sourceAmount, transaction.sourceAccount.currency, transaction.hideAmount) }}
- {{ getDisplayAmount(transaction.destinationAmount, transaction.destinationAccount.currency, transaction.hideAmount) }}
+ {{ getDisplayAmount(transaction.sourceAmount, transaction.sourceAccount.currency, transaction.hideAmount) }}
+ {{ getDisplayAmount(transaction.destinationAmount, transaction.destinationAccount.currency, transaction.hideAmount) }}
@@ -284,12 +284,12 @@
v-model:opened="showCategoryPopover"
@popover:open="scrollPopoverToSelectedItem">
-
+
-
+
@@ -301,7 +301,7 @@
-
+
-
+
+ v-if="query.categoryIds === subCategory.id">
@@ -346,16 +346,16 @@
v-model:opened="showAccountPopover"
@popover:open="scrollPopoverToSelectedItem">
-
+
-
+
+ v-if="query.accountIds === account.id">
@@ -445,7 +445,6 @@ import { useTransactionsStore } from '@/stores/transaction.js';
import numeralConstants from '@/consts/numeral.js';
import datetimeConstants from '@/consts/datetime.js';
-import currencyConstants from '@/consts/currency.js';
import accountConstants from '@/consts/account.js';
import transactionConstants from '@/consts/transaction.js';
import { getNameByKeyValue } from '@/lib/common.js';
@@ -461,6 +460,7 @@ import {
getDateRangeByDateType
} from '@/lib/datetime.js';
import { categoryTypeToTransactionType, transactionTypeToCategoryType } from '@/lib/category.js';
+import { getUnifiedSelectedAccountsCurrencyOrDefaultCurrency } from '@/lib/account.js';
import { onSwipeoutDeleted, scrollToSelectedItem } from '@/lib/ui.mobile.js';
export default {
@@ -487,19 +487,15 @@ export default {
computed: {
...mapStores(useSettingsStore, useUserStore, useAccountsStore, useTransactionCategoriesStore, useTransactionsStore),
defaultCurrency() {
- if (this.query.accountId && this.query.accountId !== '0') {
- const account = this.allAccounts[this.query.accountId];
-
- if (account && account.currency && account.currency !== currencyConstants.parentAccountCurrencyPlaceholder) {
- return account.currency;
- }
- }
-
- return this.userStore.currentUserDefaultCurrency;
+ return getUnifiedSelectedAccountsCurrencyOrDefaultCurrency(this.allAccounts, this.queryAllFilterAccountIds, this.userStore.currentUserDefaultCurrency);
},
canAddTransaction() {
- if (this.query.accountId && this.query.accountId !== '0') {
- const account = this.allAccounts[this.query.accountId];
+ if (this.queryAllFilterCategoryIdsCount > 1 || this.queryAllFilterAccountIdsCount > 1) {
+ return false;
+ }
+
+ if (this.query.accountIds) {
+ const account = this.allAccounts[this.query.accountIds];
if (account && account.type === accountConstants.allAccountTypes.MultiSubAccounts) {
return false;
@@ -530,11 +526,31 @@ export default {
queryMaxTime() {
return this.$locale.formatUnixTimeToLongDateTime(this.userStore, this.query.maxTime);
},
+ queryAllFilterCategoryIds() {
+ return this.transactionsStore.allFilterCategoryIds;
+ },
+ queryAllFilterAccountIds() {
+ return this.transactionsStore.allFilterAccountIds;
+ },
+ queryAllFilterCategoryIdsCount() {
+ return this.transactionsStore.allFilterCategoryIdsCount;
+ },
+ queryAllFilterAccountIdsCount() {
+ return this.transactionsStore.allFilterAccountIdsCount;
+ },
queryCategoryName() {
- return getNameByKeyValue(this.allCategories, this.query.categoryId, null, 'name', this.$t('Category'));
+ if (this.queryAllFilterCategoryIdsCount > 1) {
+ return this.$t('Multiple Categories');
+ }
+
+ return getNameByKeyValue(this.allCategories, this.query.categoryIds, null, 'name', this.$t('Category'));
},
queryAccountName() {
- return getNameByKeyValue(this.allAccounts, this.query.accountId, null, 'name', this.$t('Account'));
+ if (this.queryAllFilterAccountIdsCount > 1) {
+ return this.$t('Multiple Accounts');
+ }
+
+ return getNameByKeyValue(this.allAccounts, this.query.accountIds, null, 'name', this.$t('Account'));
},
queryAmount() {
if (!this.query.amountFilter) {
@@ -628,8 +644,8 @@ export default {
maxTime: dateRange ? dateRange.maxTime : undefined,
minTime: dateRange ? dateRange.minTime : undefined,
type: parseInt(query.type) > 0 ? parseInt(query.type) : undefined,
- categoryId: query.categoryId,
- accountId: query.accountId
+ categoryIds: query.categoryIds,
+ accountIds: query.accountIds
});
this.reload(null);
@@ -777,41 +793,48 @@ export default {
let removeCategoryFilter = false;
- if (type && this.query.categoryId) {
- const category = this.allCategories[this.query.categoryId];
+ if (type && this.query.categoryIds) {
+ for (let categoryId in this.queryAllFilterCategoryIds) {
+ if (!Object.prototype.hasOwnProperty.call(this.queryAllFilterCategoryIds, categoryId)) {
+ continue;
+ }
+
+ const category = this.allCategories[categoryId];
- if (category && category.type !== transactionTypeToCategoryType(type)) {
- removeCategoryFilter = true;
+ if (category && category.type !== transactionTypeToCategoryType(type)) {
+ removeCategoryFilter = true;
+ break;
+ }
}
}
this.transactionsStore.updateTransactionListFilter({
type: type,
- categoryId: removeCategoryFilter ? '0' : undefined
+ categoryIds: removeCategoryFilter ? '' : undefined
});
this.showMorePopover = false;
this.reload(null);
},
- changeCategoryFilter(categoryId) {
- if (this.query.categoryId === categoryId) {
+ changeCategoryFilter(categoryIds) {
+ if (this.query.categoryIds === categoryIds) {
return;
}
this.transactionsStore.updateTransactionListFilter({
- categoryId: categoryId
+ categoryIds: categoryIds
});
this.showCategoryPopover = false;
this.reload(null);
},
- changeAccountFilter(accountId) {
- if (this.query.accountId === accountId) {
+ changeAccountFilter(accountIds) {
+ if (this.query.accountIds === accountIds) {
return;
}
this.transactionsStore.updateTransactionListFilter({
- accountId: accountId
+ accountIds: accountIds
});
this.showAccountPopover = false;
@@ -959,15 +982,15 @@ export default {
color: 'transparent'
}
},
- getCategoryListItemCheckedClass(category, queryCategoryId) {
- if (category.id === queryCategoryId) {
+ getCategoryListItemCheckedClass(category, queryCategoryIds) {
+ if (queryCategoryIds && queryCategoryIds[category.id]) {
return {
'list-item-checked': true
};
}
for (let i = 0; i < category.subCategories.length; i++) {
- if (category.subCategories[i].id === queryCategoryId) {
+ if (queryCategoryIds && queryCategoryIds[category.subCategories[i].id]) {
return {
'list-item-checked': true
};