Count admin_cost from its own flag and in sats
This commit is contained in:
1 parent
9cbd528bdb
commit
79aafdf607
1 file changed
+7
-5
@@ -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"]
|
||||
|
||||
Reference in new issue
Block a user