diff --git a/app/Http/Controllers/ClientPortal/CreditController.php b/app/Http/Controllers/ClientPortal/CreditController.php index 3e69220a1563..9d00714bc4ad 100644 --- a/app/Http/Controllers/ClientPortal/CreditController.php +++ b/app/Http/Controllers/ClientPortal/CreditController.php @@ -34,7 +34,7 @@ class CreditController extends Controller $data = [ 'credit' => $credit, - 'key' => $invitation->key + 'key' => $invitation ? $invitation->key : false ]; if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) { diff --git a/app/Http/Controllers/ClientPortal/InvoiceController.php b/app/Http/Controllers/ClientPortal/InvoiceController.php index 5c9d0bcad82e..b6789e8dfdd8 100644 --- a/app/Http/Controllers/ClientPortal/InvoiceController.php +++ b/app/Http/Controllers/ClientPortal/InvoiceController.php @@ -61,7 +61,7 @@ class InvoiceController extends Controller $invoice->service()->removeUnpaidGatewayFees()->save(); - $invitation = $invoice->invitations()->where('client_contact_id', auth()->user()->id)->first(); + $invitation = $invoice->invitations()->where('client_contact_id', auth()->guard('contact')->user()->id)->first(); if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) { @@ -74,7 +74,7 @@ class InvoiceController extends Controller $data = [ 'invoice' => $invoice, - 'key' => $invitation->key + 'key' => $invitation ? $invitation->key : false ]; if ($request->query('mode') === 'fullscreen') { diff --git a/app/Http/Controllers/ClientPortal/QuoteController.php b/app/Http/Controllers/ClientPortal/QuoteController.php index 03b0a648af39..c527d7b7fd46 100644 --- a/app/Http/Controllers/ClientPortal/QuoteController.php +++ b/app/Http/Controllers/ClientPortal/QuoteController.php @@ -63,7 +63,7 @@ class QuoteController extends Controller $data = [ 'quote' => $quote, - 'key' => $invitation->key, + 'key' => $invitation ? $invitation->key : false, ]; if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) { diff --git a/resources/views/portal/ninja2020/credits/show.blade.php b/resources/views/portal/ninja2020/credits/show.blade.php index 28be1ee665da..0504dce30de7 100644 --- a/resources/views/portal/ninja2020/credits/show.blade.php +++ b/resources/views/portal/ninja2020/credits/show.blade.php @@ -17,12 +17,14 @@ {{ ctrans('texts.entity_number_placeholder', ['entity' => ctrans('texts.credit'), 'entity_number' => $credit->number]) }} -
+ @if($key) + + @endif
diff --git a/resources/views/portal/ninja2020/invoices/show.blade.php b/resources/views/portal/ninja2020/invoices/show.blade.php index 15605a39ad07..a9401ca1ef16 100644 --- a/resources/views/portal/ninja2020/invoices/show.blade.php +++ b/resources/views/portal/ninja2020/invoices/show.blade.php @@ -40,12 +40,15 @@ - {{ ctrans('texts.unpaid') }} -
+ @if($key) + + @endif +
@@ -74,12 +77,14 @@ - {{ \App\Models\Invoice::stringStatus($invoice->status_id) }} -
+ @if($key) + + @endif
diff --git a/resources/views/portal/ninja2020/quotes/includes/actions.blade.php b/resources/views/portal/ninja2020/quotes/includes/actions.blade.php index c3f8696aa791..1a3266815ee4 100644 --- a/resources/views/portal/ninja2020/quotes/includes/actions.blade.php +++ b/resources/views/portal/ninja2020/quotes/includes/actions.blade.php @@ -15,7 +15,7 @@ {{ ctrans('texts.approve') }} -
+ @@ -56,12 +59,14 @@ {{ ctrans('texts.approved') }} -
+ @if($key) + + @endif
@@ -76,12 +81,14 @@ {{ ctrans('texts.expired') }} -
+ @if($key) + + @endif