unbekannte Buchungen
This commit is contained in:
parent
75d20b03a7
commit
7f87ec435c
2 changed files with 124 additions and 0 deletions
13
app.py
13
app.py
|
|
@ -78,6 +78,7 @@ def get_current_week_data():
|
||||||
|
|
||||||
summary = None
|
summary = None
|
||||||
transactions = []
|
transactions = []
|
||||||
|
unknown_transactions = []
|
||||||
|
|
||||||
total_income = 0
|
total_income = 0
|
||||||
total_expenses = 0
|
total_expenses = 0
|
||||||
|
|
@ -106,12 +107,22 @@ def get_current_week_data():
|
||||||
) as f:
|
) as f:
|
||||||
|
|
||||||
transactions = json.load(f)
|
transactions = json.load(f)
|
||||||
|
for transaction in transactions:
|
||||||
|
|
||||||
|
if (
|
||||||
|
transaction.get("category")
|
||||||
|
== "Unbekannt"
|
||||||
|
):
|
||||||
|
unknown_transactions.append(
|
||||||
|
transaction
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
year,
|
year,
|
||||||
week,
|
week,
|
||||||
summary,
|
summary,
|
||||||
transactions,
|
transactions,
|
||||||
|
unknown_transactions,
|
||||||
total_income,
|
total_income,
|
||||||
total_expenses,
|
total_expenses,
|
||||||
total_saldo
|
total_saldo
|
||||||
|
|
@ -176,6 +187,7 @@ def index():
|
||||||
week,
|
week,
|
||||||
summary,
|
summary,
|
||||||
transactions,
|
transactions,
|
||||||
|
unknown_transactions,
|
||||||
total_income,
|
total_income,
|
||||||
total_expenses,
|
total_expenses,
|
||||||
total_saldo
|
total_saldo
|
||||||
|
|
@ -189,6 +201,7 @@ def index():
|
||||||
week=week,
|
week=week,
|
||||||
summary=summary,
|
summary=summary,
|
||||||
transactions=transactions,
|
transactions=transactions,
|
||||||
|
unknown_transactions=unknown_transactions,
|
||||||
total_income=total_income,
|
total_income=total_income,
|
||||||
total_expenses=total_expenses,
|
total_expenses=total_expenses,
|
||||||
total_saldo=total_saldo,
|
total_saldo=total_saldo,
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,62 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</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>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|
@ -171,7 +227,62 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue