From 7f87ec435c1981b0d9616e8da725583cd5099679 Mon Sep 17 00:00:00 2001 From: hubobel Date: Sun, 21 Jun 2026 17:14:40 +0200 Subject: [PATCH] unbekannte Buchungen --- app.py | 13 +++++ templates/index.html | 111 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) diff --git a/app.py b/app.py index d197578..0b814de 100644 --- a/app.py +++ b/app.py @@ -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, diff --git a/templates/index.html b/templates/index.html index 2473cb9..1d5a838 100644 --- a/templates/index.html +++ b/templates/index.html @@ -161,6 +161,62 @@ {% endfor %} +
+ +

+ Unbekannte Buchungen +

+ + {% if unknown_transactions %} + +

+ {{ unknown_transactions|length }} + Buchungen offen +

+ + + + {% for t in unknown_transactions[:5] %} + + + + + + + + + + + + {% endfor %} + +
+ {{ t.date }} + + {{ t.applicant_name }} + + {{ "%.2f"|format(t.amount) }} € +
+ +
+ + + + + + + + {% else %} + +

+ Keine unbekannten Buchungen. +

+ + {% endif %} + +
{% else %} @@ -171,7 +227,62 @@ {% endif %} +
+

+ Unbekannte Buchungen +

+ + {% if unknown_transactions %} + +

+ {{ unknown_transactions|length }} + Buchungen offen +

+ + + + {% for t in unknown_transactions[:5] %} + + + + + + + + + + + + {% endfor %} + +
+ {{ t.date }} + + {{ t.applicant_name }} + + {{ "%.2f"|format(t.amount) }} € +
+ +
+ + + + + + + + {% else %} + +

+ Keine unbekannten Buchungen. +

+ + {% endif %} + +