0.34.0: Übersicht mit Projektfarben, zweizeiligen Aufgaben und Geldfluss ohne Kontostand
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:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user