mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for filtering
This commit is contained in:
parent
b230836056
commit
9e7f269a0e
@ -114,8 +114,16 @@ class ExpenseFilters extends QueryFilters
|
||||
*/
|
||||
public function has_invoices(string $value = ''): Builder
|
||||
{
|
||||
if ($value == 'true') {
|
||||
return $this->builder->whereNotNull('invoice_id');
|
||||
$split = explode(",", $value);
|
||||
|
||||
if (is_array($split) && in_array($split[0], ['client', 'project'])) {
|
||||
|
||||
$search_key = $split[0] == 'client' ? 'client_id' : 'project_id';
|
||||
|
||||
return $this->builder->whereNotNull('invoice_id')
|
||||
->whereHas('invoice', function ($query) use ($search_key, $split){
|
||||
$query->where($search_key, $this->decodePrimaryKey($split[1]));
|
||||
});
|
||||
}
|
||||
|
||||
return $this->builder;
|
||||
|
@ -7,7 +7,7 @@ parameters:
|
||||
- '#Call to an undefined method .*badMethod\(\)#'
|
||||
- '#Call to an undefined method Illuminate\Database\Eloquent\Builder::exclude#'
|
||||
parallel:
|
||||
maximumNumberOfProcesses: 8
|
||||
maximumNumberOfProcesses: 1
|
||||
level: 4
|
||||
paths:
|
||||
- 'app/'
|
||||
|
Loading…
x
Reference in New Issue
Block a user