From 30b3fe818a7662caf0b07d307bfbf8cdffb2230c Mon Sep 17 00:00:00 2001 From: Padreug Date: Sun, 17 May 2026 15:22:09 +0200 Subject: [PATCH] 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. --- static/js/index.js | 3 +++ templates/libra/index.html | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/static/js/index.js b/static/js/index.js index 7c01c07..1f6ccb9 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -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', diff --git a/templates/libra/index.html b/templates/libra/index.html index 8641fa4..7af400f 100644 --- a/templates/libra/index.html +++ b/templates/libra/index.html @@ -81,7 +81,15 @@ - {% raw %}{{ entry.description }}{% endraw %} + + + {% raw %}{{ isIncomeEntry(entry) ? 'INCOME' : 'EXPENSE' }}{% endraw %} + + {% raw %}{{ entry.description }}{% endraw %} + {% raw %}{{ formatDate(entry.entry_date) }}{% endraw %}