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:
@@ -56,9 +56,7 @@ export function BerthCard({ berth }: BerthCardProps) {
|
||||
const metaParts: string[] = [];
|
||||
if (dimText) metaParts.push(dimText);
|
||||
if (berth.price)
|
||||
metaParts.push(
|
||||
formatCurrency(berth.price, berth.priceCurrency, { maxFractionDigits: 0 }),
|
||||
);
|
||||
metaParts.push(formatCurrency(berth.price, berth.priceCurrency, { maxFractionDigits: 0 }));
|
||||
|
||||
const tags = berth.tags ?? [];
|
||||
|
||||
|
||||
@@ -405,18 +405,14 @@ export function BerthForm({ berth, open, onOpenChange }: BerthFormProps) {
|
||||
<CurrencyInput
|
||||
value={watch('price') ?? ''}
|
||||
currency={watch('priceCurrency') ?? 'USD'}
|
||||
onChange={(v) =>
|
||||
setValue('price', v ?? undefined, { shouldDirty: true })
|
||||
}
|
||||
onChange={(v) => setValue('price', v ?? undefined, { shouldDirty: true })}
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label>Currency</Label>
|
||||
<CurrencySelect
|
||||
value={watch('priceCurrency') ?? 'USD'}
|
||||
onValueChange={(v) =>
|
||||
setValue('priceCurrency', v, { shouldDirty: true })
|
||||
}
|
||||
onValueChange={(v) => setValue('priceCurrency', v, { shouldDirty: true })}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user