From 374238f6ca0c000a3534d879db9ed77de8e12cef Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sat, 14 Nov 2026 18:22:42 +0000 Subject: [PATCH] Show the admin cost in sats, and the deducted kroner when there are any --- static/report.js | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/static/report.js b/static/report.js index 891ff3b..ef86e74 100644 --- a/static/report.js +++ b/static/report.js @@ -60,18 +60,25 @@ function renderTotals(report, settings) { var totals = report.totals; totalsBox.textContent = ""; - [ - ["Formue", totals.formue_ore], - ["Gevinst", totals.gevinst_ore], - ["Tap", totals.tap_ore], - ["Brukt inngangsverdi", totals.brukt_ore], - ["Netto", totals.netto_ore], - ["Inntekt", totals.inntekt_ore], - ["Skatt (" + settings.tax_rate_percent + " %)", totals.skatt_ore], - ["Formuesskatt", totals.formuesskatt_ore], - ["Forvaltningskostnad", totals.admin_cost_ore] - ].forEach(function (pair) { - totalsBox.appendChild(figure(pair[0], Skuld.formatKroner(pair[1]))); + var figures = [ + ["Formue", Skuld.formatKroner(totals.formue_ore)], + ["Gevinst", Skuld.formatKroner(totals.gevinst_ore)], + ["Tap", Skuld.formatKroner(totals.tap_ore)], + ["Brukt inngangsverdi", Skuld.formatKroner(totals.brukt_ore)], + ["Netto", Skuld.formatKroner(totals.netto_ore)], + ["Inntekt", Skuld.formatKroner(totals.inntekt_ore)], + ["Skatt (" + settings.tax_rate_percent + " %)", Skuld.formatKroner(totals.skatt_ore)], + ["Formuesskatt", Skuld.formatKroner(totals.formuesskatt_ore)], + ["Forvaltningskostnad", Skuld.formatSats(totals.admin_cost_sats) + " sats"] + ]; + if (totals.admin_cost_ore) { + figures.push([ + "Forvaltningskostnad trekt frå", + Skuld.formatKroner(totals.admin_cost_ore) + ]); + } + figures.forEach(function (pair) { + totalsBox.appendChild(figure(pair[0], pair[1])); }); var price = report.year_end_price_ore