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:
parent
f2456ce397
commit
468a8bfe2c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user