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,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)}
|
||||||
|
|||||||
Reference in New Issue
Block a user