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:
parent
6a110545e2
commit
30b3fe818a
2 changed files with 12 additions and 1 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue