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:
@@ -259,7 +259,16 @@ const OrdersTab = ({ orderIdFromHash, t }) => {
|
||||
</Box>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{order.items.reduce(
|
||||
{order.items
|
||||
.filter(item => {
|
||||
// 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
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user