1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

(V1) Improve migration (#3415)

* Imports improvements:
- Fix sorting
- Fix duplicate imports (Cannot use App\Http\Controllers\BaseController as BaseController because the name is already in use)

* Wrap up, sending migration file:
- Removed 'enable_invoice_quantity'
This commit is contained in:
Benjamin Beganović 2020-03-03 23:44:30 +01:00 committed by GitHub
parent 65b30189b3
commit bde276ad67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 26 deletions

View File

@ -3,6 +3,10 @@
namespace App\Http\Controllers\Migration;
use App\Http\Controllers\BaseController;
use App\Http\Requests\MigrationAuthRequest;
use App\Http\Requests\MigrationCompaniesRequest;
use App\Http\Requests\MigrationEndpointRequest;
use App\Http\Requests\MigrationTypeRequest;
use App\Libraries\Utils;
use App\Models\AccountGateway;
use App\Models\AccountGatewaySettings;
@ -16,17 +20,10 @@ use App\Models\PaymentMethod;
use App\Models\Product;
use App\Models\TaxRate;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\BaseController;
use App\Http\Requests\MigrationAuthRequest;
use App\Http\Requests\MigrationCompaniesRequest;
use App\Http\Requests\MigrationEndpointRequest;
use App\Http\Requests\MigrationTypeRequest;
use App\Models\Document;
use App\Services\Migration\AuthService;
use App\Services\Migration\CompanyService;
use App\Services\Migration\CompleteService;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Crypt;
class StepsController extends BaseController
@ -147,30 +144,15 @@ class StepsController extends BaseController
if($this->shouldGoBack('companies'))
return redirect($this->access['companies']['redirect']);
$successful = false;
foreach ($request->companies as $company) {
$completeService = (new CompleteService(session('MIGRATION_ACCOUNT_TOKEN')))
->file($this->getMigrationFile())
->company($company)
->endpoint(session('MIGRATION_ENDPOINT'))
->start();
if($completeService->isSuccessful()) {
$successful = true;
}
$successful = false;
}
if($successful) {
return view('migration.completed');
}
return response([
'message' => 'Failed',
'errors' => $completeService->getErrors(),
]);
return view('migration.completed');
}
public function completed()
@ -263,7 +245,6 @@ class StepsController extends BaseController
'show_product_details' => $this->account->show_product_notes,
'custom_surcharge_taxes1' => $this->account->custom_invoice_taxes1,
'custom_surcharge_taxes2' => $this->account->custom_invoice_taxes2,
'enable_invoice_quantity' => !$this->account->hide_quantity,
'subdomain' => $this->account->subdomain,
'size_id' => $this->account->size_id,
'enable_modules' => $this->account->enabled_modules,

View File

@ -9,7 +9,7 @@
<h3 class="panel-title">{!! trans('texts.welcome_to_the_new_version') !!}</h3>
</div>
<div class="panel-body">
Completed, thanks!
Migration has started. We'll update you with status, on your company e-mail.
<!-- Note: This message needs edit, like next instructions, etc. -->
</div>
</div>