API Shopping Order backend

This commit is contained in:
Kevin Adametz 2022-07-15 21:21:56 +02:00
parent 7a040c3e19
commit d01b4bd560
24 changed files with 1584 additions and 34 deletions

View file

@ -0,0 +1,23 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
{{ __('Bestellung Kunde') }} <span class="text-muted">#{{$shopping_order->id}}</span>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">
@include('admin.sales._detail')
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
</div>
<script>
$( document ).ready(function() {
});
</script>
</div>

View file

@ -0,0 +1,194 @@
@extends('layouts.layout-2')
@section('content')
<style>
tr.border-none td {
border:none;
}
tr.td-small td {
font-size: 0.9em;
padding-top: 0.2em;
padding-bottom: 0.2em;
}
</style>
<h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
<div>{{ __('Externe Bestellungen') }} | bestellen</div>
<a href="{{route('user_shop_api_orders')}}" class="btn btn-sm btn-default float-right">zurück</a>
</h4>
@if(Session::has('custom-error'))
<div class="alert alert-dark-warning alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>{{ Session::get('custom-error') }}</strong>
</div>
@endif
{{-- Not includes in shopApiOrderCart
<div class="card mb-4">
<div class="card-body">
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">Bestellland</div>
{{ App\Services\UserService::getOrderInfo('billing_state') }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Lieferland</div>
{{ App\Services\UserService::getOrderInfo('shipping_state') }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">MwSt</div>
{{ App\Services\UserService::getOrderInfo('tax_free') }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Reverse Charge Verfahren</div>
{{ App\Services\UserService::getOrderInfo('user_reverse_charge') }}
</div>
</div>
<i>Das Lieferland kann nicht mehr geändert werden.</i>
</div>
</div>--}}
@if($shopApiOrderCart)
@foreach($shopApiOrderCart->orders as $order)
<div class="card mb-3">
<div class="card-body pb-1">
<div class="row">
</div>
<div class="row">
<div class="col-md-12 mb-3">
Bestellnummer: {{ $order->order_id }} | WP Number: {{ $order->wp_order_number }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Bestelldatum</div>
{{$order->shopping_order->created_at->format("d.m.Y H:i")}}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Anzahl Artikel</div>
{{$order->shopping_order->getItemsCount()}}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Preis gesamt</div>
{{$order->shopping_order->getFormattedTotalShipping()}} &euro;
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Points gesamt</div>
{{ $order->shopping_order->points }}
</div>
<div class="col-md-12 mb-3">
<div class="text-muted small">Rechnungsadresse</div>
{{ $order->billing_address }}
</div>
<div class="col-md-12 mb-3">
<div class="text-muted small">Lieferadresse</div>
{{ $order->shipping_address }}
</div>
</div>
</div>
<div class="card-body pt-1">
<div class="table-responsive">
<table class="table table-product m-0" style="">
<tbody>
<tr class="">
<th class="text-left">Produkt</th>
<th class="text-right">
VK-Preis brutto
</th>
<th class="text-right">Anzahl</th>
<th class="text-right">Summe</th>
</tr>
@foreach($order->shopping_order->shopping_order_items as $shopping_order_item)
<tr class="">
<td class="py-2">
<strong>{{ $shopping_order_item->product->name }}</strong>
<span class="text-muted">#{{ $shopping_order_item->product->number }}</span>
</td>
<td class="align-middle py-2 nowrap text-right" style="min-width:100px;">
{{ $shopping_order_item->getFormattedPrice() }} &euro;
</td>
<td class="align-middle py-2 text-right" style="min-width: 60px;">
{{ $shopping_order_item->qty }}
</td>
<td class="font-weight-semibold align-middle py-2 text-right" style="min-width:120px;">
{{ $shopping_order_item->getFormattedTotalPrice() }} &euro;
</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr class="td-small">
<td colspan="3">
{{__('email.checkout_mail_shipping')}}
</td>
<td style="color:#37302d; text-align: right; vertical-align: top;line-height:1.6em;">
{{ $order->shopping_order->getFormattedShipping() }} &euro;
</td>
</tr>
<tr class="border-none td-small">
<td colspan="3">
{{__('email.checkout_mail_subtotal_ws')}}
</td>
<td style="color:#37302d; text-align: right; vertical-align: top;line-height:1.6em;">
{{ $order->shopping_order->getFormattedSubtotalWs() }} &euro;
</td>
</tr>
<tr class="border-none td-small">
<td colspan="3">
{{__('email.checkout_mail_tax')}}
</td>
<td style="color:#37302d; text-align: right; vertical-align: top;line-height:1.6em;">
{{ $order->shopping_order->getFormattedTax() }} &euro;
</td>
</tr>
<tr>
<td colspan="3">
<b>{{__('email.checkout_mail_total')}}</b>
</td>
<td style="color:#37302d; text-align: right; vertical-align: top;line-height:1.6em;">
<b>{{ $order->shopping_order->getFormattedTotalShipping() }} &euro;</b>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
@endforeach
@endif
<hr>
{!! Form::open(['url' => route('user_shop_api_orders_checkout'), 'class' => 'form-horizontal', 'id'=>'api-order-list-form']) !!}
@foreach($shopApiOrderCart->orders as $order)
{{ Form::hidden('api_action_list[]', $order->order_id) }}
@endforeach
<div class="card mb-4">
<h4 class="card-header">
<div class="row">
<div class="col-12">
<div class="d-flex justify-content-between align-items-center w-100">
<div>Warenkorb</div>
</div>
</div>
</div>
</h4>
<div class="card-body">
@include('user.shop.sales.api_order_list_total')
<hr>
<div class="float-right">
<button type="submit" class="btn btn-secondary"><i class="ion ion-ios-redo"></i> bestätigen und weiter zur Kasse</button>
</div>
<br><br>
<em class="small text-center"> <i class="fa fa-lock"></i> Du wirst auf unseren checkout Server weitergeletet, die Verbindung ist SSL verschlüsselt.</em>
</div>
</div>
{!! Form::close() !!}
@endsection

View file

@ -0,0 +1,125 @@
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th class="text-left">{{__('Produkt')}}</th>
<th class="text-right">{{__('Points')}}</th>
<th class="text-right">{{__('Netto-Preis')}}</th>
<th class="text-right">{{__('Anzahl')}}</th>
<th class="text-right">{{__('Summe Netto')}}</th>
<th class="text-right" style="max-width: 5%">{{__('%')}}</th>
<th class="text-right" style="max-width: 10%">{{__('MwSt')}}</th>
</tr>
</thead>
<tbody>
@foreach($shopApiOrderCart->shop_items as $shop_item)
<tr>
<td>
<strong>{{$shop_item->name}}</strong>
<span class="text-muted">#{{ $shop_item->number }}</span>
</td>
<td class="text-right">
{{$shop_item->points_total}}
</td>
<td class="text-right">
{{ formatNumber($shop_item->user_price_net) }} &euro;
</td>
<td class="text-right">
{{$shop_item->qty}}
</td>
<td class="text-right">
<strong>{{ formatNumber($shop_item->user_price_total_net) }} &euro;</strong>
</td>
<td class="text-right">
{{ formatNumber($shop_item->tax_rate, 0) }}
</td>
<td class="text-right">
{{ formatNumber($shop_item->user_tax_total) }} &euro;
</td>
</tr>
@endforeach
<tr>
<td>
<strong>Gesamte Versandkosten</strong>
</td>
<td class="text-right">
</td>
<td class="text-right">
1
</td>
<td class="text-right">
</td>
<td class="text-right">
<strong>{{ formatNumber($shopApiOrderCart->shipping_net) }} &euro;</strong>
</td>
<td class="text-right">
</td>
<td class="text-right">
{{ formatNumber($shopApiOrderCart->shipping_tax) }} &euro;
</td>
</tr>
</tbody>
<tfoot>
<tr>
<tr>
<td colspan="7">
</td>
</tr>
<tr>
<td colspan="1">
Summen:
</td>
<td class="text-right" colspan="1">
<strong>{{ $shopApiOrderCart->points_total }} <strong>
</td>
<td class="text-right">
</td>
<td class="text-right">
<strong>{{ $shopApiOrderCart->qty_total }}</strong>
</td>
<td class="text-right">
<strong>{{ formatNumber($shopApiOrderCart->price_total_net) }} &euro;</strong>
</td>
<td class="text-right">
</td>
<td class="text-right">
<strong>{{ formatNumber($shopApiOrderCart->tax_total) }} &euro;</strong>
</td>
</tr>
<tr>
<td colspan="6">
<strong>Gesamte netto</strong>
</td>
<td class="text-right">
<strong>{{ formatNumber($shopApiOrderCart->price_total_net) }} &euro;</strong>
</td>
</tr>
<tr class="border-none td-small">
<td colspan="5">
zzgl. MwSt:
</td>
<td class="text-right" colspan="2">
@foreach ($shopApiOrderCart->tax_split as $rate => $tax )
{{ $rate }}% = {{ formatNumber($tax) }} &euro; <br>
@endforeach
</td>
</tr>
<tr>
<td colspan="6">
<strong>Gesamtsumme Brutto: </strong>
</td>
<td class="text-right">
<strong>{{ formatNumber($shopApiOrderCart->getTotalPrice()) }} &euro;<strong>
</td>
</tr>
</tr>
</table>

View file

@ -0,0 +1,102 @@
@extends('layouts.layout-2')
@section('content')
{!! Form::open(['url' => route('user_shop_api_orders_action'), 'class' => 'form-horizontal', 'id'=>'user_shop_api_orders-form']) !!}
<div class="card">
<h5 class="card-header">
{{ __('Externe Bestellungen') }}
add api_action change wp_notice to api_notice
</h5>
<div class="card-body p-0">
<div class="form-row align-items-center px-4 pb-2 pt-3">
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
<select class="custom-select" name="user_shop_api_orders_action">
@foreach($api_action as $key=>$value)
<option value="{{$key}}">{{$value}}</option>
@endforeach
</select>
</div>
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
<button type="submit" class="btn btn-secondary">{{ __('save changes') }}</button>&nbsp;
</div>
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
<select class="custom-select on_change_datatable" name="user_shop_api_orders_filter">
@foreach($filter_show as $key=>$value)
<option value="{{$key}}" @if(session('user_shop_api_orders_filter') == $key) selected @endif>{{$value}}</option>
@endforeach
</select>
</div>
<div class="col-12 mb-0 mt-1">
<p class="mb-0">
bestellen = Sammelbestellung aufgeben<br>
entfernen = Bestellungen werden nach entfernt verschoben, für Stornos etc.<br>
zurücksetzen = Bestellungen werden nur nach offen verschoben, Sammelbestellung werden nicht geändert
</p>
</div>
</div>
<div class="card-datatable table-responsive pt-0">
<table class="datatable-shopping table table-striped table-bordered">
<thead>
<tr>
<th>#</th>
<th>{{__('Status') }}
<th>{{__('Versand') }}
<th>{{__('First name')}}</th>
<th>{{__('Last name')}}</th>
<th>{{__('E-Mail')}}</th>
<th>{{__('Datum')}}</th>
<th>{{__('Betrag')}}</th>
<th>{{__('Detail')}}</th>
<th>{{__('Art')}}</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
{!! Form::close() !!}
<script>
$( document ).ready(function() {
var oTable = $('.datatable-shopping').DataTable({
"processing": true,
"serverSide": true,
ajax: {
url: '{!! route('user_shop_api_orders_datatable') !!}',
data: function(d) {
d.user_shop_api_orders_filter = $('select[name=user_shop_api_orders_filter]').val();
}
},
"order": [[0, "desc" ]],
"columns": [
{ data: 'api_action', name: 'api_action', searchable: false },
{ data: 'api_status', name: 'api_status', searchable: false },
{ data: 'shipped', name: 'shipped' },
{ data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname' },
{ data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname' },
{ data: 'shopping_user.billing_email', name: 'shopping_user.billing_email' },
{ data: 'created_at', name: 'created_at' },
{ data: 'total_shipping', name: 'total_shipping' },
{ data: 'id', searchable: false },
{ data: 'payment_for', name: 'payment_for' },
],
"bLengthChange": false,
"iDisplayLength": 100,
"language": {
"url": "/js/German.json"
}
});
$('select.on_change_datatable').on('change', function(){
oTable.draw();
});
});
</script>
@endsection

View file

@ -0,0 +1,23 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
{{ __('Bestellung Kunde') }} <span class="text-muted">#{{$shopping_order->id}}</span>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">
@include('admin.sales._detail')
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
</div>
<script>
$( document ).ready(function() {
});
</script>
</div>

View file

@ -21,7 +21,9 @@
<th>{{__('Datum')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Betrag')}}</th>
<th>{{__('Versand')}}</th>
<th>{{__('Rechnung')}}</th>
<th>{{__('Art')}}</th>
</tr>
</thead>
@ -43,6 +45,7 @@
{ data: 'created_at', name: 'created_at' },
{ data: 'txaction', name: 'txaction' },
{ data: 'total_shipping', name: 'total_shipping' },
{ data: 'shipped', name: 'shipped' },
{ data: 'invoice', name: 'invoice', orderable: false },
{ data: 'payment_for', name: 'payment_for' },
],