Subtract the admin cost sum only when the setting is on

This commit is contained in:
ai-bot committed 2026-11-15 10:40:31 +00:00
1 parent ba48a14b1b
commit eb5c8cd301
1 file changed
+3 -7
+3 -7
View File
@@ -193,13 +193,9 @@ 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)
# 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
# The kroner sum is subtracted from the base only when the owner asks for
# it (docs/spec.md section 3.10).
netto_ore = gevinst_ore - tap_ore - (admin_cost_ore if deduct_admin else 0)
skatt_ore = _round_div(max(netto_ore, 0) * tax_rate, 100)
if wealth_enabled:
formuesskatt_ore = _round_div(