mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for adding users to hosted
This commit is contained in:
parent
7c2170d505
commit
64aa4fe00f
@ -34,10 +34,12 @@ class CanAddUserRule implements Rule
|
||||
{
|
||||
|
||||
$count = CompanyUser::query()
|
||||
->where('account_id', auth()->user()->account_id)
|
||||
->whereNull('deleted_at')
|
||||
->where('company_user.account_id', auth()->user()->account_id)
|
||||
->join('users', 'users.id', '=', 'company_user.user_id')
|
||||
->whereNull('users.deleted_at')
|
||||
->whereNull('company_user.deleted_at')
|
||||
->distinct()
|
||||
->count('user_id');
|
||||
->count('company_user.user_id');
|
||||
|
||||
return $count < auth()->user()->company()->account->num_users;
|
||||
|
||||
|
@ -34,11 +34,12 @@ class CanRestoreUserRule implements Rule
|
||||
{
|
||||
|
||||
$count = CompanyUser::query()
|
||||
->where('account_id', auth()->user()->account_id)
|
||||
->whereNull('deleted_at')
|
||||
->where('company_user.account_id', auth()->user()->account_id)
|
||||
->join('users', 'users.id', '=', 'company_user.user_id')
|
||||
->whereNull('users.deleted_at')
|
||||
->whereNull('company_user.deleted_at')
|
||||
->distinct()
|
||||
->count('user_id');
|
||||
|
||||
->count('company_user.user_id');
|
||||
|
||||
return $count < auth()->user()->company()->account->num_users;
|
||||
|
||||
|
@ -151,6 +151,7 @@ class HtmlEngine
|
||||
|
||||
if($this->entity->project) {
|
||||
$data['$project.name'] = ['value' => $this->entity->project->name, 'label' => ctrans('texts.project_name')];
|
||||
$data['$invoice.project'] = &$data['$project.name'];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user