diff --git a/app/Models/Account.php b/app/Models/Account.php index ce8622855b77..6e2644ea05e0 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -1797,6 +1797,11 @@ class Account extends Eloquent return $this->company->accounts->count() > 1; } + public function hasMultipleUsers() + { + return $this->users->count() > 1; + } + public function getPrimaryAccount() { return $this->company->accounts()->orderBy('id')->first(); diff --git a/resources/views/accounts/partials/notifications.blade.php b/resources/views/accounts/partials/notifications.blade.php index 018fcde8f29a..2e401dfb6b86 100644 --- a/resources/views/accounts/partials/notifications.blade.php +++ b/resources/views/accounts/partials/notifications.blade.php @@ -14,7 +14,7 @@ {!! Former::checkbox('notify_paid')->label(' ')->text(trans('texts.email_paid'))->value(1) !!} {!! Former::checkbox('notify_approved')->label(' ')->text(trans('texts.email_approved'))->value(1) !!} - @if (true || Auth()->user()->account->users->count() > 1) + @if (Auth()->user()->account->hasMultipleUsers())
{!! Former::radios('only_notify_owned')->radios([ trans('texts.all_invoices') => array('name' => 'only_notify_owned', 'value' => 0),