close #611 Fixed: Create tax rate not null type.
This commit is contained in:
parent
636afc4565
commit
d30fe4da9b
@ -18,7 +18,13 @@ class Taxes extends Controller
|
|||||||
{
|
{
|
||||||
$taxes = Tax::collect();
|
$taxes = Tax::collect();
|
||||||
|
|
||||||
return view('settings.taxes.index', compact('taxes', 'rates'));
|
$types = [
|
||||||
|
'normal' => trans('taxes.normal'),
|
||||||
|
'inclusive' => trans('taxes.inclusive'),
|
||||||
|
'compound' => trans('taxes.compound'),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('settings.taxes.index', compact('taxes', 'types'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,6 +26,8 @@ class Tax extends Request
|
|||||||
return [
|
return [
|
||||||
'name' => 'required|string',
|
'name' => 'required|string',
|
||||||
'rate' => 'required|min:0|max:100',
|
'rate' => 'required|min:0|max:100',
|
||||||
|
'type' => 'required|string',
|
||||||
|
'enabled' => 'integer|boolean',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }}
|
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }}
|
||||||
|
|
||||||
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, null, []) }}
|
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, 'normal') }}
|
||||||
|
|
||||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }}
|
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }}
|
||||||
|
|
||||||
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, null, []) }}
|
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, null) }}
|
||||||
|
|
||||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,7 +32,8 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="col-md-5">@sortablelink('name', trans('general.name'))</th>
|
<th class="col-md-5">@sortablelink('name', trans('general.name'))</th>
|
||||||
<th class="col-md-5">@sortablelink('rate', trans('taxes.rate_percent'))</th>
|
<th class="col-md-3">@sortablelink('rate', trans('taxes.rate_percent'))</th>
|
||||||
|
<th class="col-md-2">@sortablelink('type', trans_choice('general.types', 1))</th>
|
||||||
<th class="col-md-1 hidden-xs">@sortablelink('enabled', trans_choice('general.statuses', 1))</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>
|
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -42,6 +43,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><a href="{{ url('settings/taxes/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
|
<td><a href="{{ url('settings/taxes/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
|
||||||
<td>{{ $item->rate }}</td>
|
<td>{{ $item->rate }}</td>
|
||||||
|
<td>{{ $types[$item->type] }}</td>
|
||||||
<td class="hidden-xs">
|
<td class="hidden-xs">
|
||||||
@if ($item->enabled)
|
@if ($item->enabled)
|
||||||
<span class="label label-success">{{ trans('general.enabled') }}</span>
|
<span class="label label-success">{{ trans('general.enabled') }}</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user