Kontrolle: Rechnungsdialog übernimmt das Zahlungsziel der gewählten AB
Bei Anzahlung, Schlussrechnung und Aufwand wird 'Zahlungsziel in Tagen' mit auftrag.zahlungszielTage vorbelegt (sonst 14); eine Eingabe des Nutzers bleibt. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b7b3e834f8
commit
dec7bea7d2
5 files changed
+63
-3
No files matched your search
@@ -24,6 +24,7 @@ export function anfangszustand({ projektId = null } = {}) {
|
||||
zeitraum: '',
|
||||
zeitraumGeaendert: false,
|
||||
days: String(INVOICE_LIMITS.defaultDays),
|
||||
tageGeaendert: false,
|
||||
memo: '',
|
||||
}
|
||||
}
|
||||
@@ -35,7 +36,7 @@ function neueUid(s) {
|
||||
export function reduce(s, a) {
|
||||
switch (a?.type) {
|
||||
case 'projekt':
|
||||
return { ...anfangszustand({ projektId: a.projektId }), days: s.days, memo: s.memo }
|
||||
return { ...anfangszustand({ projektId: a.projektId }), days: s.days, tageGeaendert: s.tageGeaendert, memo: s.memo }
|
||||
case 'art':
|
||||
return {
|
||||
...s,
|
||||
@@ -84,6 +85,10 @@ export function reduce(s, a) {
|
||||
if (s.zeitraumGeaendert || s.zeitraum === a.text) return s
|
||||
return { ...s, zeitraum: a.text }
|
||||
case 'tage':
|
||||
return { ...s, days: a.wert, tageGeaendert: true }
|
||||
case 'tage-vorschlag':
|
||||
// das Zahlungsziel der gewählten AB; eine Eingabe des Nutzers überschreibt er nie
|
||||
if (s.tageGeaendert || s.days === a.wert) return s
|
||||
return { ...s, days: a.wert }
|
||||
case 'notiz':
|
||||
return { ...s, memo: a.wert }
|
||||
|
||||
Reference in new issue
Block a user