From 999b4c6d76984488caf6ff01872f22bdd9f3e6cd Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 1 Mar 2023 23:06:46 +1100 Subject: [PATCH] Improvements for reports --- app/Export/CSV/BaseExport.php | 2 +- app/Export/CSV/ProductSalesExport.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Export/CSV/BaseExport.php b/app/Export/CSV/BaseExport.php index 2b003bf75c..18bb04eb4d 100644 --- a/app/Export/CSV/BaseExport.php +++ b/app/Export/CSV/BaseExport.php @@ -33,7 +33,7 @@ class BaseExport protected function filterByClients($query) { - if (array_key_exists('client_id', $this->input) && $this->input['client_id'] != 'all') { + if (isset($this->input['client_id']) && $this->input['client_id'] != 'all') { $client = Client::withTrashed()->find($this->input['client_id']); $this->client_description = $client->present()->name; diff --git a/app/Export/CSV/ProductSalesExport.php b/app/Export/CSV/ProductSalesExport.php index 87055711cf..033545a8b5 100644 --- a/app/Export/CSV/ProductSalesExport.php +++ b/app/Export/CSV/ProductSalesExport.php @@ -144,8 +144,9 @@ class ProductSalesExport extends BaseExport $this->csv->insertOne([]); $this->csv->insertOne([]); $this->csv->insertOne([]); + $this->csv->insertOne([ctrans('texts.clients'), ctrans('texts.type'), ctrans('texts.start_date'), ctrans('texts.end_date')]); + $this->csv->insertOne([$this->client_description, ctrans('texts.product_sales'), $this->start_date, $this->end_date]); $this->csv->insertOne([]); - $this->csv->insertOne([ctrans('texts.summary'),ctrans('texts.product_sales'), $this->start_date, $this->end_date]); if ($grouped->count() >=1) {