Customers Add+Edit, API WP

This commit is contained in:
Kevin Adametz 2020-06-12 14:46:51 +02:00
parent dc63fa9fb2
commit 75a0f9a38a
120 changed files with 11894 additions and 6134 deletions

View file

@ -36,14 +36,14 @@
{{ Form::text('ru', $country->ru, array('placeholder'=>__('Land RU'), 'class'=>'form-control', 'id'=>'ru')) }}
</div>
</div>
<hr>
<hr>
<div class="form-row">
<div class="form-group col-sm-6">
<label class="form-label" for="code">{{ __('code') }}</label>
<label class="form-label" for="code">Ländercode</label>
{{ Form::text('code', $country->code, array('placeholder'=>__('code'), 'class'=>'form-control', 'id'=>'code')) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="phone">{{ __('phone') }}</label>
<label class="form-label" for="phone">Telefonvorwahl</label>
{{ Form::text('phone', $country->phone, array('placeholder'=>__('phone'), 'class'=>'form-control', 'id'=>'phone')) }}
</div>
</div>
@ -51,6 +51,66 @@
</div>
<div class="card mb-2">
<h5 class="card-header">
Anzeige und Währung
</h5>
<div class="card-body">
<div class="form-row">
<div class="form-group col-sm-12">
<label class="custom-control custom-checkbox">
{!! Form::checkbox('switch', 1, $country->switch, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">Land aus Auswahl auf der Webseite anzeigen (Länderwechsel)</span>
</label>
</div>
<div class="form-group col-sm-12">
<label class="custom-control custom-checkbox">
{!! Form::checkbox('own_eur', 1, $country->own_eur, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">Land hat eigenen EURO Preis</span>
</label>
</div>
<div class="col-12">
<hr class="mt-0">
</div>
<div class="form-group col-sm-6">
<label class="form-label">Eigene Währung</label>
<label class="custom-control custom-checkbox">
{!! Form::checkbox('currency', 1, $country->currency, ['class'=>'custom-control-input', 'id'=>'currency']) !!}
<span class="custom-control-label">Land hat eigene Währung<br>(Währung wird nur zuzsätzlich zum EUR angezeigt, bezahlt wird in EUR)</span>
</label>
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="currency_unit">Abkürzung der Währung</label>
{{ Form::text('currency_unit', $country->currency_unit, array('placeholder'=>__('CHF'), 'class'=>'form-control', 'id'=>'currency_unit')) }}
</div>
</div>
<div id="show_currency_calc" style="display: @if($country->currency) block @else none @endif">
<div class="form-row">
<div class="col-12">
<hr class="mt-0" >
</div>
<div class="form-group col-sm-6">
<label class="form-label">Umrechnungsfaktor zum EUR {{$country->currency_calc}}</label>
<div class="custom-controls-stacked">
<label class="custom-control custom-radio">
{!! Form::radio('currency_calc', 0, !$country->currency_calc, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">dient nur als Anzeigungshilfe, jeder Preis wird manuell angegeben</span>
</label>
<label class="custom-control custom-radio">
{!! Form::radio('currency_calc', 1, $country->currency_calc, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">berechnet den Preis automatisch</span>
</label>
</div>
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="currency_faktor">Faktor Währungen zum Euro (z.B. 1 Euro zu 1,07 CHF)</label>
{{ Form::text('currency_faktor', formatNumber($country->currency_faktor, 4), array('placeholder'=>__('1,07'), 'class'=>'form-control', 'id'=>'currency_faktor')) }}
</div>
</div>
</div>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header">
@ -82,6 +142,7 @@
<div class="card mb-2">
<h5 class="card-header">
{{ __('Übersetzungen') }}
@ -100,3 +161,19 @@
</div>
</div>
<script type="application/javascript">
$( document ).ready(function() {
$('input#currency').on('change', function () {
if($(this).prop('checked')){
$('input#show_currency_calc').prop('checked', true);
$('#show_currency_calc').show('slow');
}else{
$('input#show_currency_calc').prop('checked', false);
$('#show_currency_calc').hide('slow');
}
});
});
</script>

View file

@ -15,6 +15,10 @@
<th>{{__('Code')}}</th>
<th>{{__('Phone')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Länderwechsel')}}</th>
<th>{{__('e. Preis')}}</th>
<th>{{__('e. Währung')}}</th>
<th>{{__('Kalkulation')}}</th>
</tr>
</thead>
<tbody>
@ -28,17 +32,29 @@
<td>{{ $value->de }}</td>
<td>{{ $value->code }}</td>
<td>{{ $value->phone }}</td>
<td data-sort="{{ $value->active }}">@if($value->active) <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>@else<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>@endif</td>
<td data-sort="{{ $value->active }}">{!! get_active_badge($value->active) !!}</td>
<td data-sort="{{ $value->switch }}">{!! get_active_badge($value->switch) !!}</td>
<td data-sort="{{ $value->own_eur }}">{!! get_active_badge($value->own_eur) !!}</td>
<td data-sort="{{ $value->currency }}">{!! get_active_badge($value->currency) !!} {{$value->currency_unit}}</td>
<td data-sort="{{ $value->currency_calc }}">
@if($value->currency)
@if($value->currency_calc)
<span class="badge badge-secondary"><i class="fa fa-cogs"></i> {{$value->currency_faktor}} </span>
@else
<span class="badge badge-info"><i class="fa fa-edit"></i> {{$value->currency_faktor}} </span>
@endif
@else - @endif
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-4 ml-4">
<!-- <a href="{{route('admin_product_category_edit', ['new'])}}" class="btn btn-sm btn-primary">
{{--
<a href="{{route('admin_product_category_edit', ['new'])}}" class="btn btn-sm btn-primary">
{{__('Neue Kategorie erstellen')}}
</a>
-->
--}}
</div>
</div>
</div>
@ -50,13 +66,7 @@
"bLengthChange": false,
"iDisplayLength": 50,
"order": [[ 0, "asc" ]],
"aoColumns": [
{ "sWidth": "8%" },
{ "sWidth": "20%" },
{ "sWidth": "10%" },
{ "sWidth": "10%" },
{ "sWidth": "8%" },
],
"language": {
"url": "/js/German.json"
}