From 60ae138e11d2e771b3da0f055146d7cf6e8db0f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 2 Sep 2020 22:08:12 +0200 Subject: [PATCH] Show gateway fees status for invoices --- app/Http/Livewire/InvoicesTable.php | 4 ++ .../livewire/invoices-table.blade.php | 54 ++++++++++--------- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/app/Http/Livewire/InvoicesTable.php b/app/Http/Livewire/InvoicesTable.php index 151dd575d9..0f210c849f 100644 --- a/app/Http/Livewire/InvoicesTable.php +++ b/app/Http/Livewire/InvoicesTable.php @@ -42,6 +42,10 @@ class InvoicesTable extends Component $query = $query->orWhereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]); } + if (in_array('gateway-fees', $this->status)) { + $query = $query->orWhere('status_id', Invoice::STATUS_PAID); // Update this to correct status id (4). + } + if (in_array('overdue', $this->status)) { $query = $query->orWhereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->where(function ($query) { diff --git a/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php b/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php index a70383ec89..4feb1bdef2 100644 --- a/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php @@ -1,8 +1,8 @@
- - @@ -11,50 +11,54 @@
- +
- +
- +
+
+ + +
-
-
- +
+
+
- - - - - - @forelse($invoices as $invoice) - - - - - - - @empty - @@ -112,9 +116,9 @@
+ + {{ ctrans('texts.invoice_number') }} + {{ ctrans('texts.invoice_date') }} + {{ ctrans('texts.balance') }} + {{ ctrans('texts.due_date') }} + {{ ctrans('texts.status') }} @@ -65,33 +69,33 @@
+ + {{ $invoice->number }} + {{ $invoice->formatDate($invoice->date, $invoice->client->date_format()) }} + {{ App\Utils\Number::formatMoney($invoice->balance, $invoice->client) }} + {{ $invoice->formatDate($invoice->due_date, $invoice->client->date_format()) }} + {!! App\Models\Invoice::badgeForStatus($invoice->status) !!} + @if($invoice->isPayable())
@csrf -
@@ -103,7 +107,7 @@
+ {{ ctrans('texts.no_results') }}
-
+
@if($invoices->total() > 0) -