1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01: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:
Benjamin Beganović 2020-11-19 12:32:21 +01:00 committed by GitHub
commit ec6b3a00cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 9 deletions

View File

@ -14,16 +14,24 @@ class CompanyService
public function start()
{
try {
foreach (session(SESSION_USER_ACCOUNTS) as $company) {
$account = Account::find($company->account_id);
if (session(SESSION_USER_ACCOUNTS)) {
foreach (session(SESSION_USER_ACCOUNTS) as $company) {
$account = Account::find($company->account_id);
if ($account) {
$this->companies[] = [
'id' => $company->account_id,
'name' => $account->name,
'company_key' => $account->account_key,
];
if ($account) {
$this->companies[] = [
'id' => $account->id,
'name' => $account->present()->name(),
'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;

View File

@ -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.',
'start_migration' => 'Start Migration',
'auth' => 'Auth',
'endpoint' => 'Endpont',
'endpoint' => 'Endpoint',
'migration' => 'Migration',
'companies' => 'Companies',
'welcome_to_the_new_version' => 'Welcome to the new version of Invoice Ninja',
'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',