From 6d5a435ed997c481760ce7fbf66d1a5104e3003b Mon Sep 17 00:00:00 2001 From: Jakob Wennberg <149234542+jakobwennberg@users.noreply.github.com> Date: Sat, 25 Jul 2026 12:59:05 +0200 Subject: [PATCH] fix(reports): drop the kr suffix from invoice-currency AR-ledger columns (#1180) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1172. The Fakturor sheet's Totalt/Betalt/Utestående columns are invoice-original currency (the sheet carries a Valuta column and a separate SEK-converted Utestående (SEK) column), yet used the kr-suffixed currency format, so a EUR invoice rendered "1 000,00 kr" beside Valuta=EUR. They now use the suffix-free decimalColumn added in #1166; the SEK column and the SEK-converted aging sheet keep kr. The supplier-ledger xlsx was checked: its buckets are SEK-converted via resolveSekAmount, so kr is correct there. Co-authored-by: Claude Fable 5 --- app/api/reports/ar-ledger/xlsx/route.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/api/reports/ar-ledger/xlsx/route.ts b/app/api/reports/ar-ledger/xlsx/route.ts index 1052ae38..2367a262 100644 --- a/app/api/reports/ar-ledger/xlsx/route.ts +++ b/app/api/reports/ar-ledger/xlsx/route.ts @@ -5,6 +5,7 @@ import { reportToWorkbook, textColumn, currencyColumn, + decimalColumn, dateColumn, integerColumn, xlsxFilename, @@ -111,9 +112,12 @@ export const GET = withRouteContext('report.ar_ledger.xlsx', async (request, { s textColumn('Fakturanr'), dateColumn('Fakturadatum'), dateColumn('Förfallodatum'), - currencyColumn('Totalt'), - currencyColumn('Betalt'), - currencyColumn('Utestående'), + // Totalt/Betalt/Utestående are invoice-original currency (see the + // Valuta column): the kr-suffixed format is only correct for the + // SEK-converted column. + decimalColumn('Totalt'), + decimalColumn('Betalt'), + decimalColumn('Utestående'), currencyColumn('Utestående (SEK)'), integerColumn('Dagar förfallet'), textColumn('Valuta'),