feat: Kategorien aus Auswertungen ausnehmen (z. B. „Kontoübertrag")

Umbuchungen zwischen eigenen Konten sind keine Ausgabe – das Geld ist nicht weg,
es liegt woanders. Bisher blieb nur die Wahl zwischen einer echten Transfer-
Buchung (bildet die Wirklichkeit ab, braucht aber auf beiden Seiten passende
Regeln und schätzt bei Fremdwährung den Gegenwert) oder einer gewöhnlichen
Ausgabe, die Budget und Statistik verfälscht.

Kategorien haben jetzt den Schalter „Nicht in Auswertungen einrechnen": Die
Buchung wirkt weiter auf den Kontostand, bleibt aber aus Budget, Dashboard und
Auswertungen heraus. Gefiltert wird zentral in actual_expense_by_category und
income_by_category – damit greift es zugleich für Budget-Donut, Budget-
Fortschritt, Einnahmen/Ausgaben, Ausgaben-Anteile und die Budget-Seite.

Das ersetzt die Transfer-Paarung nicht, es ist der einfachere Weg: kein
Gegenkonto, keine Kursschätzung, dafür ohne Verbindung zwischen den beiden Seiten.

Migration 0013, Schalter im Kategorie-Dialog, Kennzeichnung in der Liste, Test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Guido
2026-08-21 10:17:20 +02:00
co-authored by Claude Opus 4.8
parent ec0aa62017
commit 5c8b53a995
9 changed files with 142 additions and 7 deletions
+4 -1
View File
@@ -212,7 +212,10 @@
"keywordAddBtn": "Hinzufügen",
"keywordEditHint": "Doppelklick auf ein Schlagwort lädt es mit Betrag oben zum Bearbeiten.",
"keywordEditing": "Vorhandenes Schlagwort wird bearbeitet – Escape bricht ab.",
"searchPlaceholder": "Kategorie suchen …"
"searchPlaceholder": "Kategorie suchen …",
"excludedFromStats": "Nicht in Auswertungen einrechnen",
"excludedHint": "Für Umbuchungen zwischen eigenen Konten: Der Kontostand ändert sich, aber Budget, Dashboard und Statistik lassen diese Buchungen außen vor – das Geld ist ja nicht ausgegeben.",
"excludedShort": "neutral"
},
"transactions": {
"title": "Buchungen",
+4 -1
View File
@@ -212,7 +212,10 @@
"keywordAddBtn": "Add",
"keywordEditHint": "Double-click a keyword to load it, with its amount, into the row above.",
"keywordEditing": "Editing an existing keyword – press Escape to cancel.",
"searchPlaceholder": "Search category …"
"searchPlaceholder": "Search category …",
"excludedFromStats": "Exclude from reports",
"excludedHint": "For transfers between your own accounts: the balance still changes, but budget, dashboard and statistics leave these out – the money was not spent.",
"excludedShort": "neutral"
},
"transactions": {
"title": "Transactions",
+20 -4
View File
@@ -196,8 +196,9 @@ export default function Categories() {
editing,
groupId,
form: editing
? { name: editing.name, icon: editing.icon, color: editing.color }
: { name: "", icon: "more-horizontal", color: "#6b7480" },
? { name: editing.name, icon: editing.icon, color: editing.color,
excluded_from_stats: !!editing.excluded_from_stats }
: { name: "", icon: "more-horizontal", color: "#6b7480", excluded_from_stats: false },
});
}
@@ -209,8 +210,10 @@ export default function Categories() {
if (editing) await api.updateGroup(editing.id, { name: form.name.trim(), icon: form.icon, color: form.color });
else await api.createGroup({ name: form.name.trim(), kind: form.kind, icon: form.icon, color: form.color });
} else {
if (editing) await api.updateCategory(editing.id, { name: form.name.trim(), icon: form.icon, color: form.color });
else await api.createCategory({ group_id: groupId, name: form.name.trim(), icon: form.icon, color: form.color });
const rumpf = { name: form.name.trim(), icon: form.icon, color: form.color,
excluded_from_stats: !!form.excluded_from_stats };
if (editing) await api.updateCategory(editing.id, rumpf);
else await api.createCategory({ group_id: groupId, ...rumpf });
}
setModal(null);
laden();
@@ -272,6 +275,9 @@ export default function Categories() {
<Icon name="tags" size={14} />
{c.keyword_count ? <span className="kw-btn-zahl">{c.keyword_count}</span> : null}
</button>
{c.excluded_from_stats && (
<span className="badge" title={t("categories.excludedHint")}>{t("categories.excludedShort")}</span>
)}
<button className="btn sm ghost" title={t("common.edit")} onClick={() => openCategory(g.id, c)}>
<Icon name="edit" size={14} />
</button>
@@ -325,6 +331,16 @@ export default function Categories() {
<IconPicker icons={CATEGORY_ICONS} value={modal.form.icon} color={modal.form.color}
onChange={(name) => setModal({ ...modal, form: { ...modal.form, icon: name } })} />
</label>
{modal.type === "category" && (
<>
<label className="checkline">
<input type="checkbox" checked={!!modal.form.excluded_from_stats}
onChange={(e) => setModal({ ...modal, form: { ...modal.form, excluded_from_stats: e.target.checked } })} />
<span>{t("categories.excludedFromStats")}</span>
</label>
<p className="muted small" style={{ marginTop: -6 }}>{t("categories.excludedHint")}</p>
</>
)}
<label>
<span>{t("accounts.color")}</span>
<div className="color-row">