feat: Salden-Seite mit Stichtag und Monatsuebersicht
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
<a href="/">Übersicht</a>
|
||||
<a href="/import">Import</a>
|
||||
<a href="/buchungen">Buchungen</a>
|
||||
<a href="/salden">Salden</a>
|
||||
<a href="/planung">Planung</a>
|
||||
<a href="/hilfe">Hilfe</a>
|
||||
<a href="http://{{ request.url.hostname or '127.0.0.1' }}:8097" target="_blank" rel="noopener">Grafana</a>
|
||||
|
||||
@@ -35,6 +35,15 @@
|
||||
seine Buchungen), z. B. um einen Auszug mit einem verbesserten Parser neu
|
||||
zu importieren; einzelne Buchungen bleiben unlöschbar.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Salden-Seite:</strong> zeigt den Saldo je Konto zu einem
|
||||
wählbaren Stichtag (Default: heute) sowie eine Monatsanfangs-Übersicht
|
||||
vom frühesten Buchungsmonat bis heute, absteigend. Die
|
||||
Monatsanfangs-Werte gelten "Stand: Ende des Vortags" (letzter Tag des
|
||||
Vormonats), damit Buchungen am 1. eines Monats den Ausweis des
|
||||
Monatsanfangs nicht verfälschen. Konten ohne Anker sind mit "ohne Anker —
|
||||
relative Werte" gekennzeichnet.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Kategorien & Regeln:</strong> Buchungen lassen sich kategorisieren;
|
||||
eine Regel ("Muster im Text → Kategorie") kategorisiert künftige Importe
|
||||
|
||||
67
finance/app/templates/salden.html
Normal file
67
finance/app/templates/salden.html
Normal file
@@ -0,0 +1,67 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Salden – Finanzberatung{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Salden</h1>
|
||||
|
||||
<h2>Salden am {{ stichtag.strftime('%d.%m.%Y') }}</h2>
|
||||
<form method="get" action="/salden" class="inline-form">
|
||||
<input type="date" name="stichtag" value="{{ stichtag.isoformat() }}">
|
||||
<button type="submit">Anzeigen</button>
|
||||
</form>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Konto</th><th>Saldo</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for account, balance in balances %}
|
||||
<tr>
|
||||
<td class="account">{{ account.name }}</td>
|
||||
<td class="amount {{ 'neg' if balance < 0 else '' }}">{{ '%.2f'|format(balance) }} €</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="2">Keine Konten angelegt.</td></tr>
|
||||
{% endfor %}
|
||||
<tr class="total-row">
|
||||
<td><strong>Gesamt</strong></td>
|
||||
<td class="amount {{ 'neg' if total < 0 else '' }}"><strong>{{ '%.2f'|format(total) }} €</strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2>Monatsanfangs-Übersicht</h2>
|
||||
<p class="hint">
|
||||
Stand: Ende des Vortags (letzter Tag des Vormonats) — Buchungen am 1. eines
|
||||
Monats zählen bewusst noch nicht zum "Anfangs"-Saldo, sonst würde der
|
||||
Monatsanfang durch Buchungen des laufenden Monats verzerrt.
|
||||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Monat</th>
|
||||
{% for account in accounts %}<th>{{ account.name }}</th>{% endfor %}
|
||||
<th>Gesamt</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in months %}
|
||||
<tr data-month="{{ row['month'].isoformat() }}">
|
||||
<td>{{ row['month'].strftime('%m.%Y') }}</td>
|
||||
{% for account, value in row['values'] %}
|
||||
<td class="amount {{ 'neg' if value < 0 else '' }}">{{ '%.2f'|format(value) }} €</td>
|
||||
{% endfor %}
|
||||
<td class="amount {{ 'neg' if row['total'] < 0 else '' }}">{{ '%.2f'|format(row['total']) }} €</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="{{ accounts|length + 2 }}">Keine bestätigten Buchungen vorhanden.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if accounts_without_anchor %}
|
||||
<p class="hint">
|
||||
Fußnote „ohne Anker — relative Werte" (Basis 0 statt Datei-Kontostand) gilt für:
|
||||
{{ accounts_without_anchor|map(attribute='name')|join(', ') }}.
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user