From b4dd06463d9c78a25374ed18893c612295192aa4 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 27 Jan 2024 13:43:40 +0100 Subject: [PATCH] Improve display of zero values also unify number class construction by using a helper Signed-off-by: Knut Ahlers --- frontend/components/accountOverview.vue | 18 +++++++++++----- .../components/accountsSidebarAccList.vue | 7 ++++--- frontend/components/budgetDashboard.vue | 12 ++++++----- frontend/helpers.js | 21 +++++++++++++++++++ 4 files changed, 45 insertions(+), 13 deletions(-) diff --git a/frontend/components/accountOverview.vue b/frontend/components/accountOverview.vue index 71ad5e8..e2bcc81 100644 --- a/frontend/components/accountOverview.vue +++ b/frontend/components/accountOverview.vue @@ -25,7 +25,9 @@
- {{ formatNumber(account.balance - balanceUncleared) }} € + + {{ formatNumber(account.balance - balanceUncleared) }} € + Cleared Balance @@ -33,7 +35,9 @@
+
- {{ formatNumber(balanceUncleared) }} € + + {{ formatNumber(balanceUncleared) }} € + Uncleared Balance @@ -41,7 +45,9 @@
=
- {{ formatNumber(account.balance) }} € + + {{ formatNumber(account.balance) }} € + Working Balance
@@ -168,7 +174,7 @@ {{ accountIdToName[tx.category] }} {{ tx.description }} - + {{ formatNumber(tx.amount) }} € @@ -329,7 +335,7 @@ import { Modal } from 'bootstrap' import accountEditor from './accountEditor.vue' -import { formatNumber } from '../helpers' +import { classFromNumber, formatNumber } from '../helpers' import rangeSelector from './rangeSelector.vue' import txEditor from './txEditor.vue' @@ -437,6 +443,8 @@ export default { emits: ['update-accounts'], methods: { + classFromNumber, + deleteSelected() { const actions = [] for (const id of this.selectedTx) { diff --git a/frontend/components/accountsSidebarAccList.vue b/frontend/components/accountsSidebarAccList.vue index fa1ace1..dc90be2 100644 --- a/frontend/components/accountsSidebarAccList.vue +++ b/frontend/components/accountsSidebarAccList.vue @@ -2,7 +2,7 @@
  • {{ header }} - + {{ formatNumber(sum) }} €
    @@ -15,7 +15,7 @@ :to="{ name: 'account-transactions', params: { accountId: acc.id }}" > {{ acc.name }} - + {{ formatNumber(acc.balance) }} € @@ -25,7 +25,7 @@