mivita/resources/views/admin/sales/_detail.blade.php
2020-12-17 23:02:22 +01:00

655 lines
No EOL
32 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="card">
<!-- Status -->
<div class="card-body">
<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 -->
<!-- Info -->
<div class="card-body pb-1">
<div class="row">
<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-3 mb-3">
<div class="text-muted small">Anzahl Artikel</div>
{{$shopping_order->getItemsCount()}}
</div>
<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">
<!-- / Info -->
@if($isAdmin)
<!-- Member -->
<div class="card-body pb-1">
<div class="row">
<div class="col-md-8 mb-3">
@if(isset($change_member_error) && $change_member_error)
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger p-2">
<ul>
<li>{{ $change_member_error }}</li>
</ul>
</div>
</div>
</div>
@endif
<div class="text-muted small">Zugewiesener Berater</div>
@if($isView === 'sales_user')
@if($shopping_order->user_shop)
{{$shopping_order->user_shop->title}}
@endif
@endif
@if($isView === 'sales_customer')
@if($shopping_order->shopping_user && $shopping_order->shopping_user->is_like)
<button type="button" class="btn btn-xs btn-outline-info" data-toggle="modal" data-target="#modals-load-content"
data-id="{{$shopping_order->shopping_user->id}}"
data-action="shopping-user-is-like-member"
data-back="{{route('admin_sales_customers_detail', [$shopping_order->id])}}"
data-modal="modal-xl"
data-route="{{route('modal_load')}}"><span class="fa fa-edit"></span> Berater zuordnen</button>
@else
@if($shopping_order->member)
<a class="btn btn-xs btn-outline-primary" href="{{route('admin_lead_edit', [$shopping_order->member->id])}}"><i class="ion ion-ios-contacts"></i></a>
{{$shopping_order->member->getFullName()}} <span class="text-muted">#{{$shopping_order->member->number}}</span>
@endif
<button type="button" class="btn btn-xs btn-outline-secondary" data-toggle="modal" data-target="#modals-load-content"
data-id="{{ $shopping_order->id }}"
data-action="shopping-order-change-member"
data-view="{{$isView}}"
data-route="{{ route('modal_load') }}"><span class="fa fa-edit"></span></button>
@endif
@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())
<a href="{{$shopping_order->user_shop->getSubdomain(false)}}" class="badge badge-success" target="_blank">{{$shopping_order->user_shop->getSubdomain(false)}}</a>
@else
<span class="badge badge-danger" target="_blank">{{$shopping_order->user_shop->getSubdomain(false)}}</span>
@endif
</div>
</div>
</div>
<hr class="m-0">
<!-- / Member -->
@endif
<!-- Billing -->
<div class="card-body">
<h6 class="small font-weight-semibold">
@if($shopping_order->shopping_user->is_from === 'shopping')
Rechnungsadresse des Kunden
@else
Rechnungsadresse des Beraters
@endif
</h6>
<div class="row">
@if($shopping_order->shopping_user->billing_company)
<div class="col-md-12 mb-3">
<div class="text-muted small">Firma</div>
{{ $shopping_order->shopping_user->billing_company }}
</div>
@endif
<div class="col-md-3 mb-3">
<div class="text-muted small">Anrede</div>
{{ \App\Services\HTMLHelper::getSalutationLang($shopping_order->shopping_user->billing_salutation) }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Vorname</div>
{{ $shopping_order->shopping_user->billing_firstname }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Nachname</div>
{{ $shopping_order->shopping_user->billing_lastname }}
</div>
</div>
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">Straße</div>
{{ $shopping_order->shopping_user->billing_address }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Zusatz</div>
{{ $shopping_order->shopping_user->billing_address_2 }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">PLZ</div>
{{ $shopping_order->shopping_user->billing_zipcode }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Stadt</div>
{{ $shopping_order->shopping_user->billing_city }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">E-Mail</div>
{{ $shopping_order->shopping_user->billing_email }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Telefon</div>
{{ $shopping_order->shopping_user->billing_phone }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Land</div>
{{ $shopping_order->shopping_user->billing_country->getLocated() }}
</div>
</div>
</div>
<!-- / Billing -->
<!-- Shipping -->
@if(!$shopping_order->shopping_user->is_from === 'homeparty')
<hr class="m-0">
<div class="card-body">
<h6 class="small font-weight-semibold">
@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')}}
@else
<div class="row">
@if($shopping_order->shopping_user->shipping_company)
<div class="col-md-12 mb-3">
<div class="text-muted small">Firma</div>
{{ $shopping_order->shopping_user->shipping_company }}
</div>
@endif
<div class="col-md-3 mb-3">
<div class="text-muted small">Anrede</div>
{{ \App\Services\HTMLHelper::getSalutationLang($shopping_order->shopping_user->shipping_salutation) }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Vorname</div>
{{ $shopping_order->shopping_user->shipping_firstname }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Nachname</div>
{{ $shopping_order->shopping_user->shipping_lastname }}
</div>
</div>
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">Straße</div>
{{ $shopping_order->shopping_user->shipping_address }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Zusatz</div>
{{ $shopping_order->shopping_user->shipping_address_2 }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">PLZ</div>
{{ $shopping_order->shopping_user->shipping_zipcode }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Stadt</div>
{{ $shopping_order->shopping_user->shipping_city }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">E-Mail</div>
{{ $shopping_order->shopping_user->shipping_email }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Telefon</div>
{{ $shopping_order->shopping_user->shipping_phone }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Land</div>
{{ $shopping_order->shopping_user->shipping_country->getLocated() }}
</div>
</div>
@endif
</div>
@endif
<hr class="m-0">
<!-- / Shipping -->
<!-- Items -->
<div class="card-body">
<h6 class="small font-weight-semibold">
@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
@if($shopping_order->shopping_user->is_from === 'homeparty')
<h5>Beraterbestellung für eine Homeparty</h5>
<hr>
@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>
@if(!$shopping_order->shopping_user->is_from === 'homeparty')
<div class="table-responsive">
<table class="table table-product m-0" style="">
<tbody>
<tr class="border-bottom">
<th>Produkt</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 class="border-bottom">
<td class="px-3 py-2">
<div class="media align-items-center">
@if($shopping_order_item->product->images)
@if($image = $shopping_order_item->product->images->first())
<img src="{{ route('product_image', [$image->slug]) }}" class="d-block ui-w-80 mr-4" alt>
@endif
@endif
<div class="media-body">
<a href="{{route('admin_product_edit', [$shopping_order_item->product->id])}}" class="d-block">{{ $shopping_order_item->product->name }}
<span class="text-muted">#{{ $shopping_order_item->product->number }}</span></a>
<small>
<span class="text-muted">Inhalt: </span> {{ $shopping_order_item->product->contents }}<br>
<span class="text-muted">Gewicht: </span> {{ $shopping_order_item->product->weight }} g<br>
<span class="text-muted">Points: </span> {{ $shopping_order_item->product->points }}
</small>
</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 text-right" style="min-width: 60px;">
{{ $shopping_order_item->qty }}
</td>
<!-- Set column width -->
<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>
@else
@if($shopping_order->homeparty)
<style>
.table-small {
font-size: 0.9em;
width: auto;
}
.table-small td {
padding: 0.225rem 1rem 0.225rem 0;
}
.btn-md-extra {
padding: 0.3rem 0.6rem;
font-size: 0.8rem;
line-height: 1.5;
border-radius: 0.25rem;
}
.md-btn-extra {
width: calc(1.7rem + 2px) !important;
line-height: 1.5rem;
}
.form-control.input-extra {
padding: 0.28rem 0.6rem;
font-size: 0.8rem;
font-weight: 500;
min-height: calc(1.8rem + 2px);
height: calc(1.8rem + 2px);
width: 44px;
}
.input-group-min-w {
min-width: 102px;
}
.img-extra {
min-width:55px;
max-height: 120px;
}
.table td.border-top {
border: none;
border-top: 1px solid #ccccdb;
}
.table td {
border: none;
}
.table th {
border: none;
border-bottom: 1px solid #c3c3d2;
}
@media (max-width: 767px) {
.default-style:not([dir=rtl]) div.card-datatable table.dataTable thead th:first-child,
.default-style:not([dir=rtl]) div.card-datatable table.dataTable tbody td:first-child,
.default-style:not([dir=rtl]) div.card-datatable table.dataTable tfoot th:first-child {
padding-left: 0.6rem !important;
}
.img-extra {
min-width:35px;
max-height: 160px;
}
}
.table .foot-small td {
padding: 0.225rem 0.625rem;
}
.table .text-body {
font-size: 0.9em;
}
.table .options a.auto-delete-product {
font-size: 0.7em;
font-weight: bold;
text-transform: uppercase;
}
.table .min-width-80 {
min-width: 160px;
}
</style>
@php($homeparty = $shopping_order->homeparty)
@if($homeparty->homeparty_host)
<p><strong>Bestellung Gastgeber/in {{$homeparty->homeparty_host->billing_firstname}} {{$homeparty->homeparty_host->billing_lastname}}</strong></p>
@include('admin.sales._detail_homparty', ['homeparty'=>$shopping_order->homeparty, 'homeparty_guest' => $homeparty->homeparty_host])
@endif
@if($homeparty->homeparty_guests)
@php($g_count = 1)
@foreach($homeparty->homeparty_guests as $homeparty_guest)
<hr>
<p><strong>Bestellung {!! $g_count++ !!}. Gast {{$homeparty_guest->billing_firstname}} {{$homeparty_guest->billing_lastname}}</strong></p>
@include('admin.sales._detail_homparty', ['homeparty'=>$shopping_order->homeparty, 'homeparty_guest' => $homeparty_guest])
@endforeach
@endif
<hr>
@include('admin.sales._detail_homparty_total', ['homeparty' => $homeparty])
@endif
@endif
</div>
<hr class="m-0">
<!-- / Payment -->
<div class="card-body">
<h6 class="small font-weight-semibold">
Zahlung
</h6>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="min-width: 60px">#</th>
<th>Zahlungsart</th>
<th>Gesamt</th>
<th>Status</th>
<th>Datum</th>
<th>Referenznummer</th>
</tr>
</thead>
<tbody>
@php($count=0)
@foreach($shopping_order->shopping_payments as $shopping_payment)
<tr>
<th scope="row">{{++$count}}</th>
<td>{{$shopping_payment->getPaymentType()}}</td>
<td>{{$shopping_payment->getPaymentAmount()}}</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)
<tr>
<th scope="row" class="m-0">{{$count}}.{{++$ccount}}</th>
<td colspan="5" class="m-0 p-0">
<table class="table table-info table-borderless mb-0 small">
<thead>
<tr>
<th style="min-width: 80px">Request</th>
<th style="min-width: 80px">Status</th>
<th style="min-width: 200px">TX-Action</th>
<th style="min-width: 120px">Datum</th>
</tr>
</thead>
<tbody>
@foreach($shopping_payment->payment_transactions as $payment_transaction)
<tr>
<td>{{$payment_transaction->request}}</td>
<td>{{$payment_transaction->status}}</td>
<td>{{$payment_transaction->txaction}} {{$payment_transaction->errormessage}}</td>
<td>{{$payment_transaction->created_at->format("d.m.Y H:i")}}</td>
</tr>
@endforeach
</tbody>
</table>
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</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