diff --git a/frontend/src/tools/bestellungen.jsx b/frontend/src/tools/bestellungen.jsx index 0cdcaf8..5c32ec3 100644 --- a/frontend/src/tools/bestellungen.jsx +++ b/frontend/src/tools/bestellungen.jsx @@ -45,6 +45,11 @@ function BestellungDetail({ id, toast, onBack }) { const [pickerSearch,setPickerSearch]= useState(''); const [editMode, setEditMode] = useState(false); const [form, setForm] = useState({ name:'', bemerkung:'', custom_price:'', status:'warteliste' }); + const today = () => new Date().toISOString().slice(0,10); + const [bezahltDate, setBezahltDate] = useState(today()); + const [abgeholtDate, setAbgeholtDate] = useState(today()); + const [showBezahltPicker, setShowBezahltPicker] = useState(false); + const [showAbgeholtPicker, setShowAbgeholtPicker] = useState(false); useEffect(() => { api('/tools/kalkulator3d').then(d => setArchiv(d.own || d || [])).catch(()=>{}); @@ -124,12 +129,6 @@ function BestellungDetail({ id, toast, onBack }) { return 'warteliste'; }; - const today = () => new Date().toISOString().slice(0,10); - const [bezahltDate, setBezahltDate] = useState(today()); - const [abgeholtDate, setAbgeholtDate] = useState(today()); - const [showBezahltPicker, setShowBezahltPicker] = useState(false); - const [showAbgeholtPicker, setShowAbgeholtPicker] = useState(false); - function toggleBezahlt() { if (!order.bezahlt) { // Noch nicht bezahlt → Datum-Picker anzeigen