fix(ui): stop mislabeling unconverted FX amounts as kr in aggregates and toasts (#1182)

Fixes #1173. invoices.total_sek stays NULL when the Riksbanken rate
fetch fails at creation, and every `total_sek || total` fallback then
treated a raw foreign amount as kronor:

- lib/calendar/utils: new invoiceSekAmount() returns null for
  unconverted non-SEK invoices; period summaries and day totals skip
  them and PeriodSummary exposes unconvertedCount. PaymentSummaryCard
  shows a one-line note when invoices were excluded; CalendarDayView
  renders each invoice in its own currency instead.
- Deadlines page: the overdue attn sum now skips unconverted FX
  invoices and appends "(+N i utlandsk valuta)" instead of adding EUR
  into a kr total.
- Supplier-invoice payment toast formats the amount with the invoice's
  currency (key drops its hardcoded " kr" in both locales).
- AR aging drill-down row labels Betalt with the invoice currency,
  mirroring the outstanding cell.
- BankFileColumnMappingStep: comment pinning why SEK is safe there
  (generic-csv hardcodes it).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-07-25 12:59:14 +02:00
committed by GitHub
co-authored by Claude Fable 5
parent 6d5a435ed9
commit aead2bc1d1
10 changed files with 133 additions and 21 deletions
+2 -1
View File
@@ -575,6 +575,7 @@
"generating": "Generating…",
"help_text": "Deadlines for VAT, employer declarations and F-tax are generated automatically from your company's tax settings. Add your own with New deadline; click a row to edit it.",
"overdue_invoices_action": "View the invoices",
"overdue_invoices_fx": "(+{count} in foreign currency)",
"seg_all": "All",
"seg_tax": "Tax",
"seg_invoicing": "Invoicing",
@@ -3601,7 +3602,7 @@
"payment_failed_title": "Payment failed",
"paid_title": "Paid",
"partial_payment_title": "Partial payment registered",
"amount_registered_description": "{amount} kr registered",
"amount_registered_description": "{amount} registered",
"credit_confirm_title": "Register credit note",
"credit_confirm_description": "A credit note is created that reverses the original invoice. This action cannot be undone.",
"credit_confirm_label": "Register credit note",
+2 -1
View File
@@ -575,6 +575,7 @@
"generating": "Genererar…",
"help_text": "Deadlines för moms, arbetsgivardeklaration och F-skatt skapas automatiskt från företagets skatteinställningar. Egna deadlines lägger du till med Ny deadline; klicka på en rad för att ändra den.",
"overdue_invoices_action": "Visa fakturorna",
"overdue_invoices_fx": "(+{count} i utländsk valuta)",
"seg_all": "Alla",
"seg_tax": "Skatt",
"seg_invoicing": "Fakturering",
@@ -3601,7 +3602,7 @@
"payment_failed_title": "Betalning misslyckades",
"paid_title": "Betald",
"partial_payment_title": "Delbetalning registrerad",
"amount_registered_description": "{amount} kr registrerat",
"amount_registered_description": "{amount} registrerat",
"credit_confirm_title": "Registrera kreditfaktura",
"credit_confirm_description": "En kreditfaktura skapas som reverserar den ursprungliga fakturan. Denna åtgärd kan inte ångras.",
"credit_confirm_label": "Registrera kreditfaktura",