feat(currency): sweep remaining concat call sites to formatCurrency

Builds on the centralised formatter shipped in ee2da8f. Replaces
\`\${currency} \${amount}\` style concatenations across the dashboard
revenue tooltip, command-search invoice/expense fallback labels,
expense-duplicate banner, and the invoice + expense PDF templates.
Drops the duplicate \`currencySymbol\` helper inside expense-pdf.service
in favour of the shared util; the two PDF helpers (renderReceiptHeader,
addReceiptErrorPage) now take a currency code instead of a pre-rendered
symbol so the formatter is the single source for spacing + thousands
separators. Also re-runs Prettier on the files where the prior commit
shipped without it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-09 18:35:34 +02:00
parent 7804e9bb17
commit 43191659e6
10 changed files with 53 additions and 71 deletions

View File

@@ -37,6 +37,7 @@ import {
import { apiFetch } from '@/lib/api/client';
import { cn } from '@/lib/utils';
import { formatCurrency } from '@/lib/utils/currency';
import {
useSearch,
type BucketType,
@@ -951,7 +952,7 @@ function buildFlatRows(args: BuildFlatRowsArgs): FlatRow[] {
else if (inv.paymentStatus === 'paid') badges.push({ label: 'Paid', tone: 'success' });
else if (inv.status === 'sent') badges.push({ label: 'Sent', tone: 'neutral' });
const sub = inv.totalAmount
? `${inv.clientName} · ${inv.totalAmount} ${inv.currency}`
? `${inv.clientName} · ${formatCurrency(inv.totalAmount, inv.currency)}`
: inv.clientName;
rows.push({
kind: 'result',
@@ -975,7 +976,7 @@ function buildFlatRows(args: BuildFlatRowsArgs): FlatRow[] {
key: `expenses:${e.id}`,
bucket: 'expenses',
icon: Receipt,
label: e.description ?? e.vendor ?? `${e.amount} ${e.currency}`,
label: e.description ?? e.vendor ?? formatCurrency(e.amount, e.currency),
sub,
href: `/${portSlug}/expenses/${e.id}`,
badges: badges.length > 0 ? badges : undefined,