From 79aafdf607c161122e25e71866ee7c9b47236877 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sat, 14 Nov 2026 18:02:25 +0000 Subject: [PATCH] Count admin_cost from its own flag and in sats --- tax.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tax.py b/tax.py index 16c0578..dafba11 100644 --- a/tax.py +++ b/tax.py @@ -115,8 +115,14 @@ def report(year, conn=None): for market in markets } income_ore = 0 - admin_cost_ore = 0 + admin_cost_sats = 0 for row in _year_rows(conn, year): + if row["type"] == "admin_cost": + # It has no account and changes no holdings (section 3.10), so it + # is counted from its own taxable flag and from nothing else. + if row["taxable"]: + admin_cost_sats += row["leg_out_sats"] or 0 + continue market = by_id.get(row["market_id"]) if market is None: continue @@ -130,10 +136,6 @@ def report(year, conn=None): value = (row["value_ore"] or 0) - (row["fee_ore"] or 0) if counted: income_ore += value - elif row["type"] == "admin_cost": - value = row["leg_out_ore"] or row["cost_ore"] - if counted: - admin_cost_ore += value elif ( row["type"] in REALIZING_TYPES and row["leg_out_sats"]