mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 17:14:31 -04:00
Payments
This commit is contained in:
parent
778a48a699
commit
218cf81922
@ -18,6 +18,7 @@ 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\Models\Invoice;
|
||||||
|
use App\Models\Payment;
|
||||||
use App\Utils\Traits\WithSorting;
|
use App\Utils\Traits\WithSorting;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use Livewire\WithPagination;
|
use Livewire\WithPagination;
|
||||||
@ -73,6 +74,10 @@ class DocumentsTable extends Component
|
|||||||
$this->query = $this->invoices();
|
$this->query = $this->invoices();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'payments':
|
||||||
|
$this->query = $this->payments();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$this->query = $this->documents();
|
$this->query = $this->documents();
|
||||||
break;
|
break;
|
||||||
@ -107,4 +112,12 @@ class DocumentsTable extends Component
|
|||||||
$query->where('client_id', $this->client->id);
|
$query->where('client_id', $this->client->id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function payments()
|
||||||
|
{
|
||||||
|
return Document::query()
|
||||||
|
->whereHasMorph('documentable', [Payment::class], function ($query) {
|
||||||
|
$query->where('client_id', $this->client->id);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,12 @@
|
|||||||
wire:click="updateResources('invoices')" />
|
wire:click="updateResources('invoices')" />
|
||||||
{{ ctrans('texts.invoices') }}
|
{{ ctrans('texts.invoices') }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="button border border-transparent hover:border-gray-600 {{ $tab === 'payments' ? 'border-gray-600' : '' }}"ž
|
||||||
|
wire:click="updateResources('payments')" />
|
||||||
|
{{ ctrans('texts.payments') }}
|
||||||
|
</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