From 38473980554afd01eb46c4ab5af7ccb2ef5d6f354d22fc4b6f86f5aacf82ec81 Mon Sep 17 00:00:00 2001 From: wlfb Date: Fri, 17 Jul 2026 18:53:23 +0200 Subject: [PATCH] fix: json-form-Extension fuer Standalone-Elemente, Kontoname in Buchungsliste Co-Authored-By: Claude Fable 5 --- finance/app/routers/gui.py | 4 +++- finance/app/templates/transactions.html | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/finance/app/routers/gui.py b/finance/app/routers/gui.py index 1bc3825..f6e0451 100644 --- a/finance/app/routers/gui.py +++ b/finance/app/routers/gui.py @@ -84,9 +84,11 @@ def buchungen( offset=0, session=session, ) + accounts = session.execute(select(Account)).scalars().all() return templates.TemplateResponse(request, "transactions.html", { "transactions": txs, - "accounts": session.execute(select(Account)).scalars().all(), + "accounts": accounts, + "account_names": {a.id: a.name for a in accounts}, "categories": session.execute(select(Category)).scalars().all(), "filters": { "account_id": account_id, diff --git a/finance/app/templates/transactions.html b/finance/app/templates/transactions.html index 06453dd..9c8d8b6 100644 --- a/finance/app/templates/transactions.html +++ b/finance/app/templates/transactions.html @@ -50,7 +50,7 @@ {% for tx in transactions %} {{ tx.booking_date.strftime('%d.%m.%Y') }} - {{ tx.account_id }} + {{ account_names.get(tx.account_id, tx.account_id) }} {{ tx.purpose }} {{ tx.counterparty }} {{ '%.2f'|format(tx.amount) }} € @@ -128,7 +128,9 @@ var out = {}; for (var k in parameters) { var v = parameters[k]; - var field = elt.querySelector('[name="' + k + '"]'); + var field = elt.matches && elt.matches('[name="' + k + '"]') + ? elt + : elt.querySelector('[name="' + k + '"]'); var kind = field && field.dataset ? field.dataset.type : null; if (v === '') { out[k] = null;