Projektnummern: keine doppelten, Buchstabe A/P/G/I nach Status, Aufräumen (0.40.0)
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-26 09:10:25 +00:00
parent 860de6a025
commit c0dd91718e
14 changed files with 232 additions and 16 deletions

View File

@@ -7,6 +7,7 @@ import { type Client, type Pool, transaktion } from "./db.js";
import type { Einstellungen } from "./einstellungen.js";
import { mitNeuplanung } from "./terminplan.js";
import { werName } from "./anmeldung.js";
import { projektNummer } from "../domain/nummer.js";
import { type KKosten, type KPosition, type KTitel, type Saetze, berechneAngebot, naechsteNummer, pruefeAngebot, umgebungVon } from "../domain/kalkulation.js";
import { type Blatt, alsBlatt, werteBlatt } from "../domain/mengenblatt.js";
import type { Mengenvorlage } from "../domain/mengenvorlagen.js";
@@ -472,9 +473,9 @@ export function registriereAngebote(
const summe = (await c.query("select id from angebot where projekt_id = $1 and status = 'angenommen'", [pid])).rows;
let umsatz = 0;
for (const s of summe) umsatz += s.id === id ? x.ergebnis.netto : (await ladeAngebot(c, s.id, e))!.ergebnis.netto;
const nummer = /^A-/.test(p.nummer) && !(await c.query("select 1 from projekt where nummer = $1", [p.nummer.replace(/^A-/, "P-")])).rowCount
? p.nummer.replace(/^A-/, "P-") : p.nummer;
const status = ["anfrage", "angebot"].includes(p.status) ? "auftrag" : p.status;
// aus A-26-024 wird P-26-024, die Zahl bleibt (Henning, 26.10.2026)
const nummer = projektNummer(p.nummer, status);
// geplante Kosten für die Liquidität, nur wenn noch keine eingetragen sind
const leer = !Number(p.material_kosten) && !Number(p.fremd_kosten) && !Number(p.sonstige_kosten);
const ka = x.ergebnis.kostenarten;