modify the name of debit card to checking account, add savings account and certificate of deposit

This commit is contained in:
MaysWind
2024-09-20 00:00:19 +08:00
parent 1e8a27612f
commit 220f9f15e5
10 changed files with 84 additions and 41 deletions
+11 -1
View File
@@ -6,7 +6,12 @@ const allAccountCategories = [
},
{
id: 2,
name: 'Debit Card',
name: 'Checking Account',
defaultAccountIconId: '100'
},
{
id: 8,
name: 'Savings Account',
defaultAccountIconId: '100'
},
{
@@ -29,6 +34,11 @@ const allAccountCategories = [
name: 'Receivables',
defaultAccountIconId: '700'
},
{
id: 9,
name: 'Certificate of Deposit',
defaultAccountIconId: '110'
},
{
id: 7,
name: 'Investment Account',
+22 -4
View File
@@ -100,7 +100,7 @@ export function getSubAccountCurrencies(account, showHidden, subAccountId) {
return subAccountCurrencies;
}
export function getCategorizedAccounts(allAccounts) {
export function getCategorizedAccountsMap(allAccounts) {
const ret = {};
for (let i = 0; i < allAccounts.length; i++) {
@@ -128,8 +128,26 @@ export function getCategorizedAccounts(allAccounts) {
return ret;
}
export function getCategorizedAccounts(allAccounts) {
const ret = [];
const categorizedAccounts = getCategorizedAccountsMap(allAccounts);
for (let i = 0; i < accountConstants.allCategories.length; i++) {
const category = accountConstants.allCategories[i];
if (!categorizedAccounts[category.id]) {
continue;
}
const accountCategory = categorizedAccounts[category.id];
ret.push(accountCategory);
}
return ret;
}
export function getCategorizedAccountsWithVisibleCount(categorizedAccounts) {
const ret = {};
const ret = [];
for (let i = 0; i < accountConstants.allCategories.length; i++) {
const accountCategory = accountConstants.allCategories[i];
@@ -181,7 +199,7 @@ export function getCategorizedAccountsWithVisibleCount(categorizedAccounts) {
}
if (allAccounts.length > 0) {
ret[accountCategory.id] = {
ret.push({
category: accountCategory.id,
name: accountCategory.name,
icon: accountCategory.defaultAccountIconId,
@@ -191,7 +209,7 @@ export function getCategorizedAccountsWithVisibleCount(categorizedAccounts) {
allSubAccounts: allSubAccounts,
allVisibleSubAccountCounts: allVisibleSubAccountCounts,
allFirstVisibleSubAccountIndexes: allFirstVisibleSubAccountIndexes
};
});
}
}
+11 -6
View File
@@ -55,7 +55,7 @@ import {
} from './currency.js';
import {
getCategorizedAccounts,
getCategorizedAccountsMap,
getAllFilteredAccountsBalance
} from './account.js';
@@ -1280,14 +1280,17 @@ function getEnableDisableOptions(translateFn) {
}
function getCategorizedAccountsWithDisplayBalance(allVisibleAccounts, showAccountBalance, defaultCurrency, userStore, settingsStore, exchangeRatesStore, translateFn) {
const categorizedAccounts = copyObjectTo(getCategorizedAccounts(allVisibleAccounts), {});
const ret = [];
const categorizedAccounts = copyObjectTo(getCategorizedAccountsMap(allVisibleAccounts), {});
for (let category in categorizedAccounts) {
if (!Object.prototype.hasOwnProperty.call(categorizedAccounts, category)) {
for (let i = 0; i < accountConstants.allCategories.length; i++) {
const category = accountConstants.allCategories[i];
if (!categorizedAccounts[category.id]) {
continue;
}
const accountCategory = categorizedAccounts[category];
const accountCategory = categorizedAccounts[category.id];
if (accountCategory.accounts) {
for (let i = 0; i < accountCategory.accounts.length; i++) {
@@ -1339,9 +1342,11 @@ function getCategorizedAccountsWithDisplayBalance(allVisibleAccounts, showAccoun
} else {
accountCategory.displayBalance = '***';
}
ret.push(accountCategory);
}
return categorizedAccounts;
return ret;
}
function joinMultiText(textArray, translateFn) {
+3 -1
View File
@@ -1395,12 +1395,14 @@
"Income": "Income",
"Transfer": "Transfer",
"Cash": "Cash",
"Debit Card": "Debit Card",
"Checking Account": "Checking Account",
"Credit Card": "Credit Card",
"Virtual Account": "Virtual Account",
"Debt Account": "Debt Account",
"Receivables": "Receivables",
"Investment Account": "Investment Account",
"Savings Account": "Savings Account",
"Certificate of Deposit": "Certificate of Deposit",
"Balance": "Balance",
"Unable to retrieve account list": "Unable to retrieve account list",
"Account list is up to date": "Account list is up to date",
+3 -1
View File
@@ -1395,12 +1395,14 @@
"Income": "收入",
"Transfer": "转账",
"Cash": "现金",
"Debit Card": "借记",
"Checking Account": "借记账户",
"Credit Card": "信用卡",
"Virtual Account": "虚拟账户",
"Debt Account": "负债账户",
"Receivables": "应收款项",
"Investment Account": "投资账户",
"Savings Account": "储蓄账户",
"Certificate of Deposit": "定期存款",
"Balance": "余额",
"Unable to retrieve account list": "无法获取账户列表",
"Account list is up to date": "账户列表已是最新",
+3 -3
View File
@@ -10,7 +10,7 @@ import colorConstants from '@/consts/color.js';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import { isNumber, isEquals } from '@/lib/common.js';
import { getCategorizedAccounts, getAllFilteredAccountsBalance } from '@/lib/account.js';
import { getCategorizedAccountsMap, getAllFilteredAccountsBalance } from '@/lib/account.js';
function loadAccountList(state, accounts) {
state.allAccounts = accounts;
@@ -28,7 +28,7 @@ function loadAccountList(state, accounts) {
}
}
state.allCategorizedAccounts = getCategorizedAccounts(accounts);
state.allCategorizedAccounts = getCategorizedAccountsMap(accounts);
}
function addAccountToAccountList(state, account) {
@@ -56,7 +56,7 @@ function addAccountToAccountList(state, account) {
const accountList = state.allCategorizedAccounts[account.category].accounts;
accountList.push(account);
} else {
state.allCategorizedAccounts = getCategorizedAccounts(state.allAccounts);
state.allCategorizedAccounts = getCategorizedAccountsMap(state.allAccounts);
}
}
+1 -1
View File
@@ -47,7 +47,7 @@
<v-main>
<v-window class="d-flex flex-grow-1 disable-tab-transition w-100-window-container" v-model="activeTab">
<v-window-item value="accountPage">
<v-card variant="flat" min-height="680">
<v-card variant="flat" min-height="780">
<template #title>
<div class="title-and-toolbar d-flex align-center">
<v-btn class="mr-3 d-md-none" density="compact" color="default" variant="plain"