Tag each pending approval row with an INCOME / EXPENSE badge

With both kinds of entry now sharing the Pending Approvals list,
the row alone doesn't tell the reviewer which direction the
accounting goes. Adds a small green INCOME / red EXPENSE badge in
front of the description, driven by an isIncomeEntry(entry) helper
that checks the Beancount tag set the API already returns. Matches
the green/red palette used on the webapp Transaction History.
This commit is contained in:
Padreug 2026-05-17 15:22:09 +02:00
commit 30b3fe818a
2 changed files with 12 additions and 1 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

@ -81,7 +81,15 @@
</q-icon>
</q-item-section>
<q-item-section>
<q-item-label>{% raw %}{{ entry.description }}{% endraw %}</q-item-label>
<q-item-label>
<q-badge
:color="isIncomeEntry(entry) ? 'green' : 'red'"
class="q-mr-sm"
>
{% raw %}{{ isIncomeEntry(entry) ? 'INCOME' : 'EXPENSE' }}{% endraw %}
</q-badge>
{% raw %}{{ entry.description }}{% endraw %}
</q-item-label>
<q-item-label caption>
{% raw %}{{ formatDate(entry.entry_date) }}{% endraw %}
</q-item-label>