mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 05:04:30 -04:00
Fixes for query filters
This commit is contained in:
parent
4018d3d6a0
commit
619a740451
@ -85,15 +85,19 @@ class QuoteFilters extends QueryFilters
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('expired', $status_parameters)) {
|
if (in_array('expired', $status_parameters)) {
|
||||||
$this->builder->where('status_id', Quote::STATUS_SENT)
|
$this->builder->orWhere(function ($query){
|
||||||
|
$query->where('status_id', Quote::STATUS_SENT)
|
||||||
->whereNotNull('due_date')
|
->whereNotNull('due_date')
|
||||||
->where('due_date', '<=', now()->toDateString());
|
->where('due_date', '<=', now()->toDateString());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('upcoming', $status_parameters)) {
|
if (in_array('upcoming', $status_parameters)) {
|
||||||
$this->builder->where('status_id', Quote::STATUS_SENT)
|
$this->builder->orWhere(function ($query){
|
||||||
|
$query->where('status_id', Quote::STATUS_SENT)
|
||||||
->where('due_date', '>=', now()->toDateString())
|
->where('due_date', '>=', now()->toDateString())
|
||||||
->orderBy('due_date', 'DESC');
|
->orderBy('due_date', 'DESC');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->builder;
|
return $this->builder;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user