This commit is contained in:
seb
2026-10-21 04:28:58 +02:00
parent e4e4d2dcf0
commit ee0eb2820e

View File

@@ -68,7 +68,7 @@ async function enrichSingleOrder(store, googleAuthId, order) {
const shippedQuantity = calculateShippedQuantity(shipmentsList);
const allShippings = shippingsList.length > 0 ? shippingsList : shipmentsList.flatMap((s) => s.shippings || []);
const isPaid = orderTotal > 0 && Math.abs(paidTotal - orderTotal) < 0.01;
const isPaid = Math.abs(orderTotal) < 0.01 || Math.abs(paidTotal - orderTotal) < 0.01;
const isShipped = orderedQuantity > 0 && Math.abs(shippedQuantity - orderedQuantity) < 0.001;
const isDelivered = isShipped || allShippings.some((s) => s.state === 'shipped' || s.state === 'delivered');