Wizard Currencies and Taxes edit page start
This commit is contained in:
parent
6039fcb5f1
commit
2ebe1e34c3
@ -19,7 +19,7 @@ class Companies extends Controller
|
|||||||
public function edit()
|
public function edit()
|
||||||
{
|
{
|
||||||
if (setting('general.wizard', false)) {
|
if (setting('general.wizard', false)) {
|
||||||
//return redirect('/');
|
return redirect('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
$company = Company::find(session('company_id'));
|
$company = Company::find(session('company_id'));
|
||||||
@ -76,11 +76,6 @@ class Companies extends Controller
|
|||||||
// Save all settings
|
// Save all settings
|
||||||
setting()->save();
|
setting()->save();
|
||||||
|
|
||||||
// Redirect
|
|
||||||
$message = trans('messages.success.updated', ['type' => trans_choice('general.companies', 1)]);
|
|
||||||
|
|
||||||
flash($message)->success();
|
|
||||||
|
|
||||||
return redirect('wizard/currencies');
|
return redirect('wizard/currencies');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class Currencies extends Controller
|
|||||||
public function edit()
|
public function edit()
|
||||||
{
|
{
|
||||||
if (setting('general.wizard', false)) {
|
if (setting('general.wizard', false)) {
|
||||||
//return redirect('/');
|
return redirect('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
$currencies = Currency::all();
|
$currencies = Currency::all();
|
||||||
|
@ -15,13 +15,14 @@ class Finish extends Controller
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
if (setting(setting('general.wizard', false))) {
|
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(''));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,13 @@ class Taxes extends Controller
|
|||||||
*/
|
*/
|
||||||
public function edit()
|
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'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,20 +30,65 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box box-success">
|
<div class="box box-success">
|
||||||
{!! Form::model([], ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/currencies'], 'role' => 'form', 'class' => 'form-loading-button']) !!}
|
|
||||||
|
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">{{ trans_choice('general.currencies', 1) }}</h3>
|
<h3 class="box-title">{{ trans_choice('general.currencies', 1) }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-header -->
|
<!-- /.box-header -->
|
||||||
|
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
|
<div class="table table-responsive">
|
||||||
{{ Form::textGroup('company_tax_number', trans('general.tax_number'), 'percent', []) }}
|
<table class="table table-striped table-hover" id="tbl-currencies">
|
||||||
|
<thead>
|
||||||
{{ Form::textGroup('company_phone', trans('settings.company.phone'), 'phone', []) }}
|
<tr>
|
||||||
|
<th class="col-md-5">@sortablelink('name', trans('general.name'))</th>
|
||||||
{{ Form::textareaGroup('company_address', trans('settings.company.address')) }}
|
<th class="col-md-3 hidden-xs">@sortablelink('code', trans('currencies.code'))</th>
|
||||||
|
<th class="col-md-2">@sortablelink('rate', trans('currencies.rate'))</th>
|
||||||
|
<th class="col-md-1 hidden-xs">@sortablelink('enabled', trans_choice('general.statuses', 1))</th>
|
||||||
|
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($currencies as $item)
|
||||||
|
<tr>
|
||||||
|
<td><a href="{{ url('settings/currencies/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
|
||||||
|
<td class="hidden-xs">{{ $item->code }}</td>
|
||||||
|
<td>{{ $item->rate }}</td>
|
||||||
|
<td class="hidden-xs">
|
||||||
|
@if ($item->enabled)
|
||||||
|
<span class="label label-success">{{ trans('general.enabled') }}</span>
|
||||||
|
@else
|
||||||
|
<span class="label label-danger">{{ trans('general.disabled') }}</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-toggle-position="left" aria-expanded="false">
|
||||||
|
<i class="fa fa-ellipsis-h"></i>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right">
|
||||||
|
<li><a href="{{ url('settings/currencies/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
|
||||||
|
@if ($item->enabled)
|
||||||
|
<li><a href="{{ route('currencies.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
|
||||||
|
@else
|
||||||
|
<li><a href="{{ route('currencies.enable', $item->id) }}">{{ trans('general.enable') }}</a></li>
|
||||||
|
@endif
|
||||||
|
@permission('delete-settings-currencies')
|
||||||
|
<li class="divider"></li>
|
||||||
|
<li>{!! Form::deleteLink($item, 'settings/currencies') !!}</li>
|
||||||
|
@endpermission
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
<tr id="add-new">
|
||||||
|
<td colspan="5" class="text-right">
|
||||||
|
<span class="new-button"><a href="{{ url('settings/currencies/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
|
|
||||||
@ -56,8 +101,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-footer -->
|
<!-- /.box-footer -->
|
||||||
|
|
||||||
{!! Form::close() !!}
|
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@ -1,160 +0,0 @@
|
|||||||
@extends('layouts.wizard')
|
|
||||||
|
|
||||||
@section('title', trans('general.wizard'))
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<!-- Default box -->
|
|
||||||
<div class="box box-success">
|
|
||||||
{!! Form::model($company, ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/companies', $company->id], 'role' => 'form', 'class' => 'form-loading-button']) !!}
|
|
||||||
<div class="box-header">
|
|
||||||
<div class="stepwizard">
|
|
||||||
<div class="stepwizard-row setup-panel">
|
|
||||||
<div class="stepwizard-step col-xs-3">
|
|
||||||
<a href="#step-1" type="button" class="btn btn-success btn-circle">1</a>
|
|
||||||
<p><small>{{ trans_choice('general.companies', 1) }}</small></p>
|
|
||||||
</div>
|
|
||||||
<div class="stepwizard-step col-xs-3">
|
|
||||||
<a href="#step-2" type="button" class="btn btn-default btn-circle" disabled="disabled">2</a>
|
|
||||||
<p><small>{{ trans_choice('general.currencies', 2) }}</small></p>
|
|
||||||
</div>
|
|
||||||
<div class="stepwizard-step col-xs-3">
|
|
||||||
<a href="#step-3" type="button" class="btn btn-default btn-circle" disabled="disabled">3</a>
|
|
||||||
<p><small>{{ trans_choice('general.taxes', 2) }}</small></p>
|
|
||||||
</div>
|
|
||||||
<div class="stepwizard-step col-xs-3">
|
|
||||||
<a href="#step-4" type="button" class="btn btn-default btn-circle" disabled="disabled">4</a>
|
|
||||||
<p><small>{{ trans_choice('general.companies', 1) }}</small></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box-body">
|
|
||||||
<div class="col-md-12 {!! (!setting('general.api_token', null)) ?: 'hidden' !!}">
|
|
||||||
<div class="form-group required {{ $errors->has('api_token') ? 'has-error' : ''}}">
|
|
||||||
{!! Form::label('sale_price', trans('modules.api_token'), ['class' => 'control-label']) !!}
|
|
||||||
<div class="input-group">
|
|
||||||
<span class="input-group-addon"><i class="fa fa-key"></i></span>
|
|
||||||
{!! Form::text('api_token', setting('general.api_token', null), ['class' => 'form-control', 'required' => 'required', 'placeholder' => trans('general.form.enter', ['field' => trans('modules.api_token')])]) !!}
|
|
||||||
</div>
|
|
||||||
{!! $errors->first('api_token', '<p class="help-block">:message</p>') !!}
|
|
||||||
</div>
|
|
||||||
<p>
|
|
||||||
{!! trans('modules.token_link') !!}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{ 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')) }}
|
|
||||||
</div>
|
|
||||||
<!-- /.box-body -->
|
|
||||||
|
|
||||||
<div class="box-footer">
|
|
||||||
{{ Form::saveButtons('wizard/companies') }}
|
|
||||||
|
|
||||||
{!! Form::button('<span class="fa fa-share"></span> ' . trans('general.skip'), ['type' => 'button', 'class' => 'btn btn-default pull-right', 'data-loading-text' => trans('general.loading')]) !!}
|
|
||||||
</div>
|
|
||||||
<!-- /.box-footer -->
|
|
||||||
|
|
||||||
{!! Form::close() !!}
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
@push('js')
|
|
||||||
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
|
|
||||||
@endpush
|
|
||||||
|
|
||||||
@push('css')
|
|
||||||
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
|
|
||||||
@endpush
|
|
||||||
|
|
||||||
@push('scripts')
|
|
||||||
<script type="text/javascript">
|
|
||||||
var text_yes = '{{ trans('general.yes') }}';
|
|
||||||
var text_no = '{{ trans('general.no') }}';
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
|
|
||||||
var navListItems = $('div.setup-panel div a'),
|
|
||||||
allWells = $('.setup-content'),
|
|
||||||
allNextBtn = $('.nextBtn');
|
|
||||||
|
|
||||||
allWells.hide();
|
|
||||||
|
|
||||||
navListItems.click(function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
var $target = $($(this).attr('href')),
|
|
||||||
$item = $(this);
|
|
||||||
|
|
||||||
if (!$item.hasClass('disabled')) {
|
|
||||||
navListItems.removeClass('btn-success').addClass('btn-default');
|
|
||||||
$item.addClass('btn-success');
|
|
||||||
allWells.hide();
|
|
||||||
$target.show();
|
|
||||||
$target.find('input:eq(0)').focus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
allNextBtn.click(function () {
|
|
||||||
var curStep = $(this).closest(".setup-content"),
|
|
||||||
curStepBtn = curStep.attr("id"),
|
|
||||||
nextStepWizard = $('div.setup-panel div a[href="#' + curStepBtn + '"]').parent().next().children("a"),
|
|
||||||
curInputs = curStep.find("input[type='text'],input[type='url']"),
|
|
||||||
isValid = true;
|
|
||||||
|
|
||||||
$(".form-group").removeClass("has-error");
|
|
||||||
for (var i = 0; i < curInputs.length; i++) {
|
|
||||||
if (!curInputs[i].validity.valid) {
|
|
||||||
isValid = false;
|
|
||||||
$(curInputs[i]).closest(".form-group").addClass("has-error");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isValid) nextStepWizard.removeAttr('disabled').trigger('click');
|
|
||||||
});
|
|
||||||
|
|
||||||
$('div.setup-panel div a.btn-success').trigger('click');
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
|
||||||
$('#company_logo').fancyfile({
|
|
||||||
text : '{{ trans('general.form.select.file') }}',
|
|
||||||
style : 'btn-default',
|
|
||||||
@if($company->company_logo)
|
|
||||||
placeholder : '{{ $company->company_logo->basename }}',
|
|
||||||
@else
|
|
||||||
placeholder : '{{ trans('general.form.no_file_selected') }}',
|
|
||||||
@endif
|
|
||||||
});
|
|
||||||
|
|
||||||
@if($company->company_logo)
|
|
||||||
company_logo_html = '<span class="company_logo">';
|
|
||||||
company_logo_html += ' <a href="{{ url('uploads/' . $company['company_logo']->id . '/download') }}">';
|
|
||||||
company_logo_html += ' <span id="download-company_logo" class="text-primary">';
|
|
||||||
company_logo_html += ' <i class="fa fa-file-{{ $company->company_logo->aggregate_type }}-o"></i> {{ $company->company_logo->basename }}';
|
|
||||||
company_logo_html += ' </span>';
|
|
||||||
company_logo_html += ' </a>';
|
|
||||||
company_logo_html += ' {!! Form::open(['id' => 'company_logo-' . $company->company_logo->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $company->company_logo->id)], 'style' => 'display:inline']) !!}';
|
|
||||||
company_logo_html += ' <a id="remove-company_logo" href="javascript:void();">';
|
|
||||||
company_logo_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
|
||||||
company_logo_html += ' </a>';
|
|
||||||
company_logo_html += ' <input type="hidden" name="page" value="setting" />';
|
|
||||||
company_logo_html += ' <input type="hidden" name="key" value="general.company_logo" />';
|
|
||||||
company_logo_html += ' <input type="hidden" name="value" value="{{ $company->company_logo->id }}" />';
|
|
||||||
company_logo_html += ' {!! Form::close() !!}';
|
|
||||||
company_logo_html += '</span>';
|
|
||||||
|
|
||||||
$('#company .fancy-file .fake-file').append(company_logo_html);
|
|
||||||
|
|
||||||
$(document).on('click', '#remove-company_logo', function (e) {
|
|
||||||
confirmDelete("#company_logo-{!! $company->company_logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $company->company_logo->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
|
||||||
});
|
|
||||||
@endif
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
|
@ -30,34 +30,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box box-success">
|
<div class="box box-success">
|
||||||
{!! Form::model([], ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/taxes'], 'role' => 'form', 'class' => 'form-loading-button']) !!}
|
|
||||||
|
|
||||||
<div class="box-header with-border">
|
|
||||||
<h3 class="box-title">{{ trans('general.finish') }}</h3>
|
|
||||||
</div>
|
|
||||||
<!-- /.box-header -->
|
|
||||||
|
|
||||||
<div class="box-body">
|
|
||||||
|
|
||||||
{{ 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')) }}
|
|
||||||
</div>
|
|
||||||
<!-- /.box-body -->
|
|
||||||
|
|
||||||
<div class="box-footer">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="form-group no-margin">
|
|
||||||
{!! Form::button('<span class="fa fa-save"></span> ' . trans('general.save'), ['type' => 'submit', 'class' => 'btn btn-success button-submit', 'data-loading-text' => trans('general.loading')]) !!}
|
|
||||||
<a href="{{ url('wizard/skip') }}" class="btn btn-default"><span class="fa fa-share"></span> {{ trans('general.skip') }}</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /.box-footer -->
|
|
||||||
|
|
||||||
{!! Form::close() !!}
|
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@ -30,20 +30,63 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box box-success">
|
<div class="box box-success">
|
||||||
{!! Form::model([], ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/taxes'], 'role' => 'form', 'class' => 'form-loading-button']) !!}
|
|
||||||
|
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">{{ trans_choice('general.taxes', 1) }}</h3>
|
<h3 class="box-title">{{ trans_choice('general.taxes', 1) }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-header -->
|
<!-- /.box-header -->
|
||||||
|
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
|
<div class="table table-responsive">
|
||||||
{{ Form::textGroup('company_tax_number', trans('general.tax_number'), 'percent', []) }}
|
<table class="table table-striped table-hover" id="tbl-taxes">
|
||||||
|
<thead>
|
||||||
{{ Form::textGroup('company_phone', trans('settings.company.phone'), 'phone', []) }}
|
<tr>
|
||||||
|
<th class="col-md-5">@sortablelink('name', trans('general.name'))</th>
|
||||||
{{ Form::textareaGroup('company_address', trans('settings.company.address')) }}
|
<th class="col-md-5">@sortablelink('rate', trans('taxes.rate_percent'))</th>
|
||||||
|
<th class="col-md-1 hidden-xs">@sortablelink('enabled', trans_choice('general.statuses', 1))</th>
|
||||||
|
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($taxes as $item)
|
||||||
|
<tr>
|
||||||
|
<td><a href="{{ url('settings/taxes/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
|
||||||
|
<td>{{ $item->rate }}</td>
|
||||||
|
<td class="hidden-xs">
|
||||||
|
@if ($item->enabled)
|
||||||
|
<span class="label label-success">{{ trans('general.enabled') }}</span>
|
||||||
|
@else
|
||||||
|
<span class="label label-danger">{{ trans('general.disabled') }}</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-toggle-position="left" aria-expanded="false">
|
||||||
|
<i class="fa fa-ellipsis-h"></i>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right">
|
||||||
|
<li><a href="{{ url('settings/taxes/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
|
||||||
|
@if ($item->enabled)
|
||||||
|
<li><a href="{{ route('taxes.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
|
||||||
|
@else
|
||||||
|
<li><a href="{{ route('taxes.enable', $item->id) }}">{{ trans('general.enable') }}</a></li>
|
||||||
|
@endif
|
||||||
|
@permission('delete-settings-taxes')
|
||||||
|
<li class="divider"></li>
|
||||||
|
<li>{!! Form::deleteLink($item, 'settings/taxes', 'tax_rates') !!}</li>
|
||||||
|
@endpermission
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" class="text-right">
|
||||||
|
<span class="new-button"><a href="{{ url('settings/taxes/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
|
|
||||||
@ -57,7 +100,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- /.box-footer -->
|
<!-- /.box-footer -->
|
||||||
|
|
||||||
{!! Form::close() !!}
|
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user