diff --git a/app/Http/Controllers/Wizard/Companies.php b/app/Http/Controllers/Wizard/Companies.php index c929d655f..3bf3254b8 100644 --- a/app/Http/Controllers/Wizard/Companies.php +++ b/app/Http/Controllers/Wizard/Companies.php @@ -19,7 +19,7 @@ class Companies extends Controller public function edit() { if (setting('general.wizard', false)) { - //return redirect('/'); + return redirect('/'); } $company = Company::find(session('company_id')); @@ -76,11 +76,6 @@ class Companies extends Controller // Save all settings setting()->save(); - // Redirect - $message = trans('messages.success.updated', ['type' => trans_choice('general.companies', 1)]); - - flash($message)->success(); - return redirect('wizard/currencies'); } diff --git a/app/Http/Controllers/Wizard/Currencies.php b/app/Http/Controllers/Wizard/Currencies.php index 24022e1c0..f69c210a2 100644 --- a/app/Http/Controllers/Wizard/Currencies.php +++ b/app/Http/Controllers/Wizard/Currencies.php @@ -19,7 +19,7 @@ class Currencies extends Controller public function edit() { if (setting('general.wizard', false)) { - //return redirect('/'); + return redirect('/'); } $currencies = Currency::all(); diff --git a/app/Http/Controllers/Wizard/Finish.php b/app/Http/Controllers/Wizard/Finish.php index 859d91ce3..3f1d73d1f 100644 --- a/app/Http/Controllers/Wizard/Finish.php +++ b/app/Http/Controllers/Wizard/Finish.php @@ -15,13 +15,14 @@ class Finish extends Controller public function index() { if (setting(setting('general.wizard', false))) { - //return redirect('/'); + return redirect('/'); } - $company = Company::find(session('company_id')); + setting()->set('general.wizard', true); - $company->setSettings(); + // Save all settings + setting()->save(); - return view('wizard.finish.index', compact('company', 'currencies')); + return view('wizard.finish.index', compact('')); } } diff --git a/app/Http/Controllers/Wizard/Taxes.php b/app/Http/Controllers/Wizard/Taxes.php index 65dc7b3a6..d567a3f6c 100644 --- a/app/Http/Controllers/Wizard/Taxes.php +++ b/app/Http/Controllers/Wizard/Taxes.php @@ -17,9 +17,13 @@ class Taxes extends Controller */ public function edit() { - $tax = []; + if (setting(setting('general.wizard', false))) { + return redirect('/'); + } - return view('wizard.taxes.edit', compact('tax')); + $taxes = Tax::all(); + + return view('wizard.taxes.edit', compact('taxes')); } /** diff --git a/resources/views/wizard/currencies/edit.blade.php b/resources/views/wizard/currencies/edit.blade.php index d6d12b4e7..defec5157 100644 --- a/resources/views/wizard/currencies/edit.blade.php +++ b/resources/views/wizard/currencies/edit.blade.php @@ -30,20 +30,65 @@
- {!! Form::model([], ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/currencies'], 'role' => 'form', 'class' => 'form-loading-button']) !!} -

{{ trans_choice('general.currencies', 1) }}

- - {{ Form::textGroup('company_tax_number', trans('general.tax_number'), 'percent', []) }} - - {{ Form::textGroup('company_phone', trans('settings.company.phone'), 'phone', []) }} - - {{ Form::textareaGroup('company_address', trans('settings.company.address')) }} +
+ + + + + + + + + + + + @foreach($currencies as $item) + + + + + + + + @endforeach + + + + +
@sortablelink('name', trans('general.name'))@sortablelink('rate', trans('currencies.rate')){{ trans('general.actions') }}
{{ $item->name }}{{ $item->rate }} +
+ + +
+
+  {{ trans('general.add_new') }} +
+
@@ -56,8 +101,6 @@
- - {!! Form::close() !!} @endsection diff --git a/resources/views/wizard/finish/edit.blade.php b/resources/views/wizard/finish/edit.blade.php deleted file mode 100644 index 317a6fbb3..000000000 --- a/resources/views/wizard/finish/edit.blade.php +++ /dev/null @@ -1,160 +0,0 @@ -@extends('layouts.wizard') - -@section('title', trans('general.wizard')) - -@section('content') - -
- {!! Form::model($company, ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/companies', $company->id], 'role' => 'form', 'class' => 'form-loading-button']) !!} -
-
-
-
- 1 -

{{ trans_choice('general.companies', 1) }}

-
-
- 2 -

{{ trans_choice('general.currencies', 2) }}

-
-
- 3 -

{{ trans_choice('general.taxes', 2) }}

-
-
- 4 -

{{ trans_choice('general.companies', 1) }}

-
-
-
-
- -
-
-
- {!! Form::label('sale_price', trans('modules.api_token'), ['class' => 'control-label']) !!} -
- - {!! Form::text('api_token', setting('general.api_token', null), ['class' => 'form-control', 'required' => 'required', 'placeholder' => trans('general.form.enter', ['field' => trans('modules.api_token')])]) !!} -
- {!! $errors->first('api_token', '

:message

') !!} -
-

- {!! trans('modules.token_link') !!} -

-
- - {{ Form::textGroup('company_tax_number', trans('general.tax_number'), 'percent', []) }} - - {{ Form::textGroup('company_phone', trans('settings.company.phone'), 'phone', []) }} - - {{ Form::textareaGroup('company_address', trans('settings.company.address')) }} - - {{ Form::fileGroup('company_logo', trans('settings.company.logo')) }} -
- - - - - - {!! Form::close() !!} -
-@endsection - -@push('js') - -@endpush - -@push('css') - -@endpush - -@push('scripts') - -@endpush diff --git a/resources/views/wizard/finish/index.blade.php b/resources/views/wizard/finish/index.blade.php index 4398eb27b..0f7947512 100644 --- a/resources/views/wizard/finish/index.blade.php +++ b/resources/views/wizard/finish/index.blade.php @@ -30,34 +30,7 @@
- {!! Form::model([], ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/taxes'], 'role' => 'form', 'class' => 'form-loading-button']) !!} -
-

{{ trans('general.finish') }}

-
- - -
- - {{ Form::textGroup('company_tax_number', trans('general.tax_number'), 'percent', []) }} - - {{ Form::textGroup('company_phone', trans('settings.company.phone'), 'phone', []) }} - - {{ Form::textareaGroup('company_address', trans('settings.company.address')) }} -
- - - - - - {!! Form::close() !!}
@endsection diff --git a/resources/views/wizard/taxes/edit.blade.php b/resources/views/wizard/taxes/edit.blade.php index 75e1d9caa..767439344 100644 --- a/resources/views/wizard/taxes/edit.blade.php +++ b/resources/views/wizard/taxes/edit.blade.php @@ -30,20 +30,63 @@
- {!! Form::model([], ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/taxes'], 'role' => 'form', 'class' => 'form-loading-button']) !!} -

{{ trans_choice('general.taxes', 1) }}

- - {{ Form::textGroup('company_tax_number', trans('general.tax_number'), 'percent', []) }} - - {{ Form::textGroup('company_phone', trans('settings.company.phone'), 'phone', []) }} - - {{ Form::textareaGroup('company_address', trans('settings.company.address')) }} +
+ + + + + + + + + + + @foreach($taxes as $item) + + + + + + + @endforeach + + + + +
@sortablelink('name', trans('general.name'))@sortablelink('rate', trans('taxes.rate_percent')){{ trans('general.actions') }}
{{ $item->name }}{{ $item->rate }} +
+ + +
+
+  {{ trans('general.add_new') }} +
+
@@ -57,7 +100,6 @@
- {!! Form::close() !!} @endsection