Improve quote filters

This commit is contained in:
David Bomba 2025-07-25 01:39:52 +10:00
parent 836e4bd1ae
commit f116050a9b
1 changed files with 5 additions and 2 deletions

View File

@ -85,12 +85,15 @@ class QuoteFilters extends QueryFilters
} }
$this->builder->where(function ($query) use ($status_parameters) { $this->builder->where(function ($query) use ($status_parameters) {
if (in_array('sent', $status_parameters)) { if (in_array('sent', $status_parameters)) {
$query->orWhere(function ($q) { $query->orWhere(function ($q) {
$q->where('status_id', Quote::STATUS_SENT) $q->where('status_id', Quote::STATUS_SENT)
->whereNull('due_date') ->where(function ($q) {
$q->whereNull('due_date')
->orWhere('due_date', '>=', now()->toDateString()); ->orWhere('due_date', '>=', now()->toDateString());
}); });
});
} }
$quote_filters = []; $quote_filters = [];