diff --git a/frontend/src/tools/bestellungen.jsx b/frontend/src/tools/bestellungen.jsx index 16f54e1..21e2777 100644 --- a/frontend/src/tools/bestellungen.jsx +++ b/frontend/src/tools/bestellungen.jsx @@ -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 }) { + {/* Druckzeit der Position */} + {item.stunden > 0 && ( +