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();
|
||||
|
||||
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 [
|
||||
'name' => 'required|string',
|
||||
'rate' => 'required|min:0|max:100',
|
||||
'type' => 'required|string',
|
||||
'enabled' => 'integer|boolean',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
{{ 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')) }}
|
||||
</div>
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
{{ 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')) }}
|
||||
</div>
|
||||
|
@ -32,7 +32,8 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<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 text-center">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
@ -42,6 +43,7 @@
|
||||
<tr>
|
||||
<td><a href="{{ url('settings/taxes/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
|
||||
<td>{{ $item->rate }}</td>
|
||||
<td>{{ $types[$item->type] }}</td>
|
||||
<td class="hidden-xs">
|
||||
@if ($item->enabled)
|
||||
<span class="label label-success">{{ trans('general.enabled') }}</span>
|
||||
|
Loading…
x
Reference in New Issue
Block a user