From 4c6238e0d7145e985471ce2be9e3d3363c523080 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sun, 15 Nov 2026 10:41:19 +0000 Subject: [PATCH] Load the columns a transfer price needs in the export --- export.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/export.py b/export.py index 42e5651..aad12c0 100644 --- a/export.py +++ b/export.py @@ -148,9 +148,14 @@ def transactions_csv(year): try: rows = conn.execute( "SELECT t.date, t.type, t.taxable, t.note, t.leg_in_sats, t.leg_in_ore," - " t.leg_out_sats, t.leg_out_ore, t.value_ore, t.fee_sats, t.fee_ore," + " t.leg_out_sats, t.leg_out_ore, t.value_ore, t.fee_sats," " m.name AS market_name, d.name AS to_market_name," - " COALESCE(SUM(c.cost_ore), 0) AS cost_ore" + " COALESCE(SUM(c.cost_ore), 0) AS cost_ore," + " COALESCE(SUM(c.sats), 0) AS consumed_sats," + " COALESCE((SELECT SUM(l.cost_ore_original) FROM lots l" + " WHERE l.origin_tx_id = t.id), 0) AS lot_cost_ore," + " COALESCE((SELECT SUM(l.sats_original) FROM lots l" + " WHERE l.origin_tx_id = t.id), 0) AS lot_sats" " FROM transactions t" " LEFT JOIN markets m ON m.id = t.market_id" " LEFT JOIN markets d ON d.id = t.to_market_id"