Berater Bestellung / online

This commit is contained in:
Kevin Adametz 2020-08-24 18:17:02 +02:00
parent 16fe2fa363
commit ecc71c616f
26 changed files with 828 additions and 240 deletions

View file

@ -2,11 +2,32 @@
<div class="card">
<!-- Status -->
<div class="card-body">
<strong class="mr-2">Status:</strong>
<span class="text-big">
{!! \App\Services\Payment::getShoppingOrderBadge($shopping_order); !!}
</span>
<span class="text-muted ml-1">{{$shopping_order->created_at->format("d.m.Y")}}</span>
<div class="row">
<div class="col-md-6 mb-1">
<strong class="mr-2">Status:</strong>
<span class="text-big">
{!! \App\Services\Payment::getShoppingOrderBadge($shopping_order); !!}
</span>
</div>
<div class="col-md-6 mb-1">
<strong class="mr-2">Versand:</strong>
@if($isAdmin)
<button type="button" class="btn btn-sm btn-{{$shopping_order->getShippedColor()}}" data-toggle="modal" data-target="#modals-shipped"
data-id="{{ $shopping_order->id }}"
data-shipped="{{ $shopping_order->shipped }}"
data-back="{{url()->current()}}"
data-action="store_shipped">
<span class="far fa-edit"></span> <strong>{{$shopping_order->getShippedType()}}</strong>
</button>
@else
<span class="text-big">
<span class="badge badge-pill badge-{{$shopping_order->getShippedColor()}}">{{$shopping_order->getShippedType()}}</span>
</span>
@endif
</div>
</div>
</div>
<hr class="m-0">
<!-- / Status -->
@ -14,18 +35,22 @@
<!-- Info -->
<div class="card-body pb-1">
<div class="row">
<div class="col-md-4 mb-3">
<div class="col-md-3 mb-3">
<div class="text-muted small">Bestelldatum</div>
{{$shopping_order->created_at->format("d.m.Y H:i")}}
</div>
<div class="col-md-4 mb-3">
<div class="col-md-3 mb-3">
<div class="text-muted small">Anzahl Artikel</div>
{{$shopping_order->getItemsCount()}}
</div>
<div class="col-md-4 mb-3">
<div class="col-md-3 mb-3">
<div class="text-muted small">Preis gesamt</div>
{{$shopping_order->getFormattedTotalShipping()}} &euro;
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Points gesamt</div>
{{ $shopping_order->points }}
</div>
</div>
</div>
<hr class="m-0">
@ -47,7 +72,6 @@
</div>
</div>
@endif
<div class="text-muted small">Zugewiesener Berater</div>
@if($isView === 'sales_user')
@if($shopping_order->user_shop)
@ -78,7 +102,6 @@
@endif
</div>
<div class="col-md-4 mb-3">
<div class="text-muted small">Gekauft im Shop</div>
@if($shopping_order->user_shop->user->isActive() && $shopping_order->user_shop->user->isActiveShop())
@ -96,7 +119,11 @@
<!-- Billing -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Rechnungsadresse
@if($shopping_order->shopping_user->is_from === 'shopping')
Rechnungsadresse des Kunden
@else
Rechnungsadresse des Berater
@endif
</h6>
<div class="row">
@if($shopping_order->shopping_user->billing_company)
@ -156,7 +183,22 @@
<!-- Shipping -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Lieferadresse
@if($shopping_order->shopping_user->is_from === 'user_order')
@if($shopping_order->shopping_user->is_for === 'me')
Lieferadresse des Berater
@else
Lieferadresse des Kunden
@endif
@endif
@if($shopping_order->shopping_user->is_from === 'wizard')
Lieferadresse des Berater
@endif
@if($shopping_order->shopping_user->is_from === 'membership')
Lieferadresse des Berater
@endif
@if($shopping_order->shopping_user->is_from === 'shopping')
Lieferadresse des Kunden
@endif
</h6>
@if($shopping_order->shopping_user->same_as_billing)
{{__('email.checkout_mail_same_address')}}
@ -220,18 +262,52 @@
<!-- Items -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Artikel
@if($shopping_order->shopping_user->is_from === 'user_order')
@if($shopping_order->shopping_user->is_for === 'me')
<strong>Bestellung für Berater</strong>
@else
<strong>Bestellung für Kunde</strong>
@endif
@endif
@if($shopping_order->shopping_user->is_from === 'wizard')
<strong>Beraterbestellung für Registrierung</strong>
@endif
@if($shopping_order->shopping_user->is_from === 'membership')
<strong>Beraterbestellung für Mitgliedschaft</strong>
@endif
@if($shopping_order->shopping_user->is_from === 'shopping')
<strong>Kundenbestellung über Shop</strong>
@endif
</h6>
<style>
table.table-product, table.table-product tr td, table.table-product tr th {
border:none;
}
table.table-product tr.border-top td {
border-top: 1px solid #b8b8b9;
}
table.table-product tr.border-bottom td, table.table-product tr.border-bottom th {
border-bottom: 1px solid #b8b8b9;
}
</style>
<div class="table-responsive">
<table class="table table-bordered m-0" style="min-width:550px;">
<table class="table table-product m-0" style="">
<tbody>
<tr>
<tr class="border-bottom">
<th>Produkt</th>
<th>Anzahl</th>
<th>Preis</th>
<th class="text-right">
@if($shopping_order->shopping_user->is_from === 'user_order')
Netto-Preis
@else
Preis
@endif
</th>
<th class="text-right">Anzahl</th>
<th class="text-right">Summe</th>
</tr>
@foreach($shopping_order->shopping_order_items as $shopping_order_item)
<tr>
<tr class="border-bottom">
<td class="px-3 py-2">
<div class="media align-items-center">
@if($shopping_order_item->product->images)
@ -251,17 +327,70 @@
</div>
</div>
</td>
<td class="align-middle px-3 py-2 nowrap text-right" style="min-width:100px;">
@if($shopping_order->shopping_user->is_from === 'user_order')
{{ $shopping_order_item->getFormattedPriceNet() }} &euro;
@else
{{ $shopping_order_item->getFormattedPrice() }} &euro;
@endif
</td>
<!-- Set column width -->
<td class="align-middle px-3 py-2" style="width: 66px;">
<td class="align-middle px-3 py-2 text-right" style="min-width: 60px;">
{{ $shopping_order_item->qty }}
</td>
<!-- Set column width -->
<td class="text-right font-weight-semibold align-middle px-3 py-2" style="width: 100px;">
{{ $shopping_order_item->getFormattedPrice() }} &euro;
<td class="font-weight-semibold align-middle px-3 py-2 text-right" style="min-width:120px;">
@if($shopping_order->shopping_user->is_from === 'user_order')
{{ $shopping_order_item->getFormattedTotalPriceNet() }} &euro;
@else
{{ $shopping_order_item->getFormattedTotalPrice() }} &euro;
@endif
</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr class="border-bottom">
<td colspan="3">
{{__('email.checkout_mail_shipping')}}
</td>
<td style="color:#37302d; text-align: right; vertical-align: top;line-height:1.6em;">
@if($shopping_order->shopping_user->is_from === 'user_order')
{{ $shopping_order->getFormattedShippingNet() }} &euro;
@else
{{ $shopping_order->getFormattedShipping() }} &euro;
@endif
</td>
</tr>
<tr>
<td colspan="3">
{{__('email.checkout_mail_subtotal_ws')}}
</td>
<td style="color:#37302d; text-align: right; vertical-align: top;line-height:1.6em;">
{{ $shopping_order->getFormattedSubtotalWs() }} &euro;
</td>
</tr>
<tr class="border-bottom">
<td colspan="3">
{{__('email.checkout_mail_tax')}}
</td>
<td style="color:#37302d; text-align: right; vertical-align: top;line-height:1.6em;">
{{ $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>{{ $shopping_order->getFormattedTotalShipping() }} &euro;</b>
<br>
<span style="font-size: 0.8em">{{__('email.checkout_mail_tax_info')}}</span>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
@ -279,10 +408,10 @@
<tr>
<th style="min-width: 60px">#</th>
<th>Zahlungsart</th>
@if($isAdmin)<th>Referenznummer</th>@endif
<th>Gesamt</th>
<th>Status</th>
<th>Datum</th>
<th>Referenznummer</th>
</tr>
</thead>
<tbody>
@ -291,10 +420,23 @@
<tr>
<th scope="row">{{++$count}}</th>
<td>{{$shopping_payment->getPaymentType()}}</td>
@if($isAdmin)<td>{{$shopping_payment->reference}}</td>@endif
<td>{{$shopping_payment->getPaymentAmount()}}</td>
<td>{!! \App\Services\Payment::getShoppingPaymentBadge($shopping_payment) !!}</td>
<td>
@if($isAdmin && $shopping_payment->clearingtype === 'fnc' && $shopping_payment->onlinebanktransfertype === 'MIV')
<button type="button" class="btn btn-sm btn-{{ \App\Services\Payment::getFormattedTxactionColor($shopping_payment->txaction)}}" data-toggle="modal" data-target="#modals-txaction"
data-id="{{ $shopping_order->id }}"
data-payment_id="{{ $shopping_payment->id }}"
data-txaction="{{ $shopping_payment->txaction }}"
data-back="{{url()->current()}}"
data-action="store_txaction">
<span class="far fa-edit"></span> <strong>{{ \App\Services\Payment::getFormattedTxaction($shopping_payment->txaction)}}</strong>
</button>
@else
{!! \App\Services\Payment::getShoppingPaymentBadge($shopping_payment) !!}
@endif
</td>
<td>{{$shopping_payment->created_at->format("d.m.Y H:i")}}</td>
<td>{{$shopping_payment->reference}}</td>
</tr>
@if($isAdmin && $shopping_payment->payment_transactions)
@php($ccount=0)
@ -329,5 +471,78 @@
</table>
</div>
</div>
</div>
</div>
@if($isAdmin)
<!-- Modal template -->
<div class="modal fade" id="modals-shipped">
<div class="modal-dialog">
<form class="modal-content" action="{{ route('admin_sales_store') }}" method="post">
@csrf
<input type="hidden" name="id" value="{{$shopping_order->id}}">
<input type="hidden" name="action" value="store_shipped">
<input type="hidden" name="back" value="{{url()->current()}}">
<div class="modal-header">
<h5 class="modal-title">{{__('Bestellung')}} {{__('Versand')}} </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">
<div class="form-group col-sm-12">
<label class="form-label" for="shipped">{{ __('Versand') }}</label>
{{ Form::select('shipped', \App\Models\ShoppingOrder::$shippedTypes, $shopping_order->shipped, array('data-live-search'=>'false', 'class'=>'selectpicker') ) }}
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{__('close')}}</button>
<button type="submit" class="btn btn-primary">{{__('save')}}</button>
</div>
</form>
</div>
</div>
<!-- Modal template -->
<div class="modal fade" id="modals-txaction">
<div class="modal-dialog">
<form class="modal-content" action="{{ route('admin_sales_store') }}" method="post">
@csrf
<input type="hidden" name="id" value="{{$shopping_order->id}}">
<input type="hidden" name="payment_id">
<input type="hidden" name="action" value="store_txaction">
<input type="hidden" name="back" value="{{url()->current()}}">
<div class="modal-header">
<h5 class="modal-title">{{__('Bestellung')}} {{__('Rechnung')}} </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">
<div class="form-group col-sm-12">
<label class="form-label" for="txaction">{{ __('Rechnung') }}</label>
{{ Form::select('txaction', \App\Services\Payment::$txaction_invoice, 'invoice_paid', array('data-live-search'=>'false', 'class'=>'selectpicker') ) }}
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{__('close')}}</button>
<button type="submit" class="btn btn-primary">{{__('save')}}</button>
</div>
</form>
</div>
</div>
<script>
$( document ).ready(function() {
$('#modals-txaction').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
$(this).find(".modal-content input[name='payment_id']").val(button.data('payment_id'));
$(this).find(".modal-body select[name='txaction']").val(button.data('txaction'));
$('.selectpicker').selectpicker('refresh');
});
});
</script>
@endif

View file

@ -49,14 +49,17 @@
<thead>
<tr>
<th>#</th>
<th>{{__('Datum')}}</th>
<th>{{__('Betrag')}}</th>
<th>{{__('Zahlung')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Versand')}}</th>
<th>{{__('First name')}}</th>
<th>{{__('Last name')}}</th>
<th>{{__('E-Mail')}}</th>
<th>{{__('Datum')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Betrag')}}</th>
<th>{{__('Käufe')}}</th>
<th>{{__('zugewiesener Berater')}}</th>
<th>{{__('Rf-Nr.')}}</th>
<th>{{__('Käufe')}}</th>
<th>{{__('Gekauft im Shop')}}</th>
</tr>
</thead>
@ -78,15 +81,18 @@
},
"order": [[0, "desc" ]],
"columns": [
{ data: 'id', name: 'id', searchable: false },
{ data: 'id', searchable: false },
{ data: 'created_at', name: 'shopping_orders.created_at' },
{ data: 'total_shipping', name: 'total_shipping' },
{ data: 'payment', name: 'payment', orderable: false },
{ data: 'txaction', name: 'txaction' },
{ 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: 'txaction', name: 'txaction' },
{ data: 'total_shipping', name: 'total_shipping' },
{ data: 'shopping_user.orders', name: 'shopping_user.orders' },
{ data: 'member_id', name: 'member_id', searchable: false, orderable: false },
{ data: 'reference', name: 'reference' },
{ data: 'shopping_user.orders', name: 'shopping_user.orders' },
{ data: 'user_shop_id', name: 'user_shop_id', searchable: false, orderable: true },
],
"bLengthChange": false,

View file

@ -15,12 +15,20 @@
<thead>
<tr>
<th>#</th>
<th>{{__('Datum')}}</th>
<th>{{__('Betrag')}}</th>
<th>{{__('Zahlung')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Versand')}}</th>
<th>{{__('Für')}}</th>
<th>{{__('First name')}}</th>
<th>{{__('Last name')}}</th>
<th>{{__('E-Mail')}}</th>
<th>{{__('Datum')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Betrag')}}</th>
<th>B.{{__('First name')}}</th>
<th>B.{{__('Last name')}}</th>
<th>B.{{__('E-Mail')}}</th>
<th>{{__('Rf-Nr.')}}</th>
<th>{{__('Käufe')}}</th>
<th>{{__('Berater-Shop')}}</th>
</tr>
@ -37,12 +45,19 @@
"order": [[0, "desc" ]],
"columns": [
{ data: 'id', searchable: false },
{ 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: 'shopping_orders.created_at' },
{ data: 'txaction', name: 'txaction' },
{ data: 'total_shipping', name: 'total_shipping' },
{ data: 'payment', name: 'payment', orderable: false },
{ data: 'txaction', name: 'txaction' },
{ data: 'shipped', name: 'shipped' },
{ data: 'is_for', name: 'is_for', orderable: false },
{ data: 'shopping_user.shipping_firstname', name: 'shopping_user.shipping_firstname', orderable: false },
{ data: 'shopping_user.shipping_lastname', name: 'shopping_user.shipping_lastname', orderable: false },
{ data: 'shopping_user.shipping_email', name: 'shopping_user.shipping_email', orderable: false },
{ data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname', orderable: false },
{ data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname', orderable: false },
{ data: 'shopping_user.billing_email', name: 'shopping_user.billing_email', orderable: false },
{ data: 'reference', name: 'reference' },
{ data: 'shopping_user.orders', name: 'shopping_user.orders' },
{ data: 'auth_user_shop', name: 'auth_user_shop' },
],