From 02bf16e78735cfb17aafda141bcd3042ee60b002 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Mon, 10 May 2021 03:52:00 +0000 Subject: [PATCH] Add checking if invoice has items before getting customer tags. #558 --- src/Service/InvoiceGenerator/ResqInvoiceGenerator.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Service/InvoiceGenerator/ResqInvoiceGenerator.php b/src/Service/InvoiceGenerator/ResqInvoiceGenerator.php index f4c752bb..aa0340b1 100644 --- a/src/Service/InvoiceGenerator/ResqInvoiceGenerator.php +++ b/src/Service/InvoiceGenerator/ResqInvoiceGenerator.php @@ -71,8 +71,10 @@ class ResqInvoiceGenerator implements InvoiceGeneratorInterface $cust_tag_info = []; if ($stype == ServiceType::BATTERY_REPLACEMENT_NEW) { - error_log('calling getCustomerTagInfo'); - $cust_tag_info = $this->getCustomerTagInfo($cv); + // check if criteria has entries + $entries = $criteria->getEntries(); + if (!empty($entries)) + $cust_tag_info = $this->getCustomerTagInfo($cv); } // error_log($stype); switch ($stype)