diff --git a/tax.py b/tax.py index dafba11..51c4fe5 100644 --- a/tax.py +++ b/tax.py @@ -180,7 +180,13 @@ def report(year, conn=None): gevinst_ore = sum(account["gevinst_ore"] for account in accounts) tap_ore = sum(account["tap_ore"] for account in accounts) brukt_ore = sum(account["brukt_ore"] for account in accounts) - netto_ore = gevinst_ore - tap_ore - (admin_cost_ore if deduct_admin else 0) + # The sats become kroner only when the owner asks for the deduction, and + # at the year-end rate of the tax year (section 3.10). + if deduct_admin: + admin_cost_ore = _round_div(admin_cost_sats * (price or 0), SATS_PER_BTC) + else: + admin_cost_ore = 0 + netto_ore = gevinst_ore - tap_ore - admin_cost_ore skatt_ore = _round_div(max(netto_ore, 0) * tax_rate, 100) if wealth_enabled: formuesskatt_ore = _round_div(