From 6604c24727dd327824d07564791939f30b501261 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sun, 15 Nov 2026 18:30:54 +0000 Subject: [PATCH] Look up the bank account --- app.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app.py b/app.py index c47b978..812d8c1 100644 --- a/app.py +++ b/app.py @@ -152,6 +152,16 @@ def _load_markets(conn): return {row["id"]: dict(row) for row in rows} +def _bank_market_id(conn): + """The account that pays the costs (docs/spec.md section 3.11).""" + row = conn.execute( + "SELECT value FROM settings WHERE key = 'bank_market_id'" + ).fetchone() + if row is None: + raise ApiError(500, "Bankkontoen manglar i databasen.") + return int(row["value"]) + + def _with_price(transaction): """Add the derived bitcoin price of docs/spec.md section 7.3.""" transaction["btc_price_ore"] = tax.btc_price_ore(transaction)