From 88bf0a57e2bf2efc7f78b391d53802d8a0a7491a Mon Sep 17 00:00:00 2001 From: Dicken Date: Tue, 26 May 2026 13:14:03 +0200 Subject: [PATCH] Dateien nach "backend/src/tools/bestellungen" hochladen --- backend/src/tools/bestellungen/routes.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/src/tools/bestellungen/routes.js b/backend/src/tools/bestellungen/routes.js index 58cd5f6..9c4ddb3 100644 --- a/backend/src/tools/bestellungen/routes.js +++ b/backend/src/tools/bestellungen/routes.js @@ -31,7 +31,8 @@ router.get('/', authenticate, (req, res) => { COUNT(oi.id) AS item_count, SUM(COALESCE(oi.qty_fertig,0)) AS qty_fertig_total, SUM(COALESCE(oi.stueckzahl,0)) AS qty_total, - SUM(COALESCE(oi.custom_price,0) * COALESCE(oi.stueckzahl,0)) AS custom_price_sum + SUM(COALESCE(oi.custom_price,0) * COALESCE(oi.stueckzahl,0)) AS custom_price_sum, + SUM(COALESCE(oi.stunden,0) * COALESCE(oi.stueckzahl,0)) AS stunden_total FROM orders o LEFT JOIN order_items oi ON oi.order_id = o.id WHERE o.user_id = ? @@ -100,10 +101,10 @@ router.post('/:id/items', authenticate, (req, res) => { } else { db.prepare(`INSERT INTO order_items (order_id,calculation_id,calc_name,preis_freundschaft,preis_normal,preis_auftrag, - stueckzahl,custom_price,status,qty_warteliste,qty_in_arbeit,qty_fertig) - VALUES (?,?,?,?,?,?,?,?,'warteliste',?,0,0)`) + stueckzahl,custom_price,status,qty_warteliste,qty_in_arbeit,qty_fertig,stunden) + VALUES (?,?,?,?,?,?,?,?,'warteliste',?,0,0,?)`) .run(req.params.id, calc.id, calc.name, calc.preis_freundschaft, calc.preis_normal, calc.preis_auftrag, - stueckzahl, custom_price, stueckzahl); + stueckzahl, custom_price, stueckzahl, calc.stunden || 0); } autoUpdateOrderStatus(req.params.id); res.json(loadOrder(req.params.id, uid(req)));