mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-21 02:04:26 +08:00
code refactor
This commit is contained in:
+3
-3
@@ -146,17 +146,17 @@ export function getCategorizedAccounts(allAccounts) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCategorizedAccountsWithVisibleCount(categorizedAccounts) {
|
export function getCategorizedAccountsWithVisibleCount(categorizedAccountsMap) {
|
||||||
const ret = [];
|
const ret = [];
|
||||||
|
|
||||||
for (let i = 0; i < accountConstants.allCategories.length; i++) {
|
for (let i = 0; i < accountConstants.allCategories.length; i++) {
|
||||||
const accountCategory = accountConstants.allCategories[i];
|
const accountCategory = accountConstants.allCategories[i];
|
||||||
|
|
||||||
if (!categorizedAccounts[accountCategory.id] || !categorizedAccounts[accountCategory.id].accounts) {
|
if (!categorizedAccountsMap[accountCategory.id] || !categorizedAccountsMap[accountCategory.id].accounts) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const allAccounts = categorizedAccounts[accountCategory.id].accounts;
|
const allAccounts = categorizedAccountsMap[accountCategory.id].accounts;
|
||||||
const allSubAccounts = {};
|
const allSubAccounts = {};
|
||||||
const allVisibleSubAccountCounts = {};
|
const allVisibleSubAccountCounts = {};
|
||||||
const allFirstVisibleSubAccountIndexes = {};
|
const allFirstVisibleSubAccountIndexes = {};
|
||||||
|
|||||||
+41
-41
@@ -28,7 +28,7 @@ function loadAccountList(state, accounts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state.allCategorizedAccounts = getCategorizedAccountsMap(accounts);
|
state.allCategorizedAccountsMap = getCategorizedAccountsMap(accounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addAccountToAccountList(state, account) {
|
function addAccountToAccountList(state, account) {
|
||||||
@@ -52,11 +52,11 @@ function addAccountToAccountList(state, account) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.allCategorizedAccounts[account.category]) {
|
if (state.allCategorizedAccountsMap[account.category]) {
|
||||||
const accountList = state.allCategorizedAccounts[account.category].accounts;
|
const accountList = state.allCategorizedAccountsMap[account.category].accounts;
|
||||||
accountList.push(account);
|
accountList.push(account);
|
||||||
} else {
|
} else {
|
||||||
state.allCategorizedAccounts = getCategorizedAccountsMap(state.allAccounts);
|
state.allCategorizedAccountsMap = getCategorizedAccountsMap(state.allAccounts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,8 +77,8 @@ function updateAccountToAccountList(state, account) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.allCategorizedAccounts[account.category]) {
|
if (state.allCategorizedAccountsMap[account.category]) {
|
||||||
const accountList = state.allCategorizedAccounts[account.category].accounts;
|
const accountList = state.allCategorizedAccountsMap[account.category].accounts;
|
||||||
|
|
||||||
for (let i = 0; i < accountList.length; i++) {
|
for (let i = 0; i < accountList.length; i++) {
|
||||||
if (accountList[i].id === account.id) {
|
if (accountList[i].id === account.id) {
|
||||||
@@ -93,8 +93,8 @@ function updateAccountDisplayOrderInAccountList(state, { account, from, to, upda
|
|||||||
let fromAccount = null;
|
let fromAccount = null;
|
||||||
let toAccount = null;
|
let toAccount = null;
|
||||||
|
|
||||||
if (state.allCategorizedAccounts[account.category]) {
|
if (state.allCategorizedAccountsMap[account.category]) {
|
||||||
const accountList = state.allCategorizedAccounts[account.category].accounts;
|
const accountList = state.allCategorizedAccountsMap[account.category].accounts;
|
||||||
|
|
||||||
if (updateListOrder) {
|
if (updateListOrder) {
|
||||||
fromAccount = accountList[from];
|
fromAccount = accountList[from];
|
||||||
@@ -158,8 +158,8 @@ function removeAccountFromAccountList(state, account) {
|
|||||||
delete state.allAccountsMap[account.id];
|
delete state.allAccountsMap[account.id];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.allCategorizedAccounts[account.category]) {
|
if (state.allCategorizedAccountsMap[account.category]) {
|
||||||
const accountList = state.allCategorizedAccounts[account.category].accounts;
|
const accountList = state.allCategorizedAccountsMap[account.category].accounts;
|
||||||
|
|
||||||
for (let i = 0; i < accountList.length; i++) {
|
for (let i = 0; i < accountList.length; i++) {
|
||||||
if (accountList[i].id === account.id) {
|
if (accountList[i].id === account.id) {
|
||||||
@@ -174,7 +174,7 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
state: () => ({
|
state: () => ({
|
||||||
allAccounts: [],
|
allAccounts: [],
|
||||||
allAccountsMap: {},
|
allAccountsMap: {},
|
||||||
allCategorizedAccounts: {},
|
allCategorizedAccountsMap: {},
|
||||||
accountListStateInvalid: true,
|
accountListStateInvalid: true,
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
@@ -221,12 +221,12 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
allAvailableAccountsCount(state) {
|
allAvailableAccountsCount(state) {
|
||||||
let allAccountCount = 0;
|
let allAccountCount = 0;
|
||||||
|
|
||||||
for (let category in state.allCategorizedAccounts) {
|
for (let category in state.allCategorizedAccountsMap) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(state.allCategorizedAccounts, category)) {
|
if (!Object.prototype.hasOwnProperty.call(state.allCategorizedAccountsMap, category)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
allAccountCount += state.allCategorizedAccounts[category].accounts.length;
|
allAccountCount += state.allCategorizedAccountsMap[category].accounts.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
return allAccountCount;
|
return allAccountCount;
|
||||||
@@ -234,12 +234,12 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
allVisibleAccountsCount(state) {
|
allVisibleAccountsCount(state) {
|
||||||
let shownAccountCount = 0;
|
let shownAccountCount = 0;
|
||||||
|
|
||||||
for (let category in state.allCategorizedAccounts) {
|
for (let category in state.allCategorizedAccountsMap) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(state.allCategorizedAccounts, category)) {
|
if (!Object.prototype.hasOwnProperty.call(state.allCategorizedAccountsMap, category)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const accountList = state.allCategorizedAccounts[category].accounts;
|
const accountList = state.allCategorizedAccountsMap[category].accounts;
|
||||||
|
|
||||||
for (let i = 0; i < accountList.length; i++) {
|
for (let i = 0; i < accountList.length; i++) {
|
||||||
if (!accountList[i].hidden) {
|
if (!accountList[i].hidden) {
|
||||||
@@ -288,7 +288,7 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
resetAccounts() {
|
resetAccounts() {
|
||||||
this.allAccounts = [];
|
this.allAccounts = [];
|
||||||
this.allAccountsMap = {};
|
this.allAccountsMap = {};
|
||||||
this.allCategorizedAccounts = {};
|
this.allCategorizedAccountsMap = {};
|
||||||
this.accountListStateInvalid = true;
|
this.accountListStateInvalid = true;
|
||||||
},
|
},
|
||||||
getFirstShowingIds(showHidden) {
|
getFirstShowingIds(showHidden) {
|
||||||
@@ -297,16 +297,16 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
subAccounts: {}
|
subAccounts: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (let category in this.allCategorizedAccounts) {
|
for (let category in this.allCategorizedAccountsMap) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(this.allCategorizedAccounts, category)) {
|
if (!Object.prototype.hasOwnProperty.call(this.allCategorizedAccountsMap, category)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.allCategorizedAccounts[category] || !this.allCategorizedAccounts[category].accounts) {
|
if (!this.allCategorizedAccountsMap[category] || !this.allCategorizedAccountsMap[category].accounts) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const accounts = this.allCategorizedAccounts[category].accounts;
|
const accounts = this.allCategorizedAccountsMap[category].accounts;
|
||||||
|
|
||||||
for (let i = 0; i < accounts.length; i++) {
|
for (let i = 0; i < accounts.length; i++) {
|
||||||
const account = accounts[i];
|
const account = accounts[i];
|
||||||
@@ -337,16 +337,16 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
subAccounts: {}
|
subAccounts: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (let category in this.allCategorizedAccounts) {
|
for (let category in this.allCategorizedAccountsMap) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(this.allCategorizedAccounts, category)) {
|
if (!Object.prototype.hasOwnProperty.call(this.allCategorizedAccountsMap, category)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.allCategorizedAccounts[category] || !this.allCategorizedAccounts[category].accounts) {
|
if (!this.allCategorizedAccountsMap[category] || !this.allCategorizedAccountsMap[category].accounts) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const accounts = this.allCategorizedAccounts[category].accounts;
|
const accounts = this.allCategorizedAccountsMap[category].accounts;
|
||||||
|
|
||||||
for (let i = accounts.length - 1; i >= 0; i--) {
|
for (let i = accounts.length - 1; i >= 0; i--) {
|
||||||
const account = accounts[i];
|
const account = accounts[i];
|
||||||
@@ -378,7 +378,7 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const exchangeRatesStore = useExchangeRatesStore();
|
const exchangeRatesStore = useExchangeRatesStore();
|
||||||
const accountsBalance = getAllFilteredAccountsBalance(this.allCategorizedAccounts, () => true);
|
const accountsBalance = getAllFilteredAccountsBalance(this.allCategorizedAccountsMap, () => true);
|
||||||
let netAssets = 0;
|
let netAssets = 0;
|
||||||
let hasUnCalculatedAmount = false;
|
let hasUnCalculatedAmount = false;
|
||||||
|
|
||||||
@@ -410,7 +410,7 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const exchangeRatesStore = useExchangeRatesStore();
|
const exchangeRatesStore = useExchangeRatesStore();
|
||||||
const accountsBalance = getAllFilteredAccountsBalance(this.allCategorizedAccounts, account => account.isAsset);
|
const accountsBalance = getAllFilteredAccountsBalance(this.allCategorizedAccountsMap, account => account.isAsset);
|
||||||
let totalAssets = 0;
|
let totalAssets = 0;
|
||||||
let hasUnCalculatedAmount = false;
|
let hasUnCalculatedAmount = false;
|
||||||
|
|
||||||
@@ -442,7 +442,7 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const exchangeRatesStore = useExchangeRatesStore();
|
const exchangeRatesStore = useExchangeRatesStore();
|
||||||
const accountsBalance = getAllFilteredAccountsBalance(this.allCategorizedAccounts, account => account.isLiability);
|
const accountsBalance = getAllFilteredAccountsBalance(this.allCategorizedAccountsMap, account => account.isLiability);
|
||||||
let totalLiabilities = 0;
|
let totalLiabilities = 0;
|
||||||
let hasUnCalculatedAmount = false;
|
let hasUnCalculatedAmount = false;
|
||||||
|
|
||||||
@@ -474,7 +474,7 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const exchangeRatesStore = useExchangeRatesStore();
|
const exchangeRatesStore = useExchangeRatesStore();
|
||||||
const accountsBalance = getAllFilteredAccountsBalance(this.allCategorizedAccounts, account => account.category === accountCategory.id);
|
const accountsBalance = getAllFilteredAccountsBalance(this.allCategorizedAccountsMap, account => account.category === accountCategory.id);
|
||||||
let totalBalance = 0;
|
let totalBalance = 0;
|
||||||
let hasUnCalculatedAmount = false;
|
let hasUnCalculatedAmount = false;
|
||||||
|
|
||||||
@@ -630,16 +630,16 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
hasAccount(accountCategory, visibleOnly) {
|
hasAccount(accountCategory, visibleOnly) {
|
||||||
if (!this.allCategorizedAccounts[accountCategory.id] ||
|
if (!this.allCategorizedAccountsMap[accountCategory.id] ||
|
||||||
!this.allCategorizedAccounts[accountCategory.id].accounts ||
|
!this.allCategorizedAccountsMap[accountCategory.id].accounts ||
|
||||||
!this.allCategorizedAccounts[accountCategory.id].accounts.length) {
|
!this.allCategorizedAccountsMap[accountCategory.id].accounts.length) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let shownCount = 0;
|
let shownCount = 0;
|
||||||
|
|
||||||
for (let i = 0; i < this.allCategorizedAccounts[accountCategory.id].accounts.length; i++) {
|
for (let i = 0; i < this.allCategorizedAccountsMap[accountCategory.id].accounts.length; i++) {
|
||||||
const account = this.allCategorizedAccounts[accountCategory.id].accounts[i];
|
const account = this.allCategorizedAccountsMap[accountCategory.id].accounts[i];
|
||||||
|
|
||||||
if (!visibleOnly || !account.hidden) {
|
if (!visibleOnly || !account.hidden) {
|
||||||
shownCount++;
|
shownCount++;
|
||||||
@@ -842,9 +842,9 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!account ||
|
if (!account ||
|
||||||
!self.allCategorizedAccounts[account.category] ||
|
!self.allCategorizedAccountsMap[account.category] ||
|
||||||
!self.allCategorizedAccounts[account.category].accounts ||
|
!self.allCategorizedAccountsMap[account.category].accounts ||
|
||||||
!self.allCategorizedAccounts[account.category].accounts[to]) {
|
!self.allCategorizedAccountsMap[account.category].accounts[to]) {
|
||||||
reject({ message: 'Unable to move account' });
|
reject({ message: 'Unable to move account' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -868,12 +868,12 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
const self = this;
|
const self = this;
|
||||||
const newDisplayOrders = [];
|
const newDisplayOrders = [];
|
||||||
|
|
||||||
for (let category in self.allCategorizedAccounts) {
|
for (let category in self.allCategorizedAccountsMap) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(self.allCategorizedAccounts, category)) {
|
if (!Object.prototype.hasOwnProperty.call(self.allCategorizedAccountsMap, category)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const accountList = self.allCategorizedAccounts[category].accounts;
|
const accountList = self.allCategorizedAccountsMap[category].accounts;
|
||||||
|
|
||||||
for (let i = 0; i < accountList.length; i++) {
|
for (let i = 0; i < accountList.length; i++) {
|
||||||
newDisplayOrders.push({
|
newDisplayOrders.push({
|
||||||
|
|||||||
@@ -146,8 +146,8 @@
|
|||||||
handle=".drag-handle"
|
handle=".drag-handle"
|
||||||
ghost-class="dragging-item"
|
ghost-class="dragging-item"
|
||||||
:disabled="activeAccountCategoryVisibleAccountCount <= 1"
|
:disabled="activeAccountCategoryVisibleAccountCount <= 1"
|
||||||
:list="categorizedAccounts[activeAccountCategory.id].accounts"
|
:list="allCategorizedAccountsMap[activeAccountCategory.id].accounts"
|
||||||
v-if="categorizedAccounts[activeAccountCategory.id] && categorizedAccounts[activeAccountCategory.id].accounts && categorizedAccounts[activeAccountCategory.id].accounts.length"
|
v-if="allCategorizedAccountsMap[activeAccountCategory.id] && allCategorizedAccountsMap[activeAccountCategory.id].accounts && allCategorizedAccountsMap[activeAccountCategory.id].accounts.length"
|
||||||
@change="onMove"
|
@change="onMove"
|
||||||
>
|
>
|
||||||
<template #item="{ element }">
|
<template #item="{ element }">
|
||||||
@@ -330,8 +330,8 @@ export default {
|
|||||||
allAccountCategories() {
|
allAccountCategories() {
|
||||||
return accountConstants.allCategories;
|
return accountConstants.allCategories;
|
||||||
},
|
},
|
||||||
categorizedAccounts() {
|
allCategorizedAccountsMap() {
|
||||||
return this.accountsStore.allCategorizedAccounts;
|
return this.accountsStore.allCategorizedAccountsMap;
|
||||||
},
|
},
|
||||||
allAccountCount() {
|
allAccountCount() {
|
||||||
return this.accountsStore.allAvailableAccountsCount;
|
return this.accountsStore.allAvailableAccountsCount;
|
||||||
@@ -355,11 +355,11 @@ export default {
|
|||||||
return this.accountCategoryTotalBalance(this.activeAccountCategory);
|
return this.accountCategoryTotalBalance(this.activeAccountCategory);
|
||||||
},
|
},
|
||||||
activeAccountCategoryVisibleAccountCount() {
|
activeAccountCategoryVisibleAccountCount() {
|
||||||
if (!this.categorizedAccounts[this.activeAccountCategory.id] || !this.categorizedAccounts[this.activeAccountCategory.id].accounts) {
|
if (!this.allCategorizedAccountsMap[this.activeAccountCategory.id] || !this.allCategorizedAccountsMap[this.activeAccountCategory.id].accounts) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const accounts = this.categorizedAccounts[this.activeAccountCategory.id].accounts;
|
const accounts = this.allCategorizedAccountsMap[this.activeAccountCategory.id].accounts;
|
||||||
|
|
||||||
if (this.showHidden) {
|
if (this.showHidden) {
|
||||||
return accounts.length;
|
return accounts.length;
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ export default {
|
|||||||
return accountConstants.allAccountTypes;
|
return accountConstants.allAccountTypes;
|
||||||
},
|
},
|
||||||
allCategorizedAccounts() {
|
allCategorizedAccounts() {
|
||||||
return getCategorizedAccountsWithVisibleCount(this.accountsStore.allCategorizedAccounts);
|
return getCategorizedAccountsWithVisibleCount(this.accountsStore.allCategorizedAccountsMap);
|
||||||
},
|
},
|
||||||
hasAnyAvailableAccount() {
|
hasAnyAvailableAccount() {
|
||||||
return this.accountsStore.allAvailableAccountsCount > 0;
|
return this.accountsStore.allAvailableAccountsCount > 0;
|
||||||
|
|||||||
@@ -168,7 +168,7 @@
|
|||||||
:custom-selection-primary-text="sourceAccountName"
|
:custom-selection-primary-text="sourceAccountName"
|
||||||
:label="$t(sourceAccountTitle)"
|
:label="$t(sourceAccountTitle)"
|
||||||
:placeholder="$t(sourceAccountTitle)"
|
:placeholder="$t(sourceAccountTitle)"
|
||||||
:items="categorizedAccounts"
|
:items="allVisibleCategorizedAccounts"
|
||||||
v-model="transaction.sourceAccountId">
|
v-model="transaction.sourceAccountId">
|
||||||
</two-column-select>
|
</two-column-select>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -186,7 +186,7 @@
|
|||||||
:custom-selection-primary-text="destinationAccountName"
|
:custom-selection-primary-text="destinationAccountName"
|
||||||
:label="$t('Destination Account')"
|
:label="$t('Destination Account')"
|
||||||
:placeholder="$t('Destination Account')"
|
:placeholder="$t('Destination Account')"
|
||||||
:items="categorizedAccounts"
|
:items="allVisibleCategorizedAccounts"
|
||||||
v-model="transaction.destinationAccountId">
|
v-model="transaction.destinationAccountId">
|
||||||
</two-column-select>
|
</two-column-select>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -576,7 +576,7 @@ export default {
|
|||||||
allVisibleAccounts() {
|
allVisibleAccounts() {
|
||||||
return this.accountsStore.allVisiblePlainAccounts;
|
return this.accountsStore.allVisiblePlainAccounts;
|
||||||
},
|
},
|
||||||
categorizedAccounts() {
|
allVisibleCategorizedAccounts() {
|
||||||
return this.$locale.getCategorizedAccountsWithDisplayBalance(this.allVisibleAccounts, this.showAccountBalance, this.defaultCurrency, this.settingsStore, this.userStore, this.exchangeRatesStore);
|
return this.$locale.getCategorizedAccountsWithDisplayBalance(this.allVisibleAccounts, this.showAccountBalance, this.defaultCurrency, this.settingsStore, this.userStore, this.exchangeRatesStore);
|
||||||
},
|
},
|
||||||
allAccountsMap() {
|
allAccountsMap() {
|
||||||
|
|||||||
@@ -224,7 +224,7 @@
|
|||||||
:disabled="loading || submitting || !allVisibleAccounts.length"
|
:disabled="loading || submitting || !allVisibleAccounts.length"
|
||||||
:custom-selection-primary-text="getSourceAccountDisplayName(item)"
|
:custom-selection-primary-text="getSourceAccountDisplayName(item)"
|
||||||
:placeholder="getSourceAccountTitle(item)"
|
:placeholder="getSourceAccountTitle(item)"
|
||||||
:items="categorizedAccounts"
|
:items="allVisibleCategorizedAccounts"
|
||||||
v-model="item.sourceAccountId"
|
v-model="item.sourceAccountId"
|
||||||
@update:model-value="updateTransactionData(item)">
|
@update:model-value="updateTransactionData(item)">
|
||||||
</two-column-select>
|
</two-column-select>
|
||||||
@@ -242,7 +242,7 @@
|
|||||||
:disabled="loading || submitting || !allVisibleAccounts.length"
|
:disabled="loading || submitting || !allVisibleAccounts.length"
|
||||||
:custom-selection-primary-text="getDestinationAccountDisplayName(item)"
|
:custom-selection-primary-text="getDestinationAccountDisplayName(item)"
|
||||||
:placeholder="$t('Destination Account')"
|
:placeholder="$t('Destination Account')"
|
||||||
:items="categorizedAccounts"
|
:items="allVisibleCategorizedAccounts"
|
||||||
v-model="item.destinationAccountId"
|
v-model="item.destinationAccountId"
|
||||||
@update:model-value="updateTransactionData(item)">
|
@update:model-value="updateTransactionData(item)">
|
||||||
</two-column-select>
|
</two-column-select>
|
||||||
@@ -480,7 +480,7 @@ export default {
|
|||||||
allVisibleAccounts() {
|
allVisibleAccounts() {
|
||||||
return this.accountsStore.allVisiblePlainAccounts;
|
return this.accountsStore.allVisiblePlainAccounts;
|
||||||
},
|
},
|
||||||
categorizedAccounts() {
|
allVisibleCategorizedAccounts() {
|
||||||
return this.$locale.getCategorizedAccountsWithDisplayBalance(this.allVisibleAccounts, this.showAccountBalance, this.defaultCurrency, this.settingsStore, this.userStore, this.exchangeRatesStore);
|
return this.$locale.getCategorizedAccountsWithDisplayBalance(this.allVisibleAccounts, this.showAccountBalance, this.defaultCurrency, this.settingsStore, this.userStore, this.exchangeRatesStore);
|
||||||
},
|
},
|
||||||
allAccountsMap() {
|
allAccountsMap() {
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
:disabled="loading || saving || !allVisibleAccounts.length"
|
:disabled="loading || saving || !allVisibleAccounts.length"
|
||||||
:label="$t('Default Account')"
|
:label="$t('Default Account')"
|
||||||
:placeholder="$t('Default Account')"
|
:placeholder="$t('Default Account')"
|
||||||
:items="allCategorizedAccounts"
|
:items="allVisibleCategorizedAccounts"
|
||||||
:no-item-text="$t('Unspecified')"
|
:no-item-text="$t('Unspecified')"
|
||||||
v-model="newProfile.defaultAccountId">
|
v-model="newProfile.defaultAccountId">
|
||||||
</two-column-select>
|
</two-column-select>
|
||||||
@@ -420,7 +420,7 @@ export default {
|
|||||||
allVisibleAccounts() {
|
allVisibleAccounts() {
|
||||||
return this.accountsStore.allVisiblePlainAccounts;
|
return this.accountsStore.allVisiblePlainAccounts;
|
||||||
},
|
},
|
||||||
allCategorizedAccounts() {
|
allVisibleCategorizedAccounts() {
|
||||||
return getCategorizedAccounts(this.allVisibleAccounts);
|
return getCategorizedAccounts(this.allVisibleAccounts);
|
||||||
},
|
},
|
||||||
allWeekDays() {
|
allWeekDays() {
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
v-show="(showHidden && hasAccount(accountCategory, false)) || hasAccount(accountCategory, true)">
|
v-show="(showHidden && hasAccount(accountCategory, false)) || hasAccount(accountCategory, true)">
|
||||||
<f7-list strong inset dividers sortable class="list-has-group-title account-list margin-vertical"
|
<f7-list strong inset dividers sortable class="list-has-group-title account-list margin-vertical"
|
||||||
:sortable-enabled="sortable"
|
:sortable-enabled="sortable"
|
||||||
v-if="categorizedAccounts[accountCategory.id]"
|
v-if="allCategorizedAccountsMap[accountCategory.id]"
|
||||||
@sortable:sort="onSort">
|
@sortable:sort="onSort">
|
||||||
<f7-list-item group-title :sortable="false">
|
<f7-list-item group-title :sortable="false">
|
||||||
<small>
|
<small>
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
:after="accountBalance(account)"
|
:after="accountBalance(account)"
|
||||||
:link="!sortable ? '/transaction/list?accountIds=' + account.id : null"
|
:link="!sortable ? '/transaction/list?accountIds=' + account.id : null"
|
||||||
:key="account.id"
|
:key="account.id"
|
||||||
v-for="account in categorizedAccounts[accountCategory.id].accounts"
|
v-for="account in allCategorizedAccountsMap[accountCategory.id].accounts"
|
||||||
v-show="showHidden || !account.hidden"
|
v-show="showHidden || !account.hidden"
|
||||||
@taphold="setSortable()"
|
@taphold="setSortable()"
|
||||||
>
|
>
|
||||||
@@ -210,8 +210,8 @@ export default {
|
|||||||
allAccountCategories() {
|
allAccountCategories() {
|
||||||
return accountConstants.allCategories;
|
return accountConstants.allCategories;
|
||||||
},
|
},
|
||||||
categorizedAccounts() {
|
allCategorizedAccountsMap() {
|
||||||
return this.accountsStore.allCategorizedAccounts;
|
return this.accountsStore.allCategorizedAccountsMap;
|
||||||
},
|
},
|
||||||
allAccountCount() {
|
allAccountCount() {
|
||||||
return this.accountsStore.allAvailableAccountsCount;
|
return this.accountsStore.allAvailableAccountsCount;
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ export default {
|
|||||||
return accountConstants.allAccountTypes;
|
return accountConstants.allAccountTypes;
|
||||||
},
|
},
|
||||||
allCategorizedAccounts() {
|
allCategorizedAccounts() {
|
||||||
return getCategorizedAccountsWithVisibleCount(this.accountsStore.allCategorizedAccounts);
|
return getCategorizedAccountsWithVisibleCount(this.accountsStore.allCategorizedAccountsMap);
|
||||||
},
|
},
|
||||||
hasAnyAvailableAccount() {
|
hasAnyAvailableAccount() {
|
||||||
return this.accountsStore.allAvailableAccountsCount > 0;
|
return this.accountsStore.allAvailableAccountsCount > 0;
|
||||||
|
|||||||
@@ -200,7 +200,7 @@
|
|||||||
secondary-key-field="id" secondary-value-field="id"
|
secondary-key-field="id" secondary-value-field="id"
|
||||||
secondary-title-field="name" secondary-footer-field="displayBalance"
|
secondary-title-field="name" secondary-footer-field="displayBalance"
|
||||||
secondary-icon-field="icon" secondary-icon-type="account" secondary-color-field="color"
|
secondary-icon-field="icon" secondary-icon-type="account" secondary-color-field="color"
|
||||||
:items="categorizedAccounts"
|
:items="allVisibleCategorizedAccounts"
|
||||||
v-model:show="showSourceAccountSheet"
|
v-model:show="showSourceAccountSheet"
|
||||||
v-model="transaction.sourceAccountId">
|
v-model="transaction.sourceAccountId">
|
||||||
</two-column-list-item-selection-sheet>
|
</two-column-list-item-selection-sheet>
|
||||||
@@ -223,7 +223,7 @@
|
|||||||
secondary-key-field="id" secondary-value-field="id"
|
secondary-key-field="id" secondary-value-field="id"
|
||||||
secondary-title-field="name" secondary-footer-field="displayBalance"
|
secondary-title-field="name" secondary-footer-field="displayBalance"
|
||||||
secondary-icon-field="icon" secondary-icon-type="account" secondary-color-field="color"
|
secondary-icon-field="icon" secondary-icon-type="account" secondary-color-field="color"
|
||||||
:items="categorizedAccounts"
|
:items="allVisibleCategorizedAccounts"
|
||||||
v-model:show="showDestinationAccountSheet"
|
v-model:show="showDestinationAccountSheet"
|
||||||
v-model="transaction.destinationAccountId">
|
v-model="transaction.destinationAccountId">
|
||||||
</two-column-list-item-selection-sheet>
|
</two-column-list-item-selection-sheet>
|
||||||
@@ -606,7 +606,7 @@ export default {
|
|||||||
allAccountsMap() {
|
allAccountsMap() {
|
||||||
return this.accountsStore.allAccountsMap;
|
return this.accountsStore.allAccountsMap;
|
||||||
},
|
},
|
||||||
categorizedAccounts() {
|
allVisibleCategorizedAccounts() {
|
||||||
return this.$locale.getCategorizedAccountsWithDisplayBalance(this.allVisibleAccounts, this.showAccountBalance, this.defaultCurrency, this.settingsStore, this.userStore, this.exchangeRatesStore);
|
return this.$locale.getCategorizedAccountsWithDisplayBalance(this.allVisibleAccounts, this.showAccountBalance, this.defaultCurrency, this.settingsStore, this.userStore, this.exchangeRatesStore);
|
||||||
},
|
},
|
||||||
allCategories() {
|
allCategories() {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
secondary-key-field="id" secondary-value-field="id"
|
secondary-key-field="id" secondary-value-field="id"
|
||||||
secondary-title-field="name"
|
secondary-title-field="name"
|
||||||
secondary-icon-field="icon" secondary-icon-type="account" secondary-color-field="color"
|
secondary-icon-field="icon" secondary-icon-type="account" secondary-color-field="color"
|
||||||
:items="allCategorizedAccounts"
|
:items="allVisibleCategorizedAccounts"
|
||||||
v-model:show="showAccountSheet"
|
v-model:show="showAccountSheet"
|
||||||
v-model="newProfile.defaultAccountId">
|
v-model="newProfile.defaultAccountId">
|
||||||
</two-column-list-item-selection-sheet>
|
</two-column-list-item-selection-sheet>
|
||||||
@@ -415,7 +415,7 @@ export default {
|
|||||||
allVisibleAccounts() {
|
allVisibleAccounts() {
|
||||||
return this.accountsStore.allVisiblePlainAccounts;
|
return this.accountsStore.allVisiblePlainAccounts;
|
||||||
},
|
},
|
||||||
allCategorizedAccounts() {
|
allVisibleCategorizedAccounts() {
|
||||||
return getCategorizedAccounts(this.allVisibleAccounts);
|
return getCategorizedAccounts(this.allVisibleAccounts);
|
||||||
},
|
},
|
||||||
allWeekDays() {
|
allWeekDays() {
|
||||||
|
|||||||
Reference in New Issue
Block a user