mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-30 23:54:33 -04:00
Fix status filters (#3700)
This commit is contained in:
parent
a613cfed7c
commit
5d54d4313a
@ -31,7 +31,6 @@ class InvoicesTable extends Component
|
|||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
$query = Invoice::query()
|
$query = Invoice::query()
|
||||||
->where('company_id', auth('contact')->user()->company->id)
|
|
||||||
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc');
|
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc');
|
||||||
|
|
||||||
if (in_array('paid', $this->status)) {
|
if (in_array('paid', $this->status)) {
|
||||||
@ -48,7 +47,9 @@ class InvoicesTable extends Component
|
|||||||
->orWhere('partial_due_date', '<', Carbon::now());
|
->orWhere('partial_due_date', '<', Carbon::now());
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = $query->paginate($this->per_page);
|
$query = $query
|
||||||
|
->where('company_id', auth('contact')->user()->company->id)
|
||||||
|
->paginate($this->per_page);
|
||||||
|
|
||||||
return render('components.livewire.invoices-table', [
|
return render('components.livewire.invoices-table', [
|
||||||
'invoices' => $query,
|
'invoices' => $query,
|
||||||
|
@ -27,9 +27,8 @@ class QuotesTable extends Component
|
|||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
$query = Quote::query()
|
$query = Quote::query()
|
||||||
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
|
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc');
|
||||||
->where('company_id', auth('contact')->user()->company->id);
|
|
||||||
|
|
||||||
if (in_array('draft', $this->status)) {
|
if (in_array('draft', $this->status)) {
|
||||||
$query = $query->orWhere('status_id', Quote::STATUS_DRAFT);
|
$query = $query->orWhere('status_id', Quote::STATUS_DRAFT);
|
||||||
}
|
}
|
||||||
@ -46,7 +45,9 @@ class QuotesTable extends Component
|
|||||||
$query = $query->orWhere('status_id', Quote::STATUS_EXPIRED);
|
$query = $query->orWhere('status_id', Quote::STATUS_EXPIRED);
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = $query->paginate($this->per_page);
|
$query = $query
|
||||||
|
->where('company_id', auth('contact')->user()->company->id)
|
||||||
|
->paginate($this->per_page);
|
||||||
|
|
||||||
return render('components.livewire.quotes-table', [
|
return render('components.livewire.quotes-table', [
|
||||||
'quotes' => $query
|
'quotes' => $query
|
||||||
|
Loading…
x
Reference in New Issue
Block a user