From 1903ef619f3730cb6639166b7020cd50c9a66492 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 6 Oct 2017 16:43:06 +0300 Subject: [PATCH] Fix status filter on product report --- app/Ninja/Reports/ProductReport.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Ninja/Reports/ProductReport.php b/app/Ninja/Reports/ProductReport.php index 3d1b8aa74a4d..8f1cf85a134e 100644 --- a/app/Ninja/Reports/ProductReport.php +++ b/app/Ninja/Reports/ProductReport.php @@ -43,6 +43,11 @@ class ProductReport extends AbstractReport foreach ($clients->get() as $client) { foreach ($client->invoices as $invoice) { + if (! $invoice->isPaid() && $status == 'paid') { + continue; + } elseif ($invoice->isPaid() && $status == 'unpaid') { + continue; + } foreach ($invoice->invoice_items as $item) { $this->data[] = [ $this->isExport ? $client->getDisplayName() : $client->present()->link,