@extends('apps::dashboard.layouts.app') @section('title', __('order::dashboard.orders.show.title')) @section('css') @stop @section('content')

{{ __('order::dashboard.orders.show.invoice_customer') }}
@if ($order->orderAddress != null)
@if (!is_null($order->orderAddress->state)) {{ $order->orderAddress->state->city->title }} / {{ $order->orderAddress->state->title }} @endif
@if ($order->orderAddress->governorate) {{ __('order::dashboard.orders.show.address.governorate') }} : {{ $order->orderAddress->governorate }}
@endif @if ($order->orderAddress->block) {{ __('order::dashboard.orders.show.address.block') }} : {{ $order->orderAddress->block }}
@endif @if ($order->orderAddress->district) {{ __('order::dashboard.orders.show.address.district') }} : {{ $order->orderAddress->district }}
@endif @if ($order->orderAddress->street) {{ __('order::dashboard.orders.show.address.street') }} : {{ $order->orderAddress->street }}
@endif @if ($order->orderAddress->building) {{ __('order::dashboard.orders.show.address.building') }} : {{ $order->orderAddress->building }}
@endif @if ($order->orderAddress->floor) {{ __('order::dashboard.orders.show.address.floor') }} : {{ $order->orderAddress->floor }}
@endif @if ($order->orderAddress->flat) {{ __('order::dashboard.orders.show.address.flat') }} : {{ $order->orderAddress->flat }}
@endif {{ __('order::dashboard.orders.show.address.details') }} : {{ $order->orderAddress->address ?? '---' }}
@endif
#{{ $order['id'] }}
{{ date('Y-m-d / H:i:s', strtotime($order->created_at)) }}
{{ __('order::dashboard.orders.show.user.username') }} : {{ $order->orderAddress->username ?? '---' }}
{{ __('order::dashboard.orders.show.user.mobile') }} : {{ $order->orderAddress ? $order->orderAddress->mobile : $order->unknownOrderAddress->receiver_mobile }}
{{ __('transaction::dashboard.orders.show.transaction.method') }} : {{ $order->paymentType->title ?? ucfirst($order->transactions->method) }}

@if ($order->orderCoupons && !empty($order->orderCoupons->products)) @endif @php $customSubTotal = 0; @endphp @foreach ($order->allProducts as $product) @if (isset($product->product_variant_id) || $product->product_variant_title) @if ( $order->orderCoupons && !empty($order->orderCoupons->products) && in_array($product->variant->product->id, $order->orderCoupons->products ?? [])) @endif @else @php if ($order->orderCoupons && empty($order->orderCoupons->products)) { if (!empty($product->add_ons_option_ids)) { $customSubTotal += (floatval(json_decode($product->add_ons_option_ids)->total_amount) + floatval($product->sale_price)) * intval($product->qty); } else { $customSubTotal += $product->total; } } @endphp @if ( $order->orderCoupons && !empty($order->orderCoupons->products) && in_array($product->product->id, $order->orderCoupons->products ?? [])) @endif @if (!is_null($product->add_ons_option_ids) && !empty($product->add_ons_option_ids)) @foreach (json_decode($product->add_ons_option_ids)->data as $key => $addons) @foreach ($addons->options as $k => $option) @endforeach @endforeach @endif @endif @endforeach @if ($order->orderCoupons && empty($order->orderCoupons->products)) @else @endif @if ($order->orderCoupons && empty($order->orderCoupons->products)) @endif
{{ __('order::dashboard.orders.show.items.title') }} {{ __('order::dashboard.orders.show.items.price') }} {{ __('order::dashboard.orders.show.items.qty') }} {{ __('order::dashboard.orders.show.items.total') }} {{ __('order::dashboard.orders.show.items.coupon_discount') }}
@if ($product->product_variant_id) {{ generateVariantProductData($product->variant->product, $product->product_variant_id, $product->variant->productValues->pluck('option_value_id')->toArray())['name'] }} @if ($product->variant->product->vendor) ({{ $product->variant->product->vendor->title }}) @endif @else {{ $product->product_variant_title }} @endif @if ($product->notes)
# {{ __('order::dashboard.orders.show.items.notes') }} : {{ $product->notes }}
@endif
{{ $product->sale_price }} {{ $product->qty }} {{ $product->total }} @if ($order->orderCoupons->discount_type == 'value') {{ $order->orderCoupons->discount_value }} {{ __('apps::frontend.master.kwd') }} @else {{ round($order->orderCoupons->discount_percentage, 1) }} % @endif
@if ($product->product_id) {{ $product->product->title }} ({{ $product->product->sku }}) @if ($product->product->vendor) ({{ $product->product->vendor->title }}) @endif @else {{ $product->product_title }} @endif @if ($product->notes)
# {{ __('order::dashboard.orders.show.items.notes') }} : {{ $product->notes }}
@endif
{{ $product->sale_price }} {{ $product->qty }} @if (!empty($product->add_ons_option_ids)) {{ (floatval(json_decode($product->add_ons_option_ids)->total_amount) + floatval($product->sale_price)) * intval($product->qty) }} @else {{ $product->total }} @endif @if ($order->orderCoupons->discount_type == 'value') {{ $order->orderCoupons->discount_value }} {{ __('apps::frontend.master.kwd') }} @else {{ round($order->orderCoupons->discount_percentage, 1) }} % @endif
# {{ getAddonsTitle($addons->id) }} - {{ getAddonsOptionTitle($option) }} {{ getOrderAddonsOptionPrice(json_decode($product->add_ons_option_ids), $option) }} 1 {{ getOrderAddonsOptionPrice(json_decode($product->add_ons_option_ids), $option) }}
{{ __('order::dashboard.orders.show.order.subtotal') }} {{ $customSubTotal }} {{ $order->subtotal }}
{{ __('order::dashboard.orders.show.order.coupon_discount') }} @if ($order->orderCoupons->discount_type == 'value') {{ $order->orderCoupons->discount_value }} @else {{ $order->orderCoupons->discount_percentage }} % @endif
{{ __('order::dashboard.orders.show.order.shipping') }} {{ $order->shipping }}
{{ __('order::dashboard.orders.show.order.total') }} {{ $order->total }}
{{ __('order::dashboard.orders.show.notes') }} : {{ $order->notes ?? '---' }}
{{ __('order::dashboard.orders.show.admin_note') }} : {{ $order->admin_note ?? '---' }}
{!! Form::open([ 'url' => route('dashboard.orders.admin.note', $order->id), 'role' => 'form', 'page' => 'form', 'class' => 'form-horizontal form-row-seperated updateForm', 'method' => 'PUT', 'files' => true, ]) !!}
{!! Form::close() !!}
@if (!is_null($order->delivery_time))
@if (isset($order->delivery_time['date']) && !empty($order->delivery_time['date']))
{{ __('order::dashboard.orders.show.delivery_time.day') }} : {{ $order->delivery_time['date'] ?? '---' }}
@endif @if (isset($order->delivery_time['time_from']) && !empty($order->delivery_time['time_from']))
{{ __('order::dashboard.orders.show.delivery_time.time') }} : From: {{ $order->delivery_time['time_from'] ?? '---' }} To: {{ $order->delivery_time['time_to'] ?? '---' }}
@endif @if (isset($order->delivery_time['type']) && $order->delivery_time['type'] == 'direct')
{{ __('order::dashboard.orders.show.delivery_time.type') }} : {{ __('order::dashboard.orders.show.delivery_time.direct') ?? '---' }}
{{ __('order::dashboard.orders.show.delivery_time.message') }} : {{ $order->delivery_time['message'] ?? '---' }}
@endif
@endif
@if (optional($order->paymentStatus)->flag == 'pending' || (optional($order->paymentStatus)->flag == 'cash' && is_null($order->payment_confirmed_at)) || (optional($order->paymentType)->flag == 'cash' && is_null($order->payment_confirmed_at))) {{-- @permission('confirm_payment_order') {{ __('order::dashboard.orders.show.confirm_payment') }} @endpermission --}} @elseif(in_array(optional($order->paymentStatus)->flag, ['success']) || (optional($order->paymentStatus)->flag == 'cash' && !is_null($order->payment_confirmed_at)) || (optional($order->paymentType)->flag == 'cash' && !is_null($order->payment_confirmed_at))) @permission('refund_order') @if (!$order->is_refund) @endif @endpermission @endif
@permission('show_order_change_status_tab')
{{ __('order::dashboard.orders.show.change_order_status') }}
@csrf
@endpermission
{{ __('order::dashboard.orders.show.change_order_payment_types') }}
@csrf
@if ($order->orderPaymentTypeLogs->count() > 0)
@foreach ($order->orderPaymentTypeLogs as $k => $history) @endforeach
{{ __('order::dashboard.orders.show.order_history.payment_type') }} {{ __('order::dashboard.orders.show.order_history.updated_by') }} {{ __('order::dashboard.orders.show.order_history.date') }}
{{ optional($history->paymentable)->title ?? '' }} {{ is_null($history->user_id) ? '---' : $history->user->name ?? '---' }} {{ $history->created_at }}
@endif
{{ __('order::dashboard.orders.show.change_order_payment_status') }}
@csrf
@if ($order->orderPaymentStatusLogs->count() > 0)
@foreach ($order->orderPaymentStatusLogs as $k => $history) @endforeach
{{ __('order::dashboard.orders.show.order_history.order_status') }} {{ __('order::dashboard.orders.show.order_history.updated_by') }} {{ __('order::dashboard.orders.show.order_history.date') }}
{{ optional($history->paymentable)->flag ?? '' }} {{ is_null($history->user_id) ? '---' : $history->user->name ?? '---' }} {{ $history->created_at }}
@endif
{{ __('transaction::dashboard.orders.show.transaction.payment_id') }} : {{ $order->transactions->payment_id ?? '---' }}
{{ __('transaction::dashboard.orders.show.transaction.track_id') }} : {{ $order->transactions->track_id ?? '---' }}
{{ __('transaction::dashboard.orders.show.transaction.method') }} : {{ $order->transactions->method ?? '---' }}
{{ __('transaction::dashboard.orders.show.transaction.result') }} : {{ $order->transactions->result ?? '---' }}
{{ __('transaction::dashboard.orders.show.transaction.ref') }} : {{ $order->transactions->ref ?? '---' }}
{{ __('transaction::dashboard.orders.show.transaction.tran_id') }} : {{ $order->transactions->tran_id ?? '---' }}
@if (optional($order->paymentStatus)->flag == 'success')
  • {{ __('order::dashboard.orders.show.payment_confirmed_at') }} : {{ $order->payment_confirmed_at ? date('Y-m-d / H:i:s', strtotime($order->payment_confirmed_at)) : '---' }}
@endif @if (!empty($order->payment_commissions))
  • {{ __('apps::dashboard.general.knet_commission') }} : {{ $order->payment_commissions['knet'] }}
  • {{ __('apps::dashboard.general.cc_commission') }} : {{ $order->payment_commissions['cc'] }}
@endif
@permission('show_order_change_status_tab')
{{ __('order::dashboard.orders.show.order_history_log') }}
@foreach ($order->orderStatusesHistory()->orderBy('pivot_created_at', 'desc')->get() as $k => $history) @endforeach
{{ __('order::dashboard.orders.show.order_history.order_status') }} {{ __('order::dashboard.orders.show.order_history.updated_by') }} {{ __('order::dashboard.orders.show.order_history.date') }}
{{ $history->title ?? '' }} {{ is_null(optional($history->pivot)->user_id) ? '---' : \Modules\User\Entities\User::find(optional($history->pivot)->user_id)->name ?? null }} {{ optional($history->pivot)->created_at }}
@endpermission
@stop @section('scripts') @endsection