mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 22:34:37 -04:00
Add case for transaction searches
This commit is contained in:
parent
a787b89f84
commit
6192e014c6
@ -147,15 +147,22 @@ class InvoiceFilters extends QueryFilters
|
|||||||
public function upcoming(): Builder
|
public function upcoming(): Builder
|
||||||
{
|
{
|
||||||
return $this->builder->whereIn('status_id', [Invoice::STATUS_PARTIAL, Invoice::STATUS_SENT])
|
return $this->builder->whereIn('status_id', [Invoice::STATUS_PARTIAL, Invoice::STATUS_SENT])
|
||||||
->whereNull('due_date')
|
->where('is_deleted', 0)
|
||||||
->orWhere(function ($q) {
|
->where('balance', '>', 0)
|
||||||
$q->where('due_date', '>=', now()->startOfDay()->subSecond())->where('partial', 0);
|
->where(function ($query) {
|
||||||
})
|
|
||||||
->orWhere(function ($q) {
|
$query->whereNull('due_date')
|
||||||
$q->where('partial_due_date', '>=', now()->startOfDay()->subSecond())->where('partial', '>', 0);
|
->orWhere(function ($q) {
|
||||||
})
|
$q->where('due_date', '>=', now()->startOfDay()->subSecond())->where('partial', 0);
|
||||||
->orderByRaw('ISNULL(due_date), due_date '. 'desc')
|
})
|
||||||
->orderByRaw('ISNULL(partial_due_date), partial_due_date '. 'desc');
|
->orWhere(function ($q) {
|
||||||
|
$q->where('partial_due_date', '>=', now()->startOfDay()->subSecond())->where('partial', '>', 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
|
->orderByRaw('ISNULL(due_date), due_date '. 'desc')
|
||||||
|
->orderByRaw('ISNULL(partial_due_date), partial_due_date '. 'desc');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user