Kontrolle: Rechnungsdialog zeigt bei Stripe-Ausfall keine Beträge und keine Vorgabe
Bei stripeOk false steht 'Stripe nicht erreichbar – Beträge unbekannt' statt 'bereits berechnet 0,00 €', und es wird keine Rechnungsart vorgeschlagen. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
07d36f64e9
commit
79f230ea2c
3 files changed
+42
-9
No files matched your search
@@ -17,7 +17,7 @@ import {
|
||||
useWeitereBlaetter,
|
||||
} from '../../hooks/useRechnungDaten'
|
||||
import { createInvoice } from '../../lib/financeApi'
|
||||
import { canInvoice, euro } from '../../lib/financeFormat'
|
||||
import { canInvoice } from '../../lib/financeFormat'
|
||||
import {
|
||||
ADDRESS_INCOMPLETE_TEXT,
|
||||
INVOICE_LIMITS,
|
||||
@@ -33,8 +33,8 @@ import {
|
||||
abLabel,
|
||||
anzahlungStandard,
|
||||
artOptionen,
|
||||
abSummenText,
|
||||
aufwandAuftrag,
|
||||
berechnetFuerAuftrag,
|
||||
gueltigeFestpreisAbs,
|
||||
projektOptionen,
|
||||
standardArt,
|
||||
@@ -129,9 +129,10 @@ function RechnungFormular({ onClose, onCreated, projektId, auftraegeAktiv, onSho
|
||||
if (projekt === '') optionen = artOptionen({ projektId: '', auftraege: [], rechnungen: [], auftraegeAktiv: aktiv })
|
||||
else if (projekt && detail.data) optionen = artOptionen({ projektId: projekt, auftraege, rechnungen, auftraegeAktiv: aktiv })
|
||||
|
||||
const stripeOk = detail.data?.stripeOk
|
||||
const art = optionen.some((o) => o.key === state.art && o.enabled)
|
||||
? state.art
|
||||
: standardArt(optionen, { auftraege, rechnungen, offeneMinuten: detail.data?.konto?.zeit?.offeneMinuten || 0 })
|
||||
: standardArt(optionen, { auftraege, rechnungen, offeneMinuten: detail.data?.konto?.zeit?.offeneMinuten || 0, stripeOk })
|
||||
|
||||
const festpreisAbs = gueltigeFestpreisAbs(auftraege)
|
||||
const auftragId =
|
||||
@@ -268,7 +269,6 @@ function RechnungFormular({ onClose, onCreated, projektId, auftraegeAktiv, onSho
|
||||
|
||||
const abBlock = () => {
|
||||
if (!ab) return null
|
||||
const berechnet = berechnetFuerAuftrag(rechnungen, ab.id)
|
||||
return (
|
||||
<div className="rd-stack">
|
||||
{festpreisAbs.length > 1 ? (
|
||||
@@ -284,9 +284,7 @@ function RechnungFormular({ onClose, onCreated, projektId, auftraegeAktiv, onSho
|
||||
) : (
|
||||
<p className="rd-hint">{abLabel(ab)}</p>
|
||||
)}
|
||||
<p className="rd-hint">
|
||||
Auftragssumme {euro(ab.summeCents)} · bereits berechnet {euro(berechnet)} · noch nicht berechnet {euro(Math.max(0, ab.summeCents - berechnet))}
|
||||
</p>
|
||||
<p className="rd-hint">{abSummenText({ ab, rechnungen, stripeOk })}</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user