Compare commits

...

2 commits

Author SHA1 Message Date
30b3fe818a 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.
2026-05-17 15:22:09 +02:00
6a110545e2 Rename Pending Approvals card from "Pending Expense Approvals"
Both expense and income entries land in the same pending list (the
backend's /entries/pending endpoint already returns all pending
transactions regardless of type, and approve/reject is type-agnostic),
so the expense-specific title was misleading once income approval
shipped in #13.
2026-05-17 15:21:46 +02:00
2 changed files with 14 additions and 3 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

@ -69,10 +69,10 @@
</template>
</q-banner>
<!-- Pending Expense Entries (Super User Only) -->
<!-- Pending Entries (Super User Only) -->
<q-card v-if="isSuperUser && pendingExpenses.length > 0">
<q-card-section>
<h6 class="q-my-none q-mb-md">Pending Expense Approvals</h6>
<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>
@ -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>