@php use App\Models\Category; use App\Models\BalanceTransaction; @endphp @extends('back.layouts.main') @section('title', 'order') @section('content')
@if (auth()->guard('admins')->user()->role_id != 9) @include('back.orders.show.change-status') @elseif($model->restaurant_id != '') تم الطبخ @endif
@include('back.orders.show.driver-order') @include('back.orders.show._problems')
@if ($model->userAddress && $model->userAddress->is_gift == 1) @endif @if ($model->collect != $model->total) @endif @if ($points) @endif @if ($wallet) @if (!BalanceTransaction::where('order_id', $model->id)->where('user_id', $model->user_id)->first())
لا يوجد خصم من المحفظة يرجى مراجعة محفظة المستخدم
@endif @endif @if ($model->return > 0) @endif @if ($model->used_balance > 0) @endif @if ($model->discount > 0) @endif @include('back.orders._address') @if ($model->shop_id != '') @endif @if ($model->day != '') @else @endif @if ($model->slaughter_day != '') @else @endif notes != '') style='color:red' @endif> @if ($model->createdBy && $model->created_at) @endif @if ($model->updatedBy && $model->updated_at) @endif @if ($model->customer_ID != '') @endif
ID {{ $model->id }}
{{ __('back.user') }} @if ($model->user) user->deleted_at != '') style='text-decoration: line-through;' @endif href='user/view/{{ $model->user_id }}'>{{ optional($model->user)->fullname }} @endif @if (optional($model->user)->is_vip == 1) VIP @endif @if ($model->user_id != 1 && $model->user && $model->user->rating != '')     ({{ __('back.Client') }} {{ $model->user->rating }}) @endif @if ($complaints->isNotEmpty()) {{ $complaints->count() }} {{ __('back.previousComplaints') }} @endif
{{ __('back.recipient') }} {{ $model->userAddress->receiver_name }}
{{ __('back.amountWithoutTax') }} {{ $model->subtotal }}
{{ __('back.tax') }} {{ $model->tax }}
{{ __('back.totalPrice') }} @if ($model->total_without_discount > $model->total && $model->discounts->isNotEmpty()) {{ $model->total_without_discount }} @endif {{ $model->total . ' ' . env('currency') }} @if (can('orders.discount')) {{ __('back.giveADiscount') }} @endif
{{ __('back.collection') }} {{ number_format($model->collect, 2) }} {{ env('currency') }} {{ env('currency') }}
{{ __('back.userPointsBalance') }} {{ number_format($points->amount, 2) }} {{ env('currency') }}
{{ __('back.userWalletBalance') }} {{ number_format($wallet->amount, 2) }} {{ env('currency') }}
مرتجع {{ $model->return . ' ' . env('currency') }}
{{ __('back.walletUser') }} {{ $model->used_balance }}
{{ __('back.discountBy') }} @foreach ($model->discounts as $discount) @includeIf('back.orders.discounts.' . $discount->type) @endforeach
{{ __('back.customerMobile') }} @if ($model->user) {{ @$model->user->fullmobile }} @endif
{{ __('back.extraNumber') }} {{ $model->mobile2 }} @if ($model->user && $model->user_id > 2) @php $mobiles = explode(',', $model->user->mobile ??''); $mobiles[] = $model->mobile2; $mobiles = array_filter(array_unique($mobiles)); @endphp {{ implode(' - ', $mobiles) }} @endif
{{ __('back.distributor') }} {{ @$model->shop->name }}
{{ __('back.paymentMethod') }} {!! $model->paymentMethod() !!} @if ($model->payment_method == '3' && $model->payment_status == 'pending') {{ __('back.transferred') }} @elseif($model->payment_status == 'pending' || $model->payment_status == 'failed') {{ __('back.properPaymentProcess') }} {{ __('back.paymentFailed') }} @endif @if ($model->payment_method == '3' || $model->payment_method == '5') @include('back.orders.show.transfer_image_modal') @endif @if ($model->transfer_image != '')
@endif
{{ __('back.today') }} {{ $model->day }}{{ __('back.date') }} {{ $model->date }}
يوم الذبح {{ $model->slaughter_day }}{{ __('back.date') }} {{ $model->date }}
{{ __('back.time') }} {{ $model->time }}
{{ __('back.extraRequests') }} {{ $model->notes }}
{{ __('back.orderStatus') }} {{ @$model->orderStatus->status }}
{{ __('back.insideBy') }} {{ $model->source }}
{{ __('back.orderDate') }} {{ date('Y-m-d', strtotime($model->created_at)) }}
{{ __('back.orderTime') }} {{ date('h:i a', strtotime($model->created_at)) }}
collection id {{ $model->order_collection_id }}
{{ __('back.createdBy') }} {{ __('back.via') . ' ' . $model->createdBy->name . ' ' . __('back.at') . ' ' }} @if (is_object($model->created_at)) {{ $model->created_at->format('Y-m-d h:iA') }} @endif
{{ __('back.lastUpdate') }} {{ __('back.via') . ' ' . $model->updatedBy->name . ' ' . __('back.at') . ' ' }} @if (is_object($model->updated_at)) {{ $model->updated_at->format('Y-m-d h:iA') }} @endif
هوية المستلم customer_ID) }}' target='_blank'> customer_ID) }}'>
ملاحظات دائمة للعميل @if ($model->user && is_array($model->user->notes)) @foreach ($model->user->notes as $note) {{ $note->notes }}
By: {{ $note->createdBy->name }} @ {{ $note->created_at }}

@endforeach @endif
@csrf
{{ __('back.accountNotes') }}
{{ __('back.evaluation') }}
{{ $model->rating }}
{{ __('back.comment') }}
{{ @$model->ratingReason->name }}
{{ $model->rating_suggestion }}
@if ($model->category_id=='168') @include('back.orders.show.gift-sticker') @endif
@foreach ($model->details as $item) @php $product = $item->product()->withoutGlobalScopes()->first(); @endphp @include('back.orders.show.gift') @endforeach
{{ __('back.type') }} {{ __('back.quantity') }} {{ __('back.priceOfOne') }} {{ __('back.weight') }} {{ __('back.age') }} {{ __('back.details') }} {{ __('back.cooking') }}
{{ $product->name }} @if ($product->order_notes)
({{ $product->order_notes }}) @endif
{{ $item->quantity }} {{ $item->price . ' ' . env('currency') }} @if ($item->subProduct) {{ @$item->subProduct->data['weight'] }} @endif @if ($item->subProduct) {{ @$item->subProduct->data['age'] }} @endif @if (in_array($model->category_id, [1, 160]) && !$item->orderAttributes->where('attribute_id', '1')->first()) يشمل الطلب على: - @endif @foreach ($item->orderAttributes as $orderAttribute) @php $attribute = optional( $orderAttribute ->attribute() ->withoutGlobalScope('shop_ids') ->first(), ); @endphp
{{ $attribute->name }}: @if (in_array($attribute->section_name, ['textarea'])) {{ $orderAttribute->attribute_value }} @else @foreach ($orderAttribute->values() as $attributeValue) @if (!$loop->first) , @endif {{ $attributeValue->value }} @if (isset($attributeValue->data['description'])) ({{ $attributeValue->data['description'] }}) @endif @endforeach @endif
@endforeach @if ($item->cooking_plates != '')
{{ __('back.numberOfPlates') }} : {{ $item->cooking_plates }} @endif @if ($item->cooking_persons != '')
{{ __('back.numberOfPeople') }} : {{ $item->cooking_persons }} @endif
@if ($item->cooking) {{ $item->cooking->name }} - {{ $model->restaurant->name }} @endif
@include('back.orders.show.assign-modal') @include('back.orders.show.custom-time-modal') @include('back.orders.show.assign-cargoo-modal') @include('back.orders.show.discount-modal') @stop