mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-21 18:24:26 +08:00
improve robustness
This commit is contained in:
+1
-1
@@ -243,7 +243,7 @@ export function getAllFilteredAccountsBalance(categorizedAccounts, accountFilter
|
|||||||
isLiability: account.isLiability,
|
isLiability: account.isLiability,
|
||||||
currency: account.currency
|
currency: account.currency
|
||||||
});
|
});
|
||||||
} else if (account.type === accountConstants.allAccountTypes.MultiSubAccounts) {
|
} else if (account.type === accountConstants.allAccountTypes.MultiSubAccounts && account.subAccounts) {
|
||||||
for (let subAccountIdx = 0; subAccountIdx < account.subAccounts.length; subAccountIdx++) {
|
for (let subAccountIdx = 0; subAccountIdx < account.subAccounts.length; subAccountIdx++) {
|
||||||
const subAccount = account.subAccounts[subAccountIdx];
|
const subAccount = account.subAccounts[subAccountIdx];
|
||||||
|
|
||||||
|
|||||||
@@ -188,12 +188,14 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
if (account.type === accountConstants.allAccountTypes.SingleAccount) {
|
if (account.type === accountConstants.allAccountTypes.SingleAccount) {
|
||||||
allAccounts.push(account);
|
allAccounts.push(account);
|
||||||
} else if (account.type === accountConstants.allAccountTypes.MultiSubAccounts) {
|
} else if (account.type === accountConstants.allAccountTypes.MultiSubAccounts) {
|
||||||
|
if (account.subAccounts) {
|
||||||
for (let j = 0; j < account.subAccounts.length; j++) {
|
for (let j = 0; j < account.subAccounts.length; j++) {
|
||||||
const subAccount = account.subAccounts[j];
|
const subAccount = account.subAccounts[j];
|
||||||
allAccounts.push(subAccount);
|
allAccounts.push(subAccount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return allAccounts;
|
return allAccounts;
|
||||||
},
|
},
|
||||||
@@ -210,12 +212,14 @@ export const useAccountsStore = defineStore('accounts', {
|
|||||||
if (account.type === accountConstants.allAccountTypes.SingleAccount) {
|
if (account.type === accountConstants.allAccountTypes.SingleAccount) {
|
||||||
allVisibleAccounts.push(account);
|
allVisibleAccounts.push(account);
|
||||||
} else if (account.type === accountConstants.allAccountTypes.MultiSubAccounts) {
|
} else if (account.type === accountConstants.allAccountTypes.MultiSubAccounts) {
|
||||||
|
if (account.subAccounts) {
|
||||||
for (let j = 0; j < account.subAccounts.length; j++) {
|
for (let j = 0; j < account.subAccounts.length; j++) {
|
||||||
const subAccount = account.subAccounts[j];
|
const subAccount = account.subAccounts[j];
|
||||||
allVisibleAccounts.push(subAccount);
|
allVisibleAccounts.push(subAccount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return allVisibleAccounts;
|
return allVisibleAccounts;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user