diff --git a/app/Events/AdminMenuCreated.php b/app/Events/AdminMenuCreated.php index 9883abb09..764c931bf 100644 --- a/app/Events/AdminMenuCreated.php +++ b/app/Events/AdminMenuCreated.php @@ -15,4 +15,4 @@ class AdminMenuCreated { $this->menu = $menu; } -} \ No newline at end of file +} diff --git a/app/Events/BillCreated.php b/app/Events/BillCreated.php index fc4881a74..11b29cc1e 100644 --- a/app/Events/BillCreated.php +++ b/app/Events/BillCreated.php @@ -15,4 +15,4 @@ class BillCreated { $this->bill = $bill; } -} \ No newline at end of file +} diff --git a/app/Events/BillUpdated.php b/app/Events/BillUpdated.php index 21751e17a..563eb3254 100644 --- a/app/Events/BillUpdated.php +++ b/app/Events/BillUpdated.php @@ -15,4 +15,4 @@ class BillUpdated { $this->bill = $bill; } -} \ No newline at end of file +} diff --git a/app/Events/CompanySwitched.php b/app/Events/CompanySwitched.php index 3738c8dae..2a25ec4e0 100644 --- a/app/Events/CompanySwitched.php +++ b/app/Events/CompanySwitched.php @@ -15,4 +15,4 @@ class CompanySwitched { $this->company = $company; } -} \ No newline at end of file +} diff --git a/app/Events/CustomerMenuCreated.php b/app/Events/CustomerMenuCreated.php index 5766e1ba2..b7c6fcccc 100644 --- a/app/Events/CustomerMenuCreated.php +++ b/app/Events/CustomerMenuCreated.php @@ -15,4 +15,4 @@ class CustomerMenuCreated { $this->menu = $menu; } -} \ No newline at end of file +} diff --git a/app/Events/InvoiceCreated.php b/app/Events/InvoiceCreated.php index afa2e3c62..e6ab023a8 100644 --- a/app/Events/InvoiceCreated.php +++ b/app/Events/InvoiceCreated.php @@ -15,4 +15,4 @@ class InvoiceCreated { $this->invoice = $invoice; } -} \ No newline at end of file +} diff --git a/app/Events/InvoicePrinting.php b/app/Events/InvoicePrinting.php index f775b69dc..78fb14c7d 100644 --- a/app/Events/InvoicePrinting.php +++ b/app/Events/InvoicePrinting.php @@ -15,4 +15,4 @@ class InvoicePrinting { $this->invoice = $invoice; } -} \ No newline at end of file +} diff --git a/app/Events/InvoiceUpdated.php b/app/Events/InvoiceUpdated.php index d9d6fc3ee..2f4db58e3 100644 --- a/app/Events/InvoiceUpdated.php +++ b/app/Events/InvoiceUpdated.php @@ -15,4 +15,4 @@ class InvoiceUpdated { $this->invoice = $invoice; } -} \ No newline at end of file +} diff --git a/app/Events/ModuleInstalled.php b/app/Events/ModuleInstalled.php index b581eb539..3ce3ef2b0 100644 --- a/app/Events/ModuleInstalled.php +++ b/app/Events/ModuleInstalled.php @@ -19,4 +19,4 @@ class ModuleInstalled $this->alias = $alias; $this->company_id = $company_id; } -} \ No newline at end of file +} diff --git a/app/Events/UpdateFinished.php b/app/Events/UpdateFinished.php index d221c60fd..8af0b3177 100644 --- a/app/Events/UpdateFinished.php +++ b/app/Events/UpdateFinished.php @@ -23,4 +23,4 @@ class UpdateFinished $this->old = $old; $this->new = $new; } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Auth/Login.php b/app/Http/Controllers/Auth/Login.php index ea2aabbf8..68d3ca69d 100644 --- a/app/Http/Controllers/Auth/Login.php +++ b/app/Http/Controllers/Auth/Login.php @@ -79,6 +79,11 @@ class Login extends Controller return redirect($path); } + // Check wizard + if (!setting('general.wizard', false)) { + return redirect('wizard'); + } + return redirect('/'); } diff --git a/app/Http/Controllers/Wizard/Companies.php b/app/Http/Controllers/Wizard/Companies.php new file mode 100644 index 000000000..a9fdeaff2 --- /dev/null +++ b/app/Http/Controllers/Wizard/Companies.php @@ -0,0 +1,73 @@ +setSettings(); + + return view('wizard.companies.edit', compact('company', 'currencies')); + } + + /** + * Update the specified resource in storage. + * + * @param Company $company + * @param Request $request + * + * @return Response + */ + public function update(Company $company, Request $request) + { + // Update company + $company->update($request->input()); + + // Get the company settings + setting()->forgetAll(); + setting()->setExtraColumns(['company_id' => $company->id]); + setting()->load(true); + + // Update settings + setting()->set('general.company_name', $request->get('company_name')); + setting()->set('general.company_email', $request->get('company_email')); + setting()->set('general.company_address', $request->get('company_address')); + + if ($request->file('company_logo')) { + $company_logo = $this->getMedia($request->file('company_logo'), 'settings', $company->id); + + if ($company_logo) { + $company->attachMedia($company_logo, 'company_logo'); + + setting()->set('general.company_logo', $company_logo->id); + } + } + + setting()->set('general.default_payment_method', 'offlinepayment.cash.1'); + setting()->set('general.default_currency', $request->get('default_currency')); + + setting()->save(); + + // Redirect + $message = trans('messages.success.updated', ['type' => trans_choice('general.companies', 1)]); + + flash($message)->success(); + + return redirect('common/companies'); + } +} diff --git a/app/Http/Controllers/Wizard/Currencies.php b/app/Http/Controllers/Wizard/Currencies.php new file mode 100644 index 000000000..1b8cde9a5 --- /dev/null +++ b/app/Http/Controllers/Wizard/Currencies.php @@ -0,0 +1,96 @@ +toArray(); + + // Prepare codes + $codes = array(); + $currencies = MoneyCurrency::getCurrencies(); + foreach ($currencies as $key => $item) { + // Don't show if already available + if (($key != $currency->code) && in_array($key, $current)) { + continue; + } + + $codes[$key] = $key; + } + + // Set default currency + $currency->default_currency = ($currency->code == setting('general.default_currency')) ? 1 : 0; + + return view('settings.currencies.edit', compact('currency', 'codes')); + } + + /** + * Update the specified resource in storage. + * + * @param Currency $currency + * @param Request $request + * + * @return Response + */ + public function update(Currency $currency, Request $request) + { + // Check if we can disable or change the code + if (!$request['enabled'] || ($currency->code != $request['code'])) { + $relationships = $this->countRelationships($currency, [ + 'accounts' => 'accounts', + 'customers' => 'customers', + 'invoices' => 'invoices', + 'revenues' => 'revenues', + 'bills' => 'bills', + 'payments' => 'payments', + ]); + + if ($currency->code == setting('general.default_currency')) { + $relationships[] = strtolower(trans_choice('general.companies', 1)); + } + } + + if (empty($relationships)) { + // Force the rate to be 1 for default currency + if ($request['default_currency']) { + $request['rate'] = '1'; + } + + $currency->update($request->all()); + + // Update default currency setting + if ($request['default_currency']) { + setting()->set('general.default_currency', $request['code']); + setting()->save(); + } + + $message = trans('messages.success.updated', ['type' => trans_choice('general.currencies', 1)]); + + flash($message)->success(); + + return redirect('settings/currencies'); + } else { + $message = trans('messages.warning.disabled', ['name' => $currency->name, 'text' => implode(', ', $relationships)]); + + flash($message)->warning(); + + return redirect('settings/currencies/' . $currency->id . '/edit'); + } + } +} diff --git a/app/Http/Controllers/Wizard/Finish.php b/app/Http/Controllers/Wizard/Finish.php new file mode 100644 index 000000000..1c474f59f --- /dev/null +++ b/app/Http/Controllers/Wizard/Finish.php @@ -0,0 +1,73 @@ +setSettings(); + + return view('wizard.companies.edit', compact('company', 'currencies')); + } + + /** + * Update the specified resource in storage. + * + * @param Company $company + * @param Request $request + * + * @return Response + */ + public function update(Company $company, Request $request) + { + // Update company + $company->update($request->input()); + + // Get the company settings + setting()->forgetAll(); + setting()->setExtraColumns(['company_id' => $company->id]); + setting()->load(true); + + // Update settings + setting()->set('general.company_name', $request->get('company_name')); + setting()->set('general.company_email', $request->get('company_email')); + setting()->set('general.company_address', $request->get('company_address')); + + if ($request->file('company_logo')) { + $company_logo = $this->getMedia($request->file('company_logo'), 'settings', $company->id); + + if ($company_logo) { + $company->attachMedia($company_logo, 'company_logo'); + + setting()->set('general.company_logo', $company_logo->id); + } + } + + setting()->set('general.default_payment_method', 'offlinepayment.cash.1'); + setting()->set('general.default_currency', $request->get('default_currency')); + + setting()->save(); + + // Redirect + $message = trans('messages.success.updated', ['type' => trans_choice('general.companies', 1)]); + + flash($message)->success(); + + return redirect('common/companies'); + } +} diff --git a/app/Http/Controllers/Wizard/Taxes.php b/app/Http/Controllers/Wizard/Taxes.php new file mode 100644 index 000000000..9f0bcb12a --- /dev/null +++ b/app/Http/Controllers/Wizard/Taxes.php @@ -0,0 +1,125 @@ +all()); + + $message = trans('messages.success.added', ['type' => trans_choice('general.tax_rates', 1)]); + + flash($message)->success(); + + return redirect('settings/taxes'); + } + + /** + * Show the form for editing the specified resource. + * + * @param Tax $tax + * + * @return Response + */ + public function edit(Tax $tax) + { + return view('settings.taxes.edit', compact('tax')); + } + + /** + * Update the specified resource in storage. + * + * @param Tax $tax + * @param Request $request + * + * @return Response + */ + public function update(Tax $tax, Request $request) + { + $relationships = $this->countRelationships($tax, [ + 'items' => 'items', + 'invoice_items' => 'invoices', + 'bill_items' => 'bills', + ]); + + if (empty($relationships) || $request['enabled']) { + $tax->update($request->all()); + + $message = trans('messages.success.updated', ['type' => trans_choice('general.tax_rates', 1)]); + + flash($message)->success(); + + return redirect('settings/taxes'); + } else { + $message = trans('messages.warning.disabled', ['name' => $tax->name, 'text' => implode(', ', $relationships)]); + + flash($message)->warning(); + + return redirect('settings/taxes/' . $tax->id . '/edit'); + } + } + + /** + * Enable the specified resource. + * + * @param Tax $tax + * + * @return Response + */ + public function enable(Tax $tax) + { + $tax->enabled = 1; + $tax->save(); + + $message = trans('messages.success.enabled', ['type' => trans_choice('general.tax_rates', 1)]); + + flash($message)->success(); + + return redirect()->route('taxes.index'); + } + + /** + * Disable the specified resource. + * + * @param Tax $tax + * + * @return Response + */ + public function disable(Tax $tax) + { + $relationships = $this->countRelationships($tax, [ + 'items' => 'items', + 'invoice_items' => 'invoices', + 'bill_items' => 'bills', + ]); + + if (empty($relationships)) { + $tax->enabled = 0; + $tax->save(); + + $message = trans('messages.success.disabled', ['type' => trans_choice('general.tax_rates', 1)]); + + flash($message)->success(); + } else { + $message = trans('messages.warning.disabled', ['name' => $tax->name, 'text' => implode(', ', $relationships)]); + + flash($message)->warning(); + + return redirect()->route('taxes.index'); + } + + return redirect()->route('taxes.index'); + } +} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 7ce07c8a5..8f21fcc23 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -41,6 +41,13 @@ class Kernel extends HttpKernel 'company.currencies', ], + 'wizard' => [ + 'web', + 'language', + 'auth', + 'permission:read-admin-panel', + ], + 'admin' => [ 'web', 'language', diff --git a/app/Http/Middleware/AdminMenu.php b/app/Http/Middleware/AdminMenu.php index 817204b3c..2acf708a0 100644 --- a/app/Http/Middleware/AdminMenu.php +++ b/app/Http/Middleware/AdminMenu.php @@ -204,4 +204,4 @@ class AdminMenu return $next($request); } -} \ No newline at end of file +} diff --git a/app/Providers/ViewComposerServiceProvider.php b/app/Providers/ViewComposerServiceProvider.php index 7cd15d6ac..0e690522a 100644 --- a/app/Providers/ViewComposerServiceProvider.php +++ b/app/Providers/ViewComposerServiceProvider.php @@ -31,7 +31,7 @@ class ViewComposerServiceProvider extends ServiceProvider // Add notifications to header View::composer( - ['partials.admin.header', 'partials.customer.header'], 'App\Http\ViewComposers\Header' + ['partials.wizard.header', 'partials.admin.header', 'partials.customer.header'], 'App\Http\ViewComposers\Header' ); // Add limits to index diff --git a/app/Utilities/Installer.php b/app/Utilities/Installer.php index 5d6f8116f..5fbe6c244 100644 --- a/app/Utilities/Installer.php +++ b/app/Utilities/Installer.php @@ -157,7 +157,7 @@ class Installer try { DB::connection('install_test')->getPdo(); - } catch (\Exception $e) {; + } catch (\Exception $e) { return false; } diff --git a/public/css/app.css b/public/css/app.css index 0058aecdf..80692f1aa 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -772,4 +772,49 @@ input[type="number"] { #items .select2-search__field { padding-left: 15px; -} \ No newline at end of file +} + +.stepwizard-step p { + margin-top: 0px; + color:#666; +} +.stepwizard-row { + display: table-row; +} +.stepwizard { + display: table; + width: 100%; + position: relative; +} +.stepwizard-step button[disabled] { + /*opacity: 1 !important; + filter: alpha(opacity=100) !important;*/ +} +.stepwizard .btn.disabled, .stepwizard .btn[disabled], .stepwizard fieldset[disabled] .btn { + opacity:1 !important; + color:#bbb; +} +.stepwizard-row:before { + top: 14px; + bottom: 0; + position: absolute; + content:" "; + width: 100%; + height: 1px; + background-color: #ccc; + z-index: 0; +} +.stepwizard-step { + display: table-cell; + text-align: center; + position: relative; +} +.btn-circle { + width: 30px; + height: 30px; + text-align: center; + padding: 6px 0; + font-size: 12px; + line-height: 1.428571429; + border-radius: 15px; +} diff --git a/public/js/app.js b/public/js/app.js index f439f68c0..5b153e223 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -198,7 +198,9 @@ $(document).ready(function () { return true; }); - $('.input-group-invoice-text select').select2(); + if (document.getElementsByClassName('input-group-invoice-text').length) { + $('.input-group-invoice-text select').select2(); + } }); function confirmDelete(form_id, title, message, button_cancel, button_delete) { diff --git a/resources/views/layouts/wizard.blade.php b/resources/views/layouts/wizard.blade.php new file mode 100644 index 000000000..39bb46c2d --- /dev/null +++ b/resources/views/layouts/wizard.blade.php @@ -0,0 +1,18 @@ + + @include('partials.wizard.head') + + + @stack('body_start') + + +
+ @include('partials.wizard.header') + + @include('partials.wizard.content') + + @include('partials.wizard.footer') +
+ + @stack('body_end') + + diff --git a/resources/views/partials/wizard/content.blade.php b/resources/views/partials/wizard/content.blade.php new file mode 100644 index 000000000..654309016 --- /dev/null +++ b/resources/views/partials/wizard/content.blade.php @@ -0,0 +1,39 @@ +@stack('content_start') + + +
+ @stack('content_wrapper_start') + + +
+ @stack('content_header_start') + +

+ @yield('title') + @yield('new_button') +

+ + @stack('content_header_end') +
+ + +
+ @include('flash::message') + + @stack('content_content_start') + + @yield('content') + + @stack('content_content_end') +
+ + + @stack('content_wrapper_end') +
+ + + + +@stack('content_end') \ No newline at end of file diff --git a/resources/views/partials/wizard/footer.blade.php b/resources/views/partials/wizard/footer.blade.php new file mode 100644 index 000000000..9e7ddf297 --- /dev/null +++ b/resources/views/partials/wizard/footer.blade.php @@ -0,0 +1,10 @@ +@stack('footer_start') + + + +@stack('footer_end') diff --git a/resources/views/partials/wizard/head.blade.php b/resources/views/partials/wizard/head.blade.php new file mode 100644 index 000000000..95ceb8001 --- /dev/null +++ b/resources/views/partials/wizard/head.blade.php @@ -0,0 +1,67 @@ + + @stack('head_start') + + + + + + + @yield('title') - @setting('general.company_name') + + + + + + + + + + + @if (setting('general.admin_theme', 'skin-green-light') == 'skin-green-light') + + @else + + + @endif + + + + + + + + + @stack('css') + + @stack('stylesheet') + + + + + + + + + + + + + + + + + + + + + + + @stack('js') + + @stack('scripts') + + @stack('head_end') + diff --git a/resources/views/partials/wizard/header.blade.php b/resources/views/partials/wizard/header.blade.php new file mode 100644 index 000000000..b31d72258 --- /dev/null +++ b/resources/views/partials/wizard/header.blade.php @@ -0,0 +1,85 @@ +@stack('header_start') + +
+ + + + +
+ +@stack('header_end') diff --git a/resources/views/partials/wizard/pagination.blade.php b/resources/views/partials/wizard/pagination.blade.php new file mode 100644 index 000000000..395807023 --- /dev/null +++ b/resources/views/partials/wizard/pagination.blade.php @@ -0,0 +1,16 @@ +@stack('pagination_start') + +@if ($items->firstItem()) +
+ {{ trans('pagination.showing', ['first' => $items->firstItem(), 'last' => $items->lastItem(), 'total' => $items->total(), 'type' => strtolower(trans_choice('general.' . $type, 2))]) }} +
+
+ {!! $items->appends(request()->except('page'))->links() !!} +
+@else +
+ {{ trans('general.no_records') }} +
+@endif + +@stack('pagination_end') \ No newline at end of file diff --git a/resources/views/settings/settings/edit.blade.php b/resources/views/settings/settings/edit.blade.php index 8b8d99f91..37a5700bf 100644 --- a/resources/views/settings/settings/edit.blade.php +++ b/resources/views/settings/settings/edit.blade.php @@ -39,6 +39,8 @@ {{ Form::textareaGroup('company_address', trans('settings.company.address')) }} {{ Form::fileGroup('company_logo', trans('settings.company.logo')) }} + + {!! Form::hidden('wizard', null, ['id' => 'wizard']) !!}
diff --git a/resources/views/wizard/companies/edit.blade.php b/resources/views/wizard/companies/edit.blade.php new file mode 100644 index 000000000..317a6fbb3 --- /dev/null +++ b/resources/views/wizard/companies/edit.blade.php @@ -0,0 +1,160 @@ +@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/currencies/edit.blade.php b/resources/views/wizard/currencies/edit.blade.php new file mode 100644 index 000000000..317a6fbb3 --- /dev/null +++ b/resources/views/wizard/currencies/edit.blade.php @@ -0,0 +1,160 @@ +@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/edit.blade.php b/resources/views/wizard/finish/edit.blade.php new file mode 100644 index 000000000..317a6fbb3 --- /dev/null +++ b/resources/views/wizard/finish/edit.blade.php @@ -0,0 +1,160 @@ +@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/taxes/edit.blade.php b/resources/views/wizard/taxes/edit.blade.php new file mode 100644 index 000000000..317a6fbb3 --- /dev/null +++ b/resources/views/wizard/taxes/edit.blade.php @@ -0,0 +1,160 @@ +@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/routes/web.php b/routes/web.php index 127316e8c..a7e12bf81 100644 --- a/routes/web.php +++ b/routes/web.php @@ -7,6 +7,23 @@ Route::group(['middleware' => 'language'], function () { Route::get('{id}/download', 'Common\Uploads@download'); }); + Route::group(['middleware' => 'permission:read-admin-panel'], function () { + Route::group(['prefix' => 'wizard'], function () { + Route::get('/', 'Wizard\Companies@edit'); + Route::get('companies', 'Wizard\Companies@edit'); + Route::post('companies', 'Wizard\Companies@update'); + + Route::get('currencies', 'Wizard\Currencies@create'); + Route::post('language', 'Wizard\Currencies@store'); + + Route::get('taxes', 'Wizard\Taxes@create'); + Route::post('taxes', 'Wizard\Taxes@store'); + + Route::get('finish', 'Wizard\Finish@create'); + Route::post('finish', 'Wizard\Finish@store'); + }); + }); + Route::group(['middleware' => ['adminmenu', 'permission:read-admin-panel']], function () { Route::get('/', 'Common\Dashboard@index');