1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Improvements for reports

This commit is contained in:
David Bomba 2023-03-01 23:02:48 +11:00
parent f2456ce397
commit 468a8bfe2c

View File

@ -11,8 +11,9 @@
namespace App\Export\CSV;
use App\Utils\Traits\MakesHash;
use App\Models\Client;
use Illuminate\Support\Carbon;
use App\Utils\Traits\MakesHash;
class BaseExport
{
@ -28,10 +29,15 @@ class BaseExport
public string $end_date = '';
public string $client_description = 'All Clients';
protected function filterByClients($query)
{
if (array_key_exists('client_id', $this->input) && $this->input['client_id'] != 'all') {
return $query->where('client_id', $this->decodePrimaryKey($this->input['client_id']));
$client = Client::withTrashed()->find($this->input['client_id']);
$this->client_description = $client->present()->name;
return $query->where('client_id', $this->input['client_id']);
}
return $query;