mivita/resources/views/admin/sales/_detail_homparty_user.blade.php
2026-01-23 17:35:23 +01:00

253 lines
No EOL
12 KiB
PHP

@if($homeparty_guest && $homeparty_guest->homeparty_user_order_items->count() || $homeparty_guest->is_host)
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{__('tables.image')}}</th>
<th>{{__('tables.product')}}</th>
<th>{{__('tables.quantity')}}</th>
<th>{{__('tables.margin')}}</th>
<th class="text-right">{{__('tables.points')}}</th>
<th class="text-right">{{__('tables.earnings')}}</th>
<th class="text-right">{{__('tables.vk_price')}}</th>
<th class="text-right">{{__('tables.ek_price')}}</th>
</tr>
</thead>
<tbody>
@foreach($homeparty_guest->homeparty_user_order_items as $value)
<tr>
<td>
@if(count($value->product->images))
<img class="img-fluid img-extra" alt="" src="{{ route('product_image', [$value->product->images->first()->slug]) }}">
@endif
</td>
<td class="min-width-80">
<strong>{{ $value->product->getLang('name') }}</strong>
<div class="text-body">
<div>{{ __('order.content') }}: {{ $value->product->contents }}</div>
<div>{{ __('order.art_no') }}: {{ $value->product->number }}</div>
</div>
</td>
<td>
{{$value->qty}}
</td>
<td>
{{ $value->margin }}%
</td>
<td class="text-right">
{{ $value->getFormattedTotalPoints() }}
</td>
<td class="text-right">
{{ $value->getFormattedTotalIncomePrice() }} &euro;
</td>
<td class="text-right">
{{ $value->getFormattedTotalPrice() }} &euro;
</td>
<td class="text-right">
{{ $value->getFormattedTotalEKPrice() }} &euro;
</td>
</tr>
@endforeach
</tbody>
<tfoot id="insert_show_bonus_host">
@php($user_cart = $homeparty->order['user_carts'][$homeparty_guest->id])
@php($hp_order = $homeparty->order)
@if(!$homeparty_guest->is_host)
<tr class="foot-small">
<td colspan="8" class="text-left">
@if($homeparty_guest->getDelivery() === 'host')
{{ __('homeparty.delivery_to_host') }}
@endif
@if($homeparty_guest->getDelivery() === 'direct')
{{ __('homeparty.delivery_directly_to_the_guest') }}
@endif
</td>
</tr>
@if($homeparty_guest->getDelivery() === 'direct')
<tr>
<td colspan="5" class="text-left">{{ __('order.shipping_costs') }}</td>
<td>&nbsp;</td>
<td class="text-right">{{ Util::formatNumber($user_cart['shipping_price'])}} &euro;</td>
<td class="text-right">{{ Util::formatNumber($user_cart['shipping_price'])}} &euro;</td>
</tr>
@endif
<tr>
<td colspan="4" class="border-top"><strong>{{ __('order.total') }}:</strong></td>
<td class="border-top text-right"><strong>{{$user_cart['points']}}</strong></td>
<td class="border-top text-right"><strong>{{Util::formatNumber($user_cart['income_price'])}} &euro;</strong></td>
<td class="border-top text-right"><strong>{{Util::formatNumber($user_cart['price'])}} &euro;</strong></td>
<td class="border-top text-right"><strong>{{Util::formatNumber($user_cart['ek_price'])}} &euro;</strong></td>
</tr>
@else
@if($hp_order['is_bonus'])
<tr class="foot-small">
<td colspan="5" class="text-left">{{ __('homeparty.credit_homeparty_voucher') }}</td>
<td>&nbsp;</td>
<td class="text-right">- {{ Util::formatNumber($hp_order['bonus_value']) }} &euro;</td>
<td class="text-right">- {{ Util::formatNumber($hp_order['bonus_value']) }} &euro;</td>
</tr>
@endif
@if($hp_order['is_bonus_coupon'])
<tr class="foot-small">
<td colspan="5" class="text-left">{{ __('homeparty.credit_bonus') }}</td>
<td>&nbsp;</td>
<td class="text-right">- {{ Util::formatNumber($hp_order['bonus_coupon']) }} &euro;</td>
<td class="text-right">- {{ Util::formatNumber($hp_order['bonus_coupon']) }} &euro;</td>
</tr>
@endif
@if($hp_order['is_bonus'])
<tr class="foot-small">
<td colspan="4" class="text-left">{{ __('homeparty.deduct_points_by_voucher') }}</td>
<td class="text-right">- {{ $hp_order['bonus_points_diff'] }} </td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
@endif
<tr class="foot-small">
<td colspan="5" class="text-left">{{ __('order.shipping_costs') }}:</td>
<td>&nbsp;</td>
<td class="text-right">&nbsp;</td>
<td class="text-right">{{Util::formatNumber($user_cart['shipping_price'])}} &euro;</td>
</tr>
<tr>
<td colspan="4" class="border-top"><strong>{{ __('order.sums') }}:</strong></td>
<td class="border-top text-right"><strong>{{$user_cart['points']}}</strong></td>
<td class="border-top text-right"><strong>{{Util::formatNumber($user_cart['income_price'])}} &euro;</strong></td>
<td class="border-top text-right"><strong>{{Util::formatNumber($user_cart['price'])}} &euro;</strong></td>
<td class="border-top text-right"><strong>{{Util::formatNumber($user_cart['ek_price'])}} &euro;</strong></td>
</tr>
@endif
</tfoot>
</table>
</div>
@if($homeparty_guest->is_host || $homeparty_guest->getDelivery() === 'direct')
<hr class="m-0">
<div class="card-body" style="background-color: #E5E9EF">
<h6 class="small font-weight-semibold">
{{__('Delivery address')}}
</h6>
@if($homeparty_guest->same_as_billing)
<div class="row">
@if($homeparty_guest->billing_company)
<div class="col-md-12 mb-3">
<div class="text-muted small">{{ __('Company') }}</div>
{{ $homeparty_guest->billing_company }}
</div>
@endif
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Salutation') }}</div>
{{ \App\Services\HTMLHelper::getSalutationLang($homeparty_guest->billing_salutation) }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('First name') }}</div>
{{ $homeparty_guest->billing_firstname }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Last name') }}</div>
{{ $homeparty_guest->billing_lastname }}
</div>
</div>
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Street') }}</div>
{{ $homeparty_guest->billing_address }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Addition') }}</div>
{{ $homeparty_guest->billing_address_2 }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Postcode') }}</div>
{{ $homeparty_guest->billing_zipcode }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('City') }}</div>
{{ $homeparty_guest->billing_city }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('E-Mail') }}</div>
{{ $homeparty_guest->billing_email }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Phone') }}</div>
{{ $homeparty_guest->billing_phone }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Country') }}</div>
{{ $homeparty_guest->billing_country->getLocated() }}
</div>
</div>
@else
<div class="row">
@if($homeparty_guest->shipping_company)
<div class="col-md-12 mb-3">
<div class="text-muted small">{{ __('Company') }}</div>
{{ $homeparty_guest->shipping_company }}
</div>
@endif
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Salutation') }}</div>
{{ \App\Services\HTMLHelper::getSalutationLang($homeparty_guest->shipping_salutation) }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('First name') }}</div>
{{ $homeparty_guest->shipping_firstname }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Last name') }}</div>
{{ $homeparty_guest->shipping_lastname }}
</div>
</div>
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Street') }}</div>
{{ $homeparty_guest->shipping_address }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Addition') }}</div>
{{ $homeparty_guest->shipping_address_2 }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Postcode') }}</div>
{{ $homeparty_guest->shipping_zipcode }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('City') }}</div>
{{ $homeparty_guest->shipping_city }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('E-Mail') }}</div>
{{ $homeparty_guest->shipping_email }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Phone') }}</div>
{{ $homeparty_guest->shipping_phone }}
</div>
@if($homeparty_guest->shipping_postnumber)
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('payment.dhl_postnumber') }}</div>
<span class="badge badge-info">{{ $homeparty_guest->shipping_postnumber }}</span>
<small class="d-block text-muted">{{ __('payment.packstation_delivery') }}</small>
</div>
@endif
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('Country') }}</div>
{{ $homeparty_guest->shipping_country->getLocated() }}
</div>
</div>
@endif
</div>
@endif
@else
<p>{{ __('order.no_order') }}</p>
@endif