Bestellungen: Festpreis pro Position zurücksetzen

This commit is contained in:
2026-05-28 13:22:40 +02:00
parent fb8562db7a
commit 188f121cda

View File

@@ -282,18 +282,26 @@ function BestellungDetail({ id, toast, onBack }) {
</div> </div>
<div> <div>
<div style={{...S.head,marginBottom:4}}>FESTPREIS/STK ()</div> <div style={{...S.head,marginBottom:4}}>FESTPREIS/STK ()</div>
<input type="number" step="0.01" min="0" <div style={{display:'flex',gap:6,alignItems:'stretch'}}>
defaultValue={item.custom_price??''} <input type="number" step="0.01" min="0"
placeholder="" defaultValue={item.custom_price??''}
readOnly={!!order.bezahlt} placeholder=""
onBlur={e=>{ readOnly={!!order.bezahlt}
if (!!order.bezahlt) return; onBlur={e=>{
const v = e.target.value==='' ? null : parseFloat(e.target.value); if (!!order.bezahlt) return;
updateItem(item.id, {custom_price:v}); const v = e.target.value==='' ? null : parseFloat(e.target.value);
}} updateItem(item.id, {custom_price:v});
style={{...S.inp,fontSize:14,padding:'8px 10px', }}
opacity:!!order.bezahlt?0.5:1, style={{...S.inp,fontSize:14,padding:'8px 10px',flex:1,
cursor:!!order.bezahlt?'not-allowed':'text'}}/> opacity:!!order.bezahlt?0.5:1,
cursor:!!order.bezahlt?'not-allowed':'text'}}/>
{item.custom_price!=null && !order.bezahlt && (
<button
onClick={()=>updateItem(item.id,{custom_price:null})}
title="Festpreis zurücksetzen"
style={{...S.btn('#ff6b9d',true),padding:'0 10px',flexShrink:0,fontSize:14}}></button>
)}
</div>
</div> </div>
</div> </div>