diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 0848ecbb4e64..c0547d0c24d7 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -75,9 +75,7 @@ class CheckData extends Command $this->checkBalances(); $this->checkContacts(); - - // TODO Enable once user_account companies have been merged - //$this->checkUserAccounts(); + $this->checkUserAccounts(); if (! $this->option('client_id')) { $this->checkOAuth(); @@ -221,8 +219,9 @@ class CheckData extends Command } } + $this->logMessage($countInvalid . ' user accounts with multiple companies'); + if ($countInvalid > 0) { - $this->logMessage($countInvalid . ' user accounts with multiple companies'); $this->isValid = false; } } diff --git a/app/Ninja/Repositories/AccountRepository.php b/app/Ninja/Repositories/AccountRepository.php index fc2dafd26c6a..a1d510c8dd81 100644 --- a/app/Ninja/Repositories/AccountRepository.php +++ b/app/Ninja/Repositories/AccountRepository.php @@ -321,10 +321,7 @@ class AccountRepository $item->product_key = 'Plan - '.ucfirst($plan).' ('.ucfirst($term).')'; $invoice->invoice_items()->save($item); - $invitation = new Invitation(); - $invitation->account_id = $account->id; - $invitation->user_id = $account->users()->first()->id; - $invitation->public_id = $publicId; + $invitation = Invitation::createNew($invoice); $invitation->invoice_id = $invoice->id; $invitation->contact_id = $client->contacts()->first()->id; $invitation->invitation_key = strtolower(str_random(RANDOM_KEY_LENGTH)); diff --git a/resources/views/reports/chart_builder.blade.php b/resources/views/reports/chart_builder.blade.php index 175a7094498c..f0df9e6de6b7 100644 --- a/resources/views/reports/chart_builder.blade.php +++ b/resources/views/reports/chart_builder.blade.php @@ -308,7 +308,9 @@ theme: 'bootstrap', widgets: ['zebra', 'uitheme', 'filter'{!! request()->group_when_sorted ? ", 'group'" : "" !!}, 'columnSelector'], headerTemplate : '{content} {icon}', - dateFormat: '{{ $report->convertDateFormat() }}', + @if ($report) + dateFormat: '{{ $report->convertDateFormat() }}', + @endif numberSorter: function(a, b, direction) { var a = convertStringToNumber(a); var b = convertStringToNumber(b);