From 7e61b120c59e7f518d0ac03beb484c893a142240 Mon Sep 17 00:00:00 2001
From: meskio <meskio@sindominio.net>
Date: Sun, 18 Oct 2020 18:19:07 +0200
Subject: [PATCH] Count the actual ordered products, don't skip the first

---
 src/order/ShowOrder.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/order/ShowOrder.js b/src/order/ShowOrder.js
index dbafbd7..222a477 100644
--- a/src/order/ShowOrder.js
+++ b/src/order/ShowOrder.js
@@ -29,7 +29,7 @@ function ShowOrderResults(props) {
   const transactions = props.order.transactions.map((t) => {
     const list = t.order_purchase.map((purchase) => {
       const i = products.findIndex((p) => p.code === purchase.product_code);
-      if (!i) {
+      if (i === -1) {
         return null;
       }
       products[i].amount += purchase.amount;
-- 
GitLab