V70-Import: Freitag als Reserve- und Bürotag, Vorgänge Mo–Do neu terminiert
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-19 05:33:15 +00:00
parent 55fe69dc2b
commit f205832ea1
3 changed files with 49 additions and 21 deletions

View File

@@ -6,8 +6,10 @@ import { liquiditaet, periodenGrenzen, type Gruppe } from "../src/domain/liquidi
import { v70Ereignisse, bestandAus } from "./v70-referenz.js";
const roh = JSON.parse(readFileSync(new URL("./daten/v70-sicherung-2026-10-19.json", import.meta.url), "utf8"));
const u = uebernimmV70(roh);
const woche = { tage: u.einstellungen.arbeitstage };
// für den Vergleich mit V70 dieselbe Arbeitswoche wie dort (Mo–Fr)
const MO_FR = { tage: [1, 2, 3, 4, 5] };
const u = uebernimmV70(roh, MO_FR);
const woche = MO_FR;
describe("Euro in Cent", () => {
it.each([[24445.01, 2444501], [11663.64, 1166364], [7953.79, 795379], [16.5, 1650], [1.005, 101], [-2.675, -268], [0, 0]])(
@@ -34,15 +36,22 @@ describe("Übernahme der V70-Sicherung vom 19.10.2026", () => {
expect(u.projekte[1]).toMatchObject({ umsatz_netto: 2444501, fremd_kosten: 1166364, sonstige_kosten: 470000 });
});
it("Freitage in V70 -> Arbeitswoche Mo–Fr, Einstellungen wie V70", () => {
expect(u.einstellungen).toEqual({
arbeitstage: [1, 2, 3, 4, 5], stundenProTag: 8, produktivitaet: 1, rundung: "halb",
it("Vorgabe: Freitag ist Reserve- und Bürotag, Vorgänge auf Freitagen verschieben sich", () => {
const neu = uebernimmV70(roh);
expect(neu.einstellungen).toEqual({
arbeitstage: [1, 2, 3, 4], stundenProTag: 8, produktivitaet: 1, rundung: "halb",
zahlungsziele: { kundenTage: 14, materialTage: 7, fremdTage: 7, sonstigeTage: 7 },
});
expect(u.hinweise[0]).toMatch(/Freitag frei/);
expect(neu.hinweise[0]).toMatch(/Freitag frei.*Reserve- und Bürotag/);
const v = (name: string) => neu.vorgaenge.find((x) => x.name === name)!;
expect([v("Abbund").start, vorgangsEnde(v("Abbund"), { tage: [1, 2, 3, 4] })]).toEqual(["2026-10-26", "2026-10-26"]);
// Mo 12.10. bis Fr 16.10. = 5 Arbeitstage, jetzt bis Mo 19.10.
expect(vorgangsEnde(v("Trockenbauwände ohne WC und Bäder"), { tage: [1, 2, 3, 4] })).toBe("2026-10-19");
expect(neu.zahlungen.find((z) => z.bezeichnung === "Abschlag Abbund")!.termin).toBe("2026-10-26");
expect(neu.hinweise.find((h) => h.startsWith("Verschoben"))).toContain("Bohlentausch / Abbund: 23.10.2026–23.10.2026 → 26.10.2026–26.10.2026");
});
it("alle Termine bleiben gleich", () => {
it("mit der V70-Woche bleiben alle Termine gleich", () => {
const termine = u.vorgaenge.map((v) => [v.name, v.start, vorgangsEnde(v, woche)]);
const v70: [string, string, string][] = [];
for (const p of roh.projekte) for (const t of p.tasks ?? []) {