Load the columns a transfer price needs

This commit is contained in:
ai-bot committed 2026-11-15 10:40:56 +00:00
1 parent 8436cffb23
commit 70e0a37122
1 file changed
+8 -1
+8 -1
View File
@@ -162,7 +162,14 @@ def _load_transaction(conn, tx_id):
row = conn.execute(
"SELECT t.*, m.name AS market_name, d.name AS to_market_name,"
" COALESCE((SELECT SUM(c.cost_ore) FROM lot_consumptions c WHERE c.tx_id = t.id), 0)"
" AS cost_ore FROM transactions t"
" AS cost_ore,"
" COALESCE((SELECT SUM(c.sats) FROM lot_consumptions c WHERE c.tx_id = t.id), 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 WHERE t.id = ?",
(tx_id,),