mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Invoices
This commit is contained in:
parent
9acff982cc
commit
778a48a699
@ -17,6 +17,7 @@ use App\Models\Client;
|
|||||||
use App\Models\Credit;
|
use App\Models\Credit;
|
||||||
use App\Models\Document;
|
use App\Models\Document;
|
||||||
use App\Models\Expense;
|
use App\Models\Expense;
|
||||||
|
use App\Models\Invoice;
|
||||||
use App\Utils\Traits\WithSorting;
|
use App\Utils\Traits\WithSorting;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use Livewire\WithPagination;
|
use Livewire\WithPagination;
|
||||||
@ -68,6 +69,10 @@ class DocumentsTable extends Component
|
|||||||
$this->query = $this->expenses();
|
$this->query = $this->expenses();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'invoices':
|
||||||
|
$this->query = $this->invoices();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$this->query = $this->documents();
|
$this->query = $this->documents();
|
||||||
break;
|
break;
|
||||||
@ -94,4 +99,12 @@ class DocumentsTable extends Component
|
|||||||
$query->where('client_id', $this->client->id);
|
$query->where('client_id', $this->client->id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function invoices()
|
||||||
|
{
|
||||||
|
return Document::query()
|
||||||
|
->whereHasMorph('documentable', [Invoice::class], function ($query) {
|
||||||
|
$query->where('client_id', $this->client->id);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,12 @@
|
|||||||
wire:click="updateResources('expenses')" />
|
wire:click="updateResources('expenses')" />
|
||||||
{{ ctrans('texts.expenses') }}
|
{{ ctrans('texts.expenses') }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="button border border-transparent hover:border-gray-600 {{ $tab === 'invoices' ? 'border-gray-600' : '' }}"ž
|
||||||
|
wire:click="updateResources('invoices')" />
|
||||||
|
{{ ctrans('texts.invoices') }}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center justify-between mt-6">
|
<div class="flex items-center justify-between mt-6">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user