0.34.0: Übersicht mit Projektfarben, zweizeiligen Aufgaben und Geldfluss ohne Kontostand
Some checks failed
Prüfung / tests (push) Has been cancelled
Prüfung / container (push) Has been cancelled

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
Claude
2026-10-23 06:55:07 +00:00
parent 7314a63901
commit e348fd040c
15 changed files with 205 additions and 27 deletions

View File

@@ -37,6 +37,16 @@ export function laufendJeMonat(laufend: LaufendeKosten[], heute: Datum): Cent {
return Math.round(summe);
}
/** Geldfluss einer Woche ohne Kontostand (Henning, 23.10.2026); Kosten positiv, Umsatzsteuer: Zahllast positiv, Erstattung negativ */
export interface Fluss { von: Datum; bis: Datum; einnahmen: Cent; projektkosten: Cent; laufend: Cent; ust: Cent }
export function flussJeWoche(wochen: Periode[]): Fluss[] {
return wochen.map((w) => {
const summe = (g: Posten["gruppe"]) => w.posten.filter((p) => p.gruppe === g).reduce((s, p) => s + p.betrag, 0);
return { von: w.von, bis: w.bis, einnahmen: summe("Projekteinnahmen"), projektkosten: -summe("Projektkosten"), laufend: -summe("Laufende Kosten"), ust: -summe("Umsatzsteuer") };
});
}
export function lage(wochen: Periode[], kontostand: Cent, mindestgrenze: Cent): Lage {
const frei = kontostand - mindestgrenze;
if (!wochen.length) return { frei, ampel: kontostand < 0 ? "rot" : kontostand < mindestgrenze ? "gelb" : "gruen", tief: null, abstand: frei, grund: [], danach: null };