Fix displaying first service/invoice/account for user

This commit is contained in:
Deon George
2020-05-25 13:57:36 +10:00
parent 4935a9f5ff
commit 589aeb7289
3 changed files with 3 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ class InvoicePolicy
public function view(User $user, Invoice $o)
{
// If this is a service for an account managed by a user.
return ($user->invoices->pluck('id')->search($o->id))
return ($user->invoices->pluck('id')->search($o->id) !== FALSE)
// The user is the wholesaler
OR $user->isWholesaler()