mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #4331 from beganovich/v4-fix-issue-with-getting-companies-for-migration
(v4) Fix issue with getting companies for migration
This commit is contained in:
commit
ec6b3a00cc
@ -14,17 +14,25 @@ class CompanyService
|
|||||||
public function start()
|
public function start()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
if (session(SESSION_USER_ACCOUNTS)) {
|
||||||
foreach (session(SESSION_USER_ACCOUNTS) as $company) {
|
foreach (session(SESSION_USER_ACCOUNTS) as $company) {
|
||||||
$account = Account::find($company->account_id);
|
$account = Account::find($company->account_id);
|
||||||
|
|
||||||
if ($account) {
|
if ($account) {
|
||||||
$this->companies[] = [
|
$this->companies[] = [
|
||||||
'id' => $company->account_id,
|
'id' => $account->id,
|
||||||
'name' => $account->name,
|
'name' => $account->present()->name(),
|
||||||
'company_key' => $account->account_key,
|
'company_key' => $account->account_key,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$this->companies[] = [
|
||||||
|
'id' => auth()->user()->account->id,
|
||||||
|
'name' => auth()->user()->account->present()->name(),
|
||||||
|
'company_key' => auth()->user()->account->account_key,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
$this->isSuccessful = true;
|
$this->isSuccessful = true;
|
||||||
} catch (\Exception $th) {
|
} catch (\Exception $th) {
|
||||||
|
@ -3273,8 +3273,9 @@ $LANG = array(
|
|||||||
'migrate_intro_text' => 'We\'ve been working on next version of Invoice Ninja. Click the button below to start the migration.',
|
'migrate_intro_text' => 'We\'ve been working on next version of Invoice Ninja. Click the button below to start the migration.',
|
||||||
'start_migration' => 'Start Migration',
|
'start_migration' => 'Start Migration',
|
||||||
'auth' => 'Auth',
|
'auth' => 'Auth',
|
||||||
'endpoint' => 'Endpont',
|
'endpoint' => 'Endpoint',
|
||||||
'migration' => 'Migration',
|
'migration' => 'Migration',
|
||||||
|
'companies' => 'Companies',
|
||||||
'welcome_to_the_new_version' => 'Welcome to the new version of Invoice Ninja',
|
'welcome_to_the_new_version' => 'Welcome to the new version of Invoice Ninja',
|
||||||
'download_data' => 'Press button below to download the data.',
|
'download_data' => 'Press button below to download the data.',
|
||||||
'migration_import' => 'Awesome! Now you are ready to import your migration. Go to your new installation to import your data',
|
'migration_import' => 'Awesome! Now you are ready to import your migration. Go to your new installation to import your data',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user