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
+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) {