@php $max_processing_time = explode('-', $order['restaurant']['delivery_time'])[0]; @endphp @extends('layouts.vendor.app') @section('title', translate('messages.Order Details')) @section('content') details[0]->campaign) ? true : false; $reasons=\App\Models\OrderCancelReason::where('status', 1)->where('user_type' ,'restaurant' )->get(); $subscription = isset($order->subscription_id) ? true : false; $tax_included =0; ?>

{{ translate('messages.order') }} #{{ $order['id'] }} {{-- POS --}} @if ($order->edited) {{ translate('messages.edited') }} @endif

{{ date('d M Y ' . config('timeformat'), strtotime($order['created_at'])) }} @if ($subscription) {{ translate('messages.subscription_order') }}
@endif @if ($order->schedule_at && ($order->scheduled || $subscription)) {{ translate('messages.scheduled_at') }} : @endif @if ($campaign_order) {{ translate('messages.campaign_order') }} @endif @if($order['cancellation_reason'])
{{ translate('messages.order_cancellation_reason') }} : {{ $order['cancellation_reason'] }}
@endif @if($order['cancellation_note'])
{{ translate('messages.order') }} {{ translate('messages.cancellation_note') }} : {{ $order['cancellation_note'] }}
@endif @if($order['order_note'])
{{ translate('messages.order') }} {{ translate('messages.note') }} : {{ $order['order_note'] }}
@endif
@if (isset($order->subscription))
{{ translate('messages.Subscription_status') }} : @if ($order->subscription->status == 'active') {{translate('messages.'.$order->subscription->status)}} @elseif ($order->subscription->status == 'paused') {{translate('messages.'.$order->subscription->status)}} @else {{translate('messages.'.$order->subscription->status)}} @endif
@endif
{{ translate('Status') }} : @if (isset($order->subscription) && $order->subscription->status != 'canceled' ) @php $order->order_status = $order->subscription_log ? $order->subscription_log->order_status : $order->order_status; @endphp @endif @if ($order['order_status'] == 'pending') {{ translate('messages.pending') }} @elseif($order['order_status'] == 'confirmed') {{ translate('messages.confirmed') }} @elseif($order['order_status'] == 'processing') {{ translate('messages.cooking') }} @elseif($order['order_status'] == 'picked_up') {{ translate('messages.out_for_delivery') }} @elseif($order['order_status'] == 'delivered') {{ translate('messages.delivered') }} @else {{ translate(str_replace('_', ' ', $order['order_status'])) }} @endif
{{ translate('messages.payment') }} {{ translate('messages.method') }} : {{ translate(str_replace('_', ' ', $order['payment_method'])) }}
{{ translate('Order Type') }} : {{ translate(str_replace('_', ' ', $order['order_type'])) }}
{{ translate('Payment Status') }} : @if ($order['payment_status'] == 'paid') {{ translate('messages.paid') }} @else {{ translate('messages.unpaid') }} @endif
@foreach ($order->details as $key => $detail) @if (isset($detail->food_id)) @php($detail->food = json_decode($detail->food_details, true)) @php($product_price += $amount) @php($restaurant_discount_amount += $detail['discount_on_food'] * $detail['quantity']) @elseif(isset($detail->item_campaign_id)) @php($detail->campaign = json_decode($detail->food_details, true)) @php($product_price += $amount) @php($restaurant_discount_amount += $detail['discount_on_food'] * $detail['quantity']) @endif @endforeach
'tax_included'])->first() ? \App\Models\BusinessSetting::where(['key'=>'tax_included'])->first()->value : 0; ?>
{{ translate('messages.items') }} {{ translate('messages.price') }}:
{{ \App\CentralLogics\Helpers::format_currency($product_price) }}
{{ translate('messages.addon') }} {{ translate('messages.cost') }}:
{{ \App\CentralLogics\Helpers::format_currency($total_addon_price) }}
{{ translate('messages.subtotal') }} @if ($order->tax_status == 'included' || $tax_included == 1) ({{ translate('messages.TAX_Included') }}) @endif :
{{ \App\CentralLogics\Helpers::format_currency($product_price + $total_addon_price) }}
{{ translate('messages.discount') }}:
- {{ \App\CentralLogics\Helpers::format_currency($restaurant_discount_amount) }}
{{ translate('messages.coupon') }} {{ translate('messages.discount') }}:
- {{ \App\CentralLogics\Helpers::format_currency($coupon_discount_amount) }}
@if ($order->tax_status == 'excluded' || $order->tax_status == null )
{{ translate('messages.vat/tax') }}:
+ {{ \App\CentralLogics\Helpers::format_currency($total_tax_amount) }}
@endif
{{ translate('messages.delivery_man_tips') }}
@php($dm_tips = $order['dm_tips']) + {{ \App\CentralLogics\Helpers::format_currency($dm_tips) }}
{{ translate('messages.delivery') }} {{ translate('messages.fee') }}:
@php($del_c = $order['delivery_charge']) + {{ \App\CentralLogics\Helpers::format_currency($del_c) }}
{{ translate('messages.total') }}:
{{ \App\CentralLogics\Helpers::format_currency( $order['order_amount']) }}
@if ($order['order_status'] != 'delivered')

{{ translate('Order Setup') }}

@php($order_delivery_verification = (bool) \App\Models\BusinessSetting::where(['key' => 'order_delivery_verification'])->first()->value) @php($restaurant =\App\CentralLogics\Helpers::get_restaurant_data())
@if ($order['order_status'] == 'pending') {{ translate('Confirm Order') }} @if (config('canceled_by_restaurant')) {{ translate('Cancel Order') }} @endif @elseif ($order['order_status'] == 'confirmed' || $order['order_status'] == 'accepted') {{ translate('messages.Proceed_for_cooking') }} @elseif ($order['order_status'] == 'processing') {{ translate('messages.make_ready_for_handover') }} @elseif ($order['order_status'] == 'handover' && ($order['order_type'] == 'take_away' || (($restaurant->restaurant_model == 'commission' && $restaurant->self_delivery_system ) || ($restaurant->restaurant_model == 'subscription' && isset($restaurant->restaurant_sub) && $restaurant->restaurant_sub->self_delivery == 1)) )) {{ translate('messages.maek_delivered') }} @endif
@if ($order['order_type'] != 'take_away') @if ($order->delivery_man)
{{ translate('Delivery Man Information') }}
Image Description
{{ $order->delivery_man['f_name'] . ' ' . $order->delivery_man['l_name'] }} {{ $order->delivery_man->orders_count }} {{ translate('messages.orders') }} {{ $order->delivery_man['email'] }} {{ $order->delivery_man['phone'] }}
@if ($order['order_type'] != 'take_away')
@php($address = $order->dm_last_location)
{{ translate('messages.last') }} {{ translate('messages.location') }}
@if (isset($address)) {{ $address['location'] }}
@else {{ translate('messages.location') . ' ' . translate('messages.not_found') }} @endif @endif @else
{{ translate('messages.deliveryman') . ' ' . translate('messages.not_found') }}
@endif @endif
@endif
{{ translate('messages.customer') }} {{ translate('messages.info') }}
@if ($order->customer)
Image Description
{{ $order->customer['f_name'] . ' ' . $order->customer['l_name'] }} {{ $order->customer->orders_count }} {{ translate('Orders') }} {{ $order->customer['phone'] }} {{ $order->customer['email'] }}
@else {{translate('messages.customer_not_found')}} @endif
@if ($order->delivery_address)
@php($address = json_decode($order->delivery_address, true))
{{ translate('messages.delivery') }} {{ translate('messages.info') }}
{{-- @if (isset($address)) @endif --}}
@if (isset($address)) {{ translate('messages.name') }}: {{ $address['contact_person_name'] }} {{ translate('messages.contact') }}: {{ $address['contact_person_number'] }} {{ translate('Road') }}: {{ isset($address['road']) ? $address['road'] : '' }} {{ translate('House') }}: {{ isset($address['house']) ? $address['house'] : '' }} {{ translate('Floor') }}: {{ isset($address['floor']) ? $address['floor'] : '' }} @if ($order['order_type'] != 'take_away' && isset($address['address'])) @if (isset($address['latitude']) && isset($address['longitude'])) {{ $address['address'] }} @else {{ $address['address'] }} @endif @endif @endif
@endif
@endsection @push('script_2') @endpush