Rechnung schreiben: neuer Dialog mit Projektwahl, Zusammenfassung, Art, Aufwand mit Vorschau, Anzahlung und Schlussrechnung

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-10-07 14:43:17 +00:00
1 parent 8ab78b7b2c
commit 2aa4abeadb
3 files changed
+604 -10

No files matched your search

+7
View File
@@ -80,12 +80,19 @@ export function useRechnungVorschau({ anfrage, schluessel, aktiv }) {
const bodyRef = useRef(null)
bodyRef.current = anfrage?.ok ? anfrage.body : null
const datenRef = useRef(null)
const kontextRef = useRef('')
useEffect(() => {
if (!aktiv || !bodyRef.current || !schluessel) {
datenRef.current = null
kontextRef.current = ''
return undefined
}
// Vorherige Zeilen bleiben nur innerhalb derselben Rechnung (Kunde, Art, Projekt, AB) abgeblendet stehen
const { customerId, art, projektId, auftragId } = bodyRef.current
const kontext = JSON.stringify([customerId, art, projektId, auftragId])
if (kontext !== kontextRef.current) datenRef.current = null
kontextRef.current = kontext
let aktuell = true
setVorschau({ key: schluessel, status: 'laedt', daten: datenRef.current })
const timer = setTimeout(async () => {