mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Recurring invoices
This commit is contained in:
parent
d5326f4873
commit
f179831e06
@ -21,6 +21,7 @@ use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Project;
|
||||
use App\Models\Quote;
|
||||
use App\Models\RecurringInvoice;
|
||||
use App\Utils\Traits\WithSorting;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
@ -88,6 +89,10 @@ class DocumentsTable extends Component
|
||||
$this->query = $this->quotes();
|
||||
break;
|
||||
|
||||
case 'recurringInvoices':
|
||||
$this->query = $this->recurringInvoices();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->query = $this->documents();
|
||||
break;
|
||||
@ -146,4 +151,12 @@ class DocumentsTable extends Component
|
||||
$query->where('client_id', $this->client->id);
|
||||
});
|
||||
}
|
||||
|
||||
protected function recurringInvoices()
|
||||
{
|
||||
return Document::query()
|
||||
->whereHasMorph('documentable', [RecurringInvoice::class], function ($query) {
|
||||
$query->where('client_id', $this->client->id);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,13 @@
|
||||
class="button border border-transparent hover:border-gray-600 {{ $tab === 'quotes' ? 'border-gray-600' : '' }}"ž
|
||||
wire:click="updateResources('quotes')" />
|
||||
{{ ctrans('texts.quotes') }}
|
||||
</button>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="button border border-transparent hover:border-gray-600 {{ $tab === 'recurringInvoices' ? 'border-gray-600' : '' }}"ž
|
||||
wire:click="updateResources('recurringInvoices')" />
|
||||
{{ ctrans('texts.recurring_invoices') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between mt-6">
|
||||
|
Loading…
x
Reference in New Issue
Block a user