Tag each pending approval row with an INCOME / EXPENSE badge

With both kinds of entry sharing the Pending Approvals list, the row
alone didn't tell the reviewer which direction the accounting goes.
Adds a small green INCOME / red EXPENSE badge as a caption line above
the description (so it doesn't compete with description wrapping),
driven by an isIncomeEntry(entry) helper that reads the Beancount tag
set the API already returns. Also drops the now-redundant orange
pending-icon avatar — the card title already says these are pending,
and the badge does the heavier lifting.
This commit is contained in:
Padreug 2026-05-17 15:26:34 +02:00
commit 483e89163e
2 changed files with 9 additions and 5 deletions

View file

@ -1642,6 +1642,9 @@ window.app = Vue.createApp({
formatSats(amount) {
return new Intl.NumberFormat().format(amount)
},
isIncomeEntry(entry) {
return Array.isArray(entry.tags) && entry.tags.includes('income-entry')
},
formatFiat(amount, currency) {
return new Intl.NumberFormat('en-US', {
style: 'currency',

View file

@ -75,12 +75,13 @@
<h6 class="q-my-none q-mb-md">Pending Approvals</h6>
<q-list separator>
<q-item v-for="entry in pendingExpenses" :key="entry.id">
<q-item-section avatar>
<q-icon name="pending" color="orange" size="sm">
<q-tooltip>Pending approval</q-tooltip>
</q-icon>
</q-item-section>
<q-item-section>
<q-item-label caption>
<q-badge
:color="isIncomeEntry(entry) ? 'green' : 'red'"
:label="isIncomeEntry(entry) ? 'INCOME' : 'EXPENSE'"
/>
</q-item-label>
<q-item-label>{% raw %}{{ entry.description }}{% endraw %}</q-item-label>
<q-item-label caption>
{% raw %}{{ formatDate(entry.entry_date) }}{% endraw %}