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)