From 6cb3f1be668a0e80bc8614352591696ede8f2699 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Mon, 13 Jul 2020 09:38:47 +0000 Subject: [PATCH] Fix the quantity in invoice when user orders more than one battery of the same type. #436 --- src/Service/InvoiceGenerator/CMBInvoiceGenerator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Service/InvoiceGenerator/CMBInvoiceGenerator.php b/src/Service/InvoiceGenerator/CMBInvoiceGenerator.php index c0425f31..69b4e55a 100644 --- a/src/Service/InvoiceGenerator/CMBInvoiceGenerator.php +++ b/src/Service/InvoiceGenerator/CMBInvoiceGenerator.php @@ -363,9 +363,10 @@ class CMBInvoiceGenerator implements InvoiceGeneratorInterface if (!isset($con_batts[$batt_id])) $con_batts[$batt->getID()] = [ 'batt' => $batt, - 'qty' => 0 + 'qty' => $qty ]; - $con_batts[$batt_id]['qty']++; + else + $con_batts[$batt_id]['qty'] += $qty; // no trade-in