mivita/resources/views/admin/abo/_executions.blade.php

150 lines
No EOL
8.4 KiB
PHP

<div class="card-body">
<h5 class="font-weight-semibold">
{{ __('navigation.abo') }} {{ __('tables.executions') }}
</h5>
<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-product m-0" style="min-width:550px;">
<tbody>
<tr>
<th>#</th>
<th>{{__('tables.date')}}</th>
<th>{{__('tables.amount')}}</th>
<th>{{__('tables.payment')}}</th>
<th>{{__('tables.status')}}</th>
<th>{{__('tables.shipping')}}</th>
<th>{{__('tables.art')}}</th>
@if(!isset($only_show_products) || !$only_show_products)
<th>{{__('tables.invoice')}}</th>
@endif
<th>{{__('tables.firstname')}}</th>
<th>{{__('tables.lastname')}}</th>
<th>{{__('tables.email')}}</th>
<th>{{__('tables.status')}}</th>
<th>{{__('tables.rf_no')}}</th>
</tr>
@php
$executionColspan = (!isset($only_show_products) || !$only_show_products) ? 13 : 12;
@endphp
@if($user_abo->user_abo_orders)
@foreach($user_abo->user_abo_orders()->orderBy('id', 'desc')->get() as $user_abo_order)
@if($user_abo_order->shopping_order)
@php
$paymentErrorTransaction = $user_abo_order->shopping_order->getLastShoppingPaymentTransaction();
$hasPaymentError = ! $user_abo_order->paid
&& $paymentErrorTransaction
&& ($paymentErrorTransaction->errorcode || $paymentErrorTransaction->errormessage || $paymentErrorTransaction->customermessage);
@endphp
<tr class="border-top">
<td>
@if($isAdmin)
@if($user_abo->is_for === 'me')
{!! '<a href="' . route('admin_sales_users_detail', [$user_abo_order->shopping_order_id]) . '" class="btn btn-xs btn-primary">'.$user_abo_order->shopping_order_id.'</a>' !!}
@endif
@if($user_abo->is_for === 'ot')
{!! '<a href="' . route('admin_sales_customers_detail', [$user_abo_order->shopping_order_id]) . '" class="btn btn-xs btn-secondary">'.$user_abo_order->shopping_order_id.'</a>' !!}
@endif
@else
@if($user_abo->is_for === 'me')
@if(!isset($only_show_products) || !$only_show_products)
{!! '<a href="' . route('user_order_detail', [$user_abo_order->shopping_order_id]) . '" class="btn btn-xs btn-primary">'.$user_abo_order->shopping_order_id.'</a>' !!}
@else
{{ $user_abo_order->shopping_order_id }}
@endif
@endif
@if($user_abo->is_for === 'ot')
@if(!isset($only_show_products) || !$only_show_products)
{!! '<a href="' . route('user_shop_order_detail', [$user_abo_order->shopping_order_id]) . '" class="btn btn-xs btn-secondary">'.$user_abo_order->shopping_order_id.'</a>' !!}
@else
{{ $user_abo_order->shopping_order_id }}
@endif
@endif
@endif
</td>
<td>
{!! $user_abo_order->shopping_order->created_at->format("d.m.Y H:i") !!}
</td>
<td>
<span class="no-line-break">{!! $user_abo_order->shopping_order->getFormattedTotalShipping() !!} </span>
</td>
<td>
{!! $user_abo_order->shopping_order->getLastShoppingPayment('getPaymentType'); !!}
</td>
<td>
{!! \App\Services\Payment::getShoppingOrderBadge($user_abo_order->shopping_order) !!}
</td>
<td>
{!! '<span class="badge badge-pill badge-'.$user_abo_order->shopping_order->getShippedColor().'">'.$user_abo_order->shopping_order->getShippedType().'</span>' !!}
</td>
<td>
{!! '<span class="badge badge-pill badge-'.$user_abo_order->shopping_order->getPaymentForColor().'">'.$user_abo_order->shopping_order->getPaymentForType().'</span>' !!}
</td>
@if(!isset($only_show_products) || !$only_show_products)
<td>
@if($user_abo_order->shopping_order->isInvoice())
{!! '<span class="no-line-break"><a href="'.route('storage_file', [$user_abo_order->shopping_order->id, 'invoice', 'download']).'" class="btn btn-primary btn-xs"><i class="fa fa-download"></i></a>
<a href="'.route('storage_file', [$user_abo_order->shopping_order->id, 'invoice', 'stream']).'" target="_blank" class="btn btn-warning btn-xs"><i class="fa fa-eye"></i></a></span>' !!}
@endif
</td>
@endif
<td>
{{ $user_abo_order->shopping_order->shopping_user->shipping_firstname }}
</td>
<td>
{{ $user_abo_order->shopping_order->shopping_user->shipping_lastname }}
</td>
<td>
{{ $user_abo_order->shopping_order->shopping_user->shipping_email }}
</td>
<td>
{!! $user_abo_order->getStatusFormated()!!}
</td>
<td>
{{ $user_abo_order->shopping_order->getLastShoppingPayment('reference') }}
</td>
</tr>
@if($hasPaymentError)
<tr>
<td colspan="{{ $executionColspan }}" class="pt-0">
<div class="alert alert-danger py-2 px-3 mb-2">
<strong>{{ __('payment.payment_error') }}:</strong>
@if($paymentErrorTransaction->errorcode)
<span class="badge badge-danger">{{ $paymentErrorTransaction->errorcode }}</span>
@endif
{{ $paymentErrorTransaction->errormessage ?: $paymentErrorTransaction->customermessage }}
@if($paymentErrorTransaction->error_description)
<span class="text-muted">({{ $paymentErrorTransaction->error_description }})</span>
@endif
<div class="small text-muted mt-1">
{{ $paymentErrorTransaction->created_at->format('d.m.Y H:i') }}
</div>
</div>
</td>
</tr>
@endif
@endif
@endforeach
@endif
</tbody>
</table>
</div>
</div>