From b07decb4c3b67aab629b35f65ffc3c4ffbe12ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Fri, 7 May 2021 15:05:29 +0300 Subject: [PATCH] admin not able to print/pdf signed invoice --- app/Http/Requests/Portal/InvoiceShow.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Requests/Portal/InvoiceShow.php b/app/Http/Requests/Portal/InvoiceShow.php index 73c528181..7ac751f50 100644 --- a/app/Http/Requests/Portal/InvoiceShow.php +++ b/app/Http/Requests/Portal/InvoiceShow.php @@ -17,6 +17,11 @@ class InvoiceShow extends FormRequest return true; } + // Allow admin to see signed invoice + if (user()->can('read-sales-invoices')) { + return true; + } + return $this->invoice->contact_id == user()->contact->id; }