mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 17:54:38 -04:00
Updates for filters
This commit is contained in:
parent
3cb7f79fd4
commit
073948facf
@ -164,6 +164,17 @@ class ExpenseFilters extends QueryFilters
|
|||||||
return $this->builder;
|
return $this->builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($sort_col[0] == 'client_id') {
|
||||||
|
return $this->builder->orderBy(\App\Models\Client::select('name')
|
||||||
|
->whereColumn('clients.id', 'expenses.client_id'), $sort_col[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($sort_col[0] == 'vendor_id') {
|
||||||
|
return $this->builder->orderBy(\App\Models\Vendor::select('name')
|
||||||
|
->whereColumn('vendors.id', 'expenses.vendor_id'), $sort_col[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (is_array($sort_col) && in_array($sort_col[1], ['asc', 'desc']) && in_array($sort_col[0], ['public_notes', 'date', 'id_number', 'custom_value1', 'custom_value2', 'custom_value3', 'custom_value4'])) {
|
if (is_array($sort_col) && in_array($sort_col[1], ['asc', 'desc']) && in_array($sort_col[0], ['public_notes', 'date', 'id_number', 'custom_value1', 'custom_value2', 'custom_value3', 'custom_value4'])) {
|
||||||
return $this->builder->orderBy($sort_col[0], $sort_col[1]);
|
return $this->builder->orderBy($sort_col[0], $sort_col[1]);
|
||||||
}
|
}
|
||||||
|
@ -123,6 +123,11 @@ class PurchaseOrderFilters extends QueryFilters
|
|||||||
return $this->builder;
|
return $this->builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($sort_col[0] == 'vendor_id') {
|
||||||
|
return $this->builder->orderBy(\App\Models\Vendor::select('name')
|
||||||
|
->whereColumn('vendors.id', 'purchase_orders.vendor_id'), $sort_col[1]);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->builder->orderBy($sort_col[0], $sort_col[1]);
|
return $this->builder->orderBy($sort_col[0], $sort_col[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user