Archiv: Datei-Badge, Bestellungen: Preiskategorie als Festpreis übernehmen
This commit is contained in:
@@ -375,15 +375,25 @@ function BestellungDetail({ id, toast, onBack }) {
|
||||
<div style={{...S.card,marginBottom:10}}>
|
||||
<div style={S.head}>GESAMTSUMME</div>
|
||||
<div style={{display:'grid',gridTemplateColumns:'1fr 1fr 1fr',gap:8,marginBottom:totals.has_any_custom||order.custom_price?12:0}}>
|
||||
{PREISE.map(p=>(
|
||||
<div key={p.key} style={{background:`${p.c}10`,border:`1px solid ${p.c}30`,borderRadius:9,padding:'10px 8px',textAlign:'center'}}>
|
||||
<div style={{fontSize:16,marginBottom:2}}>{p.emoji}</div>
|
||||
<div style={{color:'rgba(255,255,255,0.6)',fontSize:9,fontFamily:'monospace',marginBottom:3}}>{p.label}</div>
|
||||
<div style={{color:p.c,fontFamily:"'Space Mono',monospace",fontSize:16,fontWeight:700}}>
|
||||
{totals[p.key].toFixed(2)}€
|
||||
{PREISE.map(p=>{
|
||||
const canSelect = !order.bezahlt && order.custom_price == null && !totals.has_any_custom;
|
||||
return (
|
||||
<div key={p.key}
|
||||
onClick={() => canSelect && api(`/tools/bestellungen/${id}`,{method:'PUT',body:{custom_price:totals[p.key]}}).then(u=>{setOrder(u);setForm(f=>({...f,custom_price:totals[p.key].toFixed(2)}));toast(`${p.label}-Preis übernommen`);}).catch(e=>toast(e.message,'error'))}
|
||||
title={canSelect ? `${p.label}-Preis als Festpreis übernehmen` : undefined}
|
||||
style={{background:`${p.c}10`,border:`1px solid ${p.c}30`,borderRadius:9,padding:'10px 8px',textAlign:'center',
|
||||
cursor:canSelect?'pointer':'default',
|
||||
transition:'background 0.15s',
|
||||
...(canSelect?{':hover':{background:`${p.c}20`}}:{})}}>
|
||||
<div style={{fontSize:16,marginBottom:2}}>{p.emoji}</div>
|
||||
<div style={{color:'rgba(255,255,255,0.6)',fontSize:9,fontFamily:'monospace',marginBottom:3}}>{p.label}</div>
|
||||
<div style={{color:p.c,fontFamily:"'Space Mono',monospace",fontSize:16,fontWeight:700}}>
|
||||
{totals[p.key].toFixed(2)}€
|
||||
</div>
|
||||
{canSelect && <div style={{color:`${p.c}80`,fontSize:8,fontFamily:'monospace',marginTop:3}}>↑ übernehmen</div>}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
{totals.has_any_custom && (
|
||||
<div style={{padding:'10px 14px',background:'rgba(255,255,255,0.04)',border:'1px solid rgba(255,255,255,0.1)',borderRadius:8,display:'flex',justifyContent:'space-between',alignItems:'center',marginBottom:8}}>
|
||||
|
||||
Reference in New Issue
Block a user