Filter out delivery items in OrdersTab quantity calculation: Updated the item quantity calculation to exclude specific delivery items, improving accuracy in order summaries.

This commit is contained in:
sebseb7
2025-07-18 06:58:25 +02:00
parent c9477e53b6
commit e43b894bfc

View File

@@ -259,10 +259,19 @@ const OrdersTab = ({ orderIdFromHash, t }) => {
</Box> </Box>
</TableCell> </TableCell>
<TableCell> <TableCell>
{order.items.reduce( {order.items
(acc, item) => acc + item.quantity_ordered, .filter(item => {
0 // Exclude delivery items - backend uses deliveryMethod ID as item name
)} const itemName = item.name || '';
return itemName !== 'DHL' &&
itemName !== 'DPD' &&
itemName !== 'Sperrgut' &&
itemName !== 'Abholung';
})
.reduce(
(acc, item) => acc + item.quantity_ordered,
0
)}
</TableCell> </TableCell>
<TableCell align="right"> <TableCell align="right">
{currencyFormatter.format(total)} {currencyFormatter.format(total)}