Dateien nach "frontend/src/tools" hochladen
This commit is contained in:
@@ -3,6 +3,12 @@ import { useState, useEffect, useMemo } from 'react';
|
||||
import { api, S } from '../lib.js';
|
||||
import { SearchIcon, PlusIcon, XIcon, EditIcon, TrashIcon, ChevronIcon } from '../icons.jsx';
|
||||
|
||||
const fmtH = h => {
|
||||
if (!h) return '0h';
|
||||
const hh = Math.floor(h), mm = Math.round((h - hh) * 60);
|
||||
return mm > 0 ? `${hh}h ${mm}m` : `${hh}h`;
|
||||
};
|
||||
|
||||
const STATUS = {
|
||||
warteliste: { label:'Warteliste', color:'#ffe66d', bg:'rgba(255,230,109,0.12)' },
|
||||
in_arbeit: { label:'In Arbeit', color:'#4ecdc4', bg:'rgba(78,205,196,0.12)' },
|
||||
@@ -58,6 +64,7 @@ function BestellungDetail({ id, toast, onBack }) {
|
||||
auftrag: items.reduce((s,i) => s + i.preis_auftrag * i.stueckzahl, 0),
|
||||
custom_sum: items.reduce((s,i) => s + (i.custom_price != null ? i.custom_price * i.stueckzahl : 0), 0),
|
||||
has_any_custom: items.some(i => i.custom_price != null),
|
||||
stunden_total: items.reduce((s,i) => s + (i.stunden||0) * i.stueckzahl, 0),
|
||||
};
|
||||
}, [order]);
|
||||
|
||||
@@ -251,6 +258,16 @@ function BestellungDetail({ id, toast, onBack }) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Druckzeit der Position */}
|
||||
{item.stunden > 0 && (
|
||||
<div style={{marginBottom:8,display:'flex',alignItems:'center',gap:6}}>
|
||||
<span style={{color:'rgba(255,255,255,0.5)',fontFamily:'monospace',fontSize:11}}>⏱ Druckzeit:</span>
|
||||
<span style={{color:'#fff',fontFamily:"'Space Mono',monospace",fontSize:11,fontWeight:700}}>
|
||||
{fmtH(item.stunden)} × {item.stueckzahl} = {fmtH(item.stunden * item.stueckzahl)}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Stückzahl gesamt + Festpreis */}
|
||||
<div style={{display:'grid',gridTemplateColumns:'1fr 1fr',gap:8,marginBottom:10}}>
|
||||
<div>
|
||||
@@ -376,6 +393,14 @@ function BestellungDetail({ id, toast, onBack }) {
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{totals.stunden_total > 0 && (
|
||||
<div style={{padding:'10px 14px',background:'rgba(255,255,255,0.04)',border:'1px solid rgba(255,255,255,0.08)',borderRadius:8,display:'flex',justifyContent:'space-between',alignItems:'center'}}>
|
||||
<span style={{color:'rgba(255,255,255,0.55)',fontFamily:'monospace',fontSize:12}}>⏱ Gesamt-Druckzeit</span>
|
||||
<span style={{color:'#fff',fontFamily:"'Space Mono',monospace",fontSize:16,fontWeight:700}}>
|
||||
{fmtH(totals.stunden_total)}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{order.custom_price != null && (
|
||||
<div style={{padding:'10px 14px',background:'rgba(255,255,255,0.06)',border:'1px solid rgba(255,255,255,0.15)',borderRadius:8,display:'flex',justifyContent:'space-between',alignItems:'center'}}>
|
||||
<span style={{color:'rgba(255,255,255,0.6)',fontFamily:'monospace',fontSize:12}}>Gesamt-Festpreis</span>
|
||||
@@ -647,18 +672,25 @@ export default function Bestellungen({ toast, mobile }) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Positions-Fortschritt + Festpreis-Summe */}
|
||||
<div style={{display:'flex',justifyContent:'space-between',alignItems:'center',marginBottom:8}}>
|
||||
<div style={{display:'flex',alignItems:'center',gap:6}}>
|
||||
{/* Positions-Fortschritt + Zeit + Festpreis-Summe */}
|
||||
<div style={{display:'flex',justifyContent:'space-between',alignItems:'center',marginBottom:8,flexWrap:'wrap',gap:4}}>
|
||||
<div style={{display:'flex',alignItems:'center',gap:6,flexWrap:'wrap'}}>
|
||||
<div style={{
|
||||
fontSize:10,fontFamily:'monospace',
|
||||
color: allDone?'#6bcb77':'rgba(255,255,255,0.4)',
|
||||
color: allDone?'#6bcb77':'rgba(255,255,255,0.5)',
|
||||
background: allDone?'rgba(107,203,119,0.12)':'rgba(255,255,255,0.05)',
|
||||
border:`1px solid ${allDone?'rgba(107,203,119,0.3)':'rgba(255,255,255,0.08)'}`,
|
||||
borderRadius:12,padding:'2px 8px',
|
||||
}}>
|
||||
{done}/{total} fertig
|
||||
</div>
|
||||
{order.stunden_total > 0 && (
|
||||
<div style={{fontSize:10,fontFamily:'monospace',color:'rgba(255,255,255,0.5)',
|
||||
background:'rgba(255,255,255,0.05)',border:'1px solid rgba(255,255,255,0.08)',
|
||||
borderRadius:12,padding:'2px 8px'}}>
|
||||
⏱ {fmtH(order.stunden_total)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{(order.custom_price != null || customSum > 0) && (
|
||||
<div style={{color:'rgba(255,255,255,0.5)',fontFamily:"'Space Mono',monospace",fontSize:12}}>
|
||||
@@ -696,9 +728,9 @@ export default function Bestellungen({ toast, mobile }) {
|
||||
<span style={{color:'rgba(255,255,255,0.75)',fontFamily:'monospace',fontSize:12,flex:1,
|
||||
overflow:'hidden',textOverflow:'ellipsis',whiteSpace:'nowrap'}}>{item.calc_name}</span>
|
||||
)}
|
||||
{/* Stückzahl */}
|
||||
<span style={{color:'rgba(255,255,255,0.45)',fontFamily:'monospace',fontSize:11,flexShrink:0}}>
|
||||
×{item.stueckzahl}
|
||||
{/* Stückzahl + Druckzeit */}
|
||||
<span style={{color:'rgba(255,255,255,0.55)',fontFamily:'monospace',fontSize:11,flexShrink:0}}>
|
||||
×{item.stueckzahl}{item.stunden>0?` · ${fmtH(item.stunden*item.stueckzahl)}`:''}
|
||||
</span>
|
||||
{/* Status Zähler kompakt */}
|
||||
<div style={{display:'flex',gap:3,flexShrink:0}}>
|
||||
|
||||
Reference in New Issue
Block a user