From 4a156e9d110a973e20bfa4491b9e0ed8d121a81a Mon Sep 17 00:00:00 2001 From: ai-bot Date: Mon, 16 Nov 2026 19:32:59 +0000 Subject: [PATCH] Pass the bank id along the replay --- ledger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ledger.py b/ledger.py index 5eb0d04..23994d0 100644 --- a/ledger.py +++ b/ledger.py @@ -431,6 +431,7 @@ def rebuild(conn=None): conn.execute("DELETE FROM lots") rows = conn.execute("SELECT * FROM transactions ORDER BY date, id").fetchall() balances = {} + bank_id = _bank_market_id(conn) for row in rows: tx = dict(row) if tx["type"] == "transfer_in" and tx["generated"]: @@ -438,7 +439,7 @@ def rebuild(conn=None): else: create_lots_for(tx, conn) consume(tx, _picks(conn, tx["id"]), conn) - _move_kroner(balances, tx) + _move_kroner(balances, tx, bank_id) conn.commit() finally: if own: