Improvements for reports

This commit is contained in:
David Bomba 2023-03-01 23:06:46 +11:00
parent 468a8bfe2c
commit 999b4c6d76
2 changed files with 3 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class BaseExport
protected function filterByClients($query) 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']); $client = Client::withTrashed()->find($this->input['client_id']);
$this->client_description = $client->present()->name; $this->client_description = $client->present()->name;

View File

@ -144,8 +144,9 @@ class ProductSalesExport extends BaseExport
$this->csv->insertOne([]); $this->csv->insertOne([]);
$this->csv->insertOne([]); $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([]);
$this->csv->insertOne([ctrans('texts.summary'),ctrans('texts.product_sales'), $this->start_date, $this->end_date]);
if ($grouped->count() >=1) { if ($grouped->count() >=1) {