From 1cc14b74a6d03f53302a65e524af6b70647420bc Mon Sep 17 00:00:00 2001 From: Dicken Date: Tue, 26 May 2026 13:13:25 +0200 Subject: [PATCH] Dateien nach "frontend/src/tools" hochladen --- frontend/src/tools/bestellungen.jsx | 46 ++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 7 deletions(-) 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 && ( +
+ ⏱ Druckzeit: + + {fmtH(item.stunden)} × {item.stueckzahl} = {fmtH(item.stunden * item.stueckzahl)} + +
+ )} + {/* Stückzahl gesamt + Festpreis */}
@@ -376,6 +393,14 @@ function BestellungDetail({ id, toast, onBack }) {
)} + {totals.stunden_total > 0 && ( +
+ ⏱ Gesamt-Druckzeit + + {fmtH(totals.stunden_total)} + +
+ )} {order.custom_price != null && (
Gesamt-Festpreis @@ -647,18 +672,25 @@ export default function Bestellungen({ toast, mobile }) {
- {/* Positions-Fortschritt + Festpreis-Summe */} -
-
+ {/* Positions-Fortschritt + Zeit + Festpreis-Summe */} +
+
{done}/{total} fertig
+ {order.stunden_total > 0 && ( +
+ ⏱ {fmtH(order.stunden_total)} +
+ )}
{(order.custom_price != null || customSum > 0) && (
@@ -696,9 +728,9 @@ export default function Bestellungen({ toast, mobile }) { {item.calc_name} )} - {/* Stückzahl */} - - ×{item.stueckzahl} + {/* Stückzahl + Druckzeit */} + + ×{item.stueckzahl}{item.stunden>0?` · ${fmtH(item.stunden*item.stueckzahl)}`:''} {/* Status Zähler kompakt */}