support changing account category order

This commit is contained in:
MaysWind
2026-01-04 22:50:13 +08:00
parent 6e369f39a4
commit 0ce66d9070
50 changed files with 575 additions and 72 deletions
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Anwenden",
"Save": "Speichern",
"Save Changes": "Änderungen speichern",
"Reset to Default": "Reset to Default",
"Reset": "Zurücksetzen",
"Update": "Aktualisieren",
"Refresh": "Aktualisieren",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Wechselkursdatenseite",
"Exchange Rate": "Wechselkurs",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Apply",
"Save": "Save",
"Save Changes": "Save Changes",
"Reset to Default": "Reset to Default",
"Reset": "Reset",
"Update": "Update",
"Refresh": "Refresh",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Exchange Rates Data Page",
"Exchange Rate": "Exchange Rate",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Aplicar",
"Save": "Guardar",
"Save Changes": "Guardar Cambios",
"Reset to Default": "Reset to Default",
"Reset": "Reiniciar",
"Update": "Actualizar",
"Refresh": "Refrescar",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Página de Cuentas",
"Accounts Included in Total": "Cuentas Incluidas en el Total",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Página de Tipos de Cambio",
"Exchange Rate": "Tipo de Cambio",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Appliquer",
"Save": "Enregistrer",
"Save Changes": "Enregistrer les modifications",
"Reset to Default": "Reset to Default",
"Reset": "Réinitialiser",
"Update": "Mettre à jour",
"Refresh": "Actualiser",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Page de liste des comptes",
"Accounts Included in Total": "Comptes inclus dans le total",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Page des données de taux de change",
"Exchange Rate": "Taux de change",
+6 -5
View File
@@ -1349,9 +1349,9 @@ export function useI18n() {
return ret;
}
function getAllAccountCategories(): LocalizedAccountCategory[] {
function getAllAccountCategories(customAccountCategoryOrder: string): LocalizedAccountCategory[] {
const ret: LocalizedAccountCategory[] = [];
const allCategories = AccountCategory.values();
const allCategories = AccountCategory.values(customAccountCategoryOrder);
for (const accountCategory of allCategories) {
ret.push({
@@ -2094,10 +2094,10 @@ export function useI18n() {
return getAmountPrependAndAppendCurrencySymbol(currencyDisplayType, currencyCode, currencyUnit, currencyName, isPlural);
}
function getCategorizedAccountsWithDisplayBalance(allVisibleAccounts: Account[], showAccountBalance: boolean): CategorizedAccountWithDisplayBalance[] {
function getCategorizedAccountsWithDisplayBalance(allVisibleAccounts: Account[], showAccountBalance: boolean, customAccountCategoryOrder: string): CategorizedAccountWithDisplayBalance[] {
const ret: CategorizedAccountWithDisplayBalance[] = [];
const defaultCurrency = userStore.currentUserDefaultCurrency;
const allCategories = AccountCategory.values();
const allCategories = AccountCategory.values(customAccountCategoryOrder);
const categorizedAccounts: Record<number, CategorizedAccount> = getCategorizedAccountsMap(Account.cloneAccounts(allVisibleAccounts));
for (const category of allCategories) {
@@ -2128,7 +2128,8 @@ export function useI18n() {
let finalTotalBalance = '';
if (showAccountBalance) {
const accountsBalance = getAllFilteredAccountsBalance(categorizedAccounts, account => account.category === accountCategory.category);
const accountsBalance = getAllFilteredAccountsBalance(categorizedAccounts, customAccountCategoryOrder,
account => account.category === accountCategory.category);
let totalBalance = 0;
let hasUnCalculatedAmount = false;
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Applica",
"Save": "Salva",
"Save Changes": "Salva modifiche",
"Reset to Default": "Reset to Default",
"Reset": "Reimposta",
"Update": "Aggiorna",
"Refresh": "Aggiorna",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Pagina dati tassi di cambio",
"Exchange Rate": "Tasso di cambio",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "適用",
"Save": "保存",
"Save Changes": "変更を保存",
"Reset to Default": "Reset to Default",
"Reset": "リセット",
"Update": "アップデート",
"Refresh": "リフレッシュ",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "為替レートデータページ",
"Exchange Rate": "為替レート",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "ಅನ್ವಯಿಸು",
"Save": "ಉಳಿಸು",
"Save Changes": "ಬದಲಾವಣೆಗಳನ್ನು ಉಳಿಸು",
"Reset to Default": "Reset to Default",
"Reset": "ಮರುಹೊಂದಿಸು",
"Update": "ನವೀಕರಿಸು",
"Refresh": "ರಿಫ್ರೆಶ್",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "ಖಾತೆ ಪಟ್ಟಿ ಪುಟ",
"Accounts Included in Total": "ಒಟ್ಟು ಮೊತ್ತದಲ್ಲಿ ಒಳಗೊಂಡ ಖಾತೆಗಳು",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "ವಿನಿಮಯ ದರಗಳ ಪುಟ",
"Exchange Rate": "ವಿನಿಮಯ ದರ",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "적용",
"Save": "저장",
"Save Changes": "변경사항 저장",
"Reset to Default": "Reset to Default",
"Reset": "재설정",
"Update": "업데이트",
"Refresh": "새로고침",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "계좌 목록 페이지",
"Accounts Included in Total": "총계에 포함된 계좌",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "환율 데이터 페이지",
"Exchange Rate": "환율",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Toepassen",
"Save": "Opslaan",
"Save Changes": "Wijzigingen opslaan",
"Reset to Default": "Reset to Default",
"Reset": "Resetten",
"Update": "Bijwerken",
"Refresh": "Vernieuwen",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Rekeningenpagina",
"Accounts Included in Total": "Rekeningen opgenomen in totaal",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Wisselkoersgegevenspagina",
"Exchange Rate": "Wisselkoers",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Aplicar",
"Save": "Salvar",
"Save Changes": "Salvar Alterações",
"Reset to Default": "Reset to Default",
"Reset": "Redefinir",
"Update": "Atualizar",
"Refresh": "Atualizar",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Página de Dados de Taxas de Câmbio",
"Exchange Rate": "Taxa de Câmbio",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Применить",
"Save": "Сохранить",
"Save Changes": "Сохранить изменения",
"Reset to Default": "Reset to Default",
"Reset": "Сбросить",
"Update": "Обновить",
"Refresh": "Обновить",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Страница данных о курсах валют",
"Exchange Rate": "Курс обмена",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Uporabi",
"Save": "Shrani",
"Save Changes": "Shrani spremembe",
"Reset to Default": "Reset to Default",
"Reset": "Ponastavi",
"Update": "Posodobi",
"Refresh": "Osveži",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Stran za vpoglede in raziskovanje",
"Account List Page": "Stran s seznamom računov",
"Accounts Included in Total": "Računi vključeni v skupno vsoto",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Stran z menjalnimi tečaji",
"Exchange Rate": "Menjalni tečaj",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "ใช้",
"Save": "บันทึก",
"Save Changes": "บันทึกการเปลี่ยนแปลง",
"Reset to Default": "Reset to Default",
"Reset": "รีเซ็ต",
"Update": "อัปเดต",
"Refresh": "รีเฟรช",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "หน้าบัญชี",
"Accounts Included in Total": "บัญชีที่รวมในผลรวม",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "หน้าข้อมูลอัตราแลกเปลี่ยน",
"Exchange Rate": "อัตราแลกเปลี่ยน",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Uygula",
"Save": "Kaydet",
"Save Changes": "Değişiklikleri Kaydet",
"Reset to Default": "Reset to Default",
"Reset": "Sıfırla",
"Update": "Güncelle",
"Refresh": "Yenile",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Hesap Listesi Sayfası",
"Accounts Included in Total": "Toplama Dahil Edilen Hesaplar",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Döviz Kuru Verileri Sayfası",
"Exchange Rate": "Döviz Kuru",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Застосувати",
"Save": "Зберегти",
"Save Changes": "Зберегти зміни",
"Reset to Default": "Reset to Default",
"Reset": "Скинути",
"Update": "Оновити",
"Refresh": "Оновити",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Сторінка курсів валют",
"Exchange Rate": "Курс обміну",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "Áp dụng",
"Save": "Lưu",
"Save Changes": "Lưu thay đổi",
"Reset to Default": "Reset to Default",
"Reset": "Đặt lại",
"Update": "Cập nhật",
"Refresh": "Làm mới",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "Insights Explorer Page",
"Account List Page": "Account List Page",
"Accounts Included in Total": "Accounts Included in Total",
"Account Category Order": "Account Category Order",
"Account category order saved": "Account category order saved",
"Unable to move account category": "Unable to move account category",
"Hide Categories Without Accounts": "Hide Categories Without Accounts",
"Exchange Rates Data Page": "Trang dữ liệu tỷ giá hối đoái",
"Exchange Rate": "Tỷ giá hối đoái",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "应用",
"Save": "保存",
"Save Changes": "保存修改",
"Reset to Default": "恢复为默认值",
"Reset": "重置",
"Update": "更新",
"Refresh": "刷新",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "洞察探索页面",
"Account List Page": "账户列表页面",
"Accounts Included in Total": "计入总金额的账户",
"Account Category Order": "账户分类顺序",
"Account category order saved": "账户分类顺序已保存",
"Unable to move account category": "无法移动账户分类",
"Hide Categories Without Accounts": "隐藏没有账户的分类",
"Exchange Rates Data Page": "汇率数据页面",
"Exchange Rate": "汇率",
+4
View File
@@ -1435,6 +1435,7 @@
"Apply": "套用",
"Save": "儲存",
"Save Changes": "儲存修改",
"Reset to Default": "重設為預設值",
"Reset": "重置",
"Update": "更新",
"Refresh": "重新載入",
@@ -2190,6 +2191,9 @@
"Insights Explorer Page": "洞察探索頁面",
"Account List Page": "帳戶清單頁面",
"Accounts Included in Total": "計入總金額的帳戶",
"Account Category Order": "帳戶分類順序",
"Account category order saved": "帳戶分類順序已儲存",
"Unable to move account category": "無法移動帳戶分類",
"Hide Categories Without Accounts": "隱藏沒有帳戶的分類",
"Exchange Rates Data Page": "匯率資料頁面",
"Exchange Rate": "匯率",