mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Improve filters for expenses
This commit is contained in:
parent
b1f73f97de
commit
8076eb6d06
@ -218,6 +218,11 @@ class ExpenseFilters extends QueryFilters
|
|||||||
->whereColumn('expense_categories.id', 'expenses.category_id'), $sort_col[1]);
|
->whereColumn('expense_categories.id', 'expenses.category_id'), $sort_col[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($sort_col[0] == 'payment_date' && in_array($sort_col[1], ['asc', 'desc'])) {
|
||||||
|
return $this->builder
|
||||||
|
->orderByRaw('ISNULL(payment_date), payment_date '. $sort_col[1]);
|
||||||
|
}
|
||||||
|
|
||||||
if($sort_col[0] == 'number') {
|
if($sort_col[0] == 'number') {
|
||||||
return $this->builder->orderByRaw("REGEXP_REPLACE(number,'[^0-9]+','')+0 " . $dir);
|
return $this->builder->orderByRaw("REGEXP_REPLACE(number,'[^0-9]+','')+0 " . $dir);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user