unbekannte Buchungen

This commit is contained in:
hubobel 2026-06-21 17:14:40 +02:00
parent 75d20b03a7
commit 7f87ec435c
2 changed files with 124 additions and 0 deletions

13
app.py
View file

@ -78,6 +78,7 @@ def get_current_week_data():
summary = None
transactions = []
unknown_transactions = []
total_income = 0
total_expenses = 0
@ -106,12 +107,22 @@ def get_current_week_data():
) as f:
transactions = json.load(f)
for transaction in transactions:
if (
transaction.get("category")
== "Unbekannt"
):
unknown_transactions.append(
transaction
)
return (
year,
week,
summary,
transactions,
unknown_transactions,
total_income,
total_expenses,
total_saldo
@ -176,6 +187,7 @@ def index():
week,
summary,
transactions,
unknown_transactions,
total_income,
total_expenses,
total_saldo
@ -189,6 +201,7 @@ def index():
week=week,
summary=summary,
transactions=transactions,
unknown_transactions=unknown_transactions,
total_income=total_income,
total_expenses=total_expenses,
total_saldo=total_saldo,

View file

@ -161,6 +161,62 @@
{% endfor %}
</tbody>
</table>
<div class="card">
<h2>
Unbekannte Buchungen
</h2>
{% if unknown_transactions %}
<p>
{{ unknown_transactions|length }}
Buchungen offen
</p>
<table class="transaction-table">
{% for t in unknown_transactions[:5] %}
<tr>
<td>
{{ t.date }}
</td>
<td>
{{ t.applicant_name }}
</td>
<td>
{{ "%.2f"|format(t.amount) }} €
</td>
</tr>
{% endfor %}
</table>
<br>
<a href="/categories">
<button type="button">
Kategorien öffnen
</button>
</a>
{% else %}
<p>
Keine unbekannten Buchungen.
</p>
{% endif %}
</div>
</div>
{% else %}
@ -171,7 +227,62 @@
{% endif %}
</div>
<div class="card">
<h2>
Unbekannte Buchungen
</h2>
{% if unknown_transactions %}
<p>
{{ unknown_transactions|length }}
Buchungen offen
</p>
<table class="transaction-table">
{% for t in unknown_transactions[:5] %}
<tr>
<td>
{{ t.date }}
</td>
<td>
{{ t.applicant_name }}
</td>
<td>
{{ "%.2f"|format(t.amount) }} €
</td>
</tr>
{% endfor %}
</table>
<br>
<a href="/categories">
<button type="button">
Kategorien öffnen
</button>
</a>
{% else %}
<p>
Keine unbekannten Buchungen.
</p>
{% endif %}
</div>
</div>
</div>