diff --git a/src/modules/expenses/views/TransactionsPage.vue b/src/modules/expenses/views/TransactionsPage.vue index 70b560c..fbec2d9 100644 --- a/src/modules/expenses/views/TransactionsPage.vue +++ b/src/modules/expenses/views/TransactionsPage.vue @@ -46,6 +46,10 @@ function isExpense(t: Transaction): boolean { return t.tags?.includes('expense-entry') ?? false } +function isVoided(t: Transaction): boolean { + return t.tags?.includes('voided') ?? false +} + const walletKey = computed(() => user.value?.wallets?.[0]?.inkey) // Fuzzy search state and configuration @@ -108,17 +112,20 @@ function formatAmount(amount: number): string { return new Intl.NumberFormat('en-US').format(amount) } -// Get status icon and color based on flag -function getStatusInfo(flag?: string) { - switch (flag) { +// Get status icon and color. Voided entries (per libra convention) keep +// flag='!' and carry a 'voided' tag — surface that as the icon regardless +// of the underlying flag. +function getStatusInfo(transaction: Transaction) { + if (isVoided(transaction)) { + return { icon: XCircle, color: 'text-muted-foreground', label: 'Voided' } + } + switch (transaction.flag) { case '*': return { icon: CheckCircle2, color: 'text-green-600', label: 'Cleared' } case '!': return { icon: Clock, color: 'text-orange-600', label: 'Pending' } case '#': return { icon: Flag, color: 'text-red-600', label: 'Flagged' } - case 'x': - return { icon: XCircle, color: 'text-muted-foreground', label: 'Voided' } default: return null } @@ -328,14 +335,19 @@ onMounted(() => {
+
{{ formatAmount(transaction.amount) }} sats
-+
{{ transaction.fiat_amount.toFixed(2) }} {{ transaction.fiat_currency }}