fix: json-form-Extension fuer Standalone-Elemente, Kontoname in Buchungsliste
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -84,9 +84,11 @@ def buchungen(
|
|||||||
offset=0,
|
offset=0,
|
||||||
session=session,
|
session=session,
|
||||||
)
|
)
|
||||||
|
accounts = session.execute(select(Account)).scalars().all()
|
||||||
return templates.TemplateResponse(request, "transactions.html", {
|
return templates.TemplateResponse(request, "transactions.html", {
|
||||||
"transactions": txs,
|
"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(),
|
"categories": session.execute(select(Category)).scalars().all(),
|
||||||
"filters": {
|
"filters": {
|
||||||
"account_id": account_id,
|
"account_id": account_id,
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
{% for tx in transactions %}
|
{% for tx in transactions %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ tx.booking_date.strftime('%d.%m.%Y') }}</td>
|
<td>{{ tx.booking_date.strftime('%d.%m.%Y') }}</td>
|
||||||
<td>{{ tx.account_id }}</td>
|
<td>{{ account_names.get(tx.account_id, tx.account_id) }}</td>
|
||||||
<td>{{ tx.purpose }}</td>
|
<td>{{ tx.purpose }}</td>
|
||||||
<td>{{ tx.counterparty }}</td>
|
<td>{{ tx.counterparty }}</td>
|
||||||
<td class="{{ 'neg' if tx.amount < 0 else '' }}">{{ '%.2f'|format(tx.amount) }} €</td>
|
<td class="{{ 'neg' if tx.amount < 0 else '' }}">{{ '%.2f'|format(tx.amount) }} €</td>
|
||||||
@@ -128,7 +128,9 @@
|
|||||||
var out = {};
|
var out = {};
|
||||||
for (var k in parameters) {
|
for (var k in parameters) {
|
||||||
var v = parameters[k];
|
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;
|
var kind = field && field.dataset ? field.dataset.type : null;
|
||||||
if (v === '') {
|
if (v === '') {
|
||||||
out[k] = null;
|
out[k] = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user