diff --git a/app/Export/CSV/BaseExport.php b/app/Export/CSV/BaseExport.php index 2b003bf75cdf..18bb04eb4dd0 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 87055711cff2..033545a8b579 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) {