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

{{ translate('messages.order') }} {{translate('id')}} {{translate('#')}}{{ $order['id'] }} {{-- {{translate('pos')}} --}} @if ($order->edited) {{ translate('messages.edited') }} @endif
@if (!$subscription && !$editing && in_array($order->order_status, ['pending', 'confirmed', 'processing', 'accepted'])) @if ($order->restaurant) @endif @endif {{ translate('messages.print') }} {{ translate('messages.invoice') }}

{{ 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') }} : {{ date('d M Y ' . config('timeformat'), strtotime($order['schedule_at'])) }} @endif @if (isset($order->restaurant))
{{ translate('messages.restaurant') }} :
@else
{{ translate('messages.restaurant') }} :
@endif
@if ($campaign_order) {{ translate('messages.campaign_order') }} @endif
{{-- @if ( $refund == true && $order->payment_status == 'paid' && $order->order_status != 'refunded' && isset($order->restaurant) ) @endif --}}
@if($order['cancellation_reason'])
{{ translate('messages.Cancelled_By') }} : {{ $order['canceled_by'] }}
{{ translate('messages.order_cancellation_reason') }} : {{ $order['cancellation_reason'] }}
@endif @if($order['cancellation_note'] != null)
{{ translate('messages.cancellation_note') }} : {{ $order['cancellation_note'] }}
@endif @if($order['order_note'] != null)
{{ translate('messages.note') }} : {{ $order['order_note'] }}
@endif
@if (!$subscription && !$editing && in_array($order->order_status, ['pending', 'confirmed', 'processing', 'accepted'])) @if ($order->restaurant) @endif @endif {{ translate('messages.print') }} {{ translate('messages.invoice') }}
@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
@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 {{ translate('messages.status') }} : @if ($order['order_status'] == 'pending') {{ translate('messages.pending') }} @elseif($order['order_status'] == 'confirmed') {{ translate('messages.confirmed') }} @elseif($order['order_status'] == 'processing') {{ translate('messages.processing') }} @elseif($order['order_status'] == 'picked_up') {{ translate('messages.out_for_delivery') }} @elseif($order['order_status'] == 'delivered') {{ translate('messages.delivered') }} @elseif($order['order_status'] == 'failed') {{ translate('messages.payment') }} {{ translate('messages.failed') }} @else {{ str_replace('_', ' ', $order['order_status']) }} @endif
{{ translate('messages.payment') }} {{ translate('messages.method') }} : {{ str_replace('_', ' ', $order['payment_method']) }}
@if ($order['transaction_reference'] == null) {{ translate('messages.reference') }} {{ translate('messages.code') }} : @if (isset($order->restaurant)) @endif @else {{ translate('messages.reference') }} {{ translate('messages.code') }} : {{ $order['transaction_reference'] }} @endif
{{ translate('messages.order') }} {{ translate('messages.type') }} : {{ str_replace('_', ' ', $order['order_type']) }}
@if ($order->coupon)
{{ translate('messages.coupon') }}
@endif
{{translate('messages.payment')}} {{translate('messages.status')}} : @if ($order['payment_status'] == 'paid') {{ translate('messages.paid') }} @else {{ translate('messages.unpaid') }} @endif
@if ($editing && !$campaign_order)
@foreach ($products as $product)
@include('admin-views.order.partials._single_product', [ 'product' => $product, 'restaurant_data' => $order->restaurant, ]) {{--
--}}
@endforeach

{!! $products->withQueryString()->links() !!}
@endif
coupon_code) { $coupon = \App\Models\Coupon::where(['code' => $order['coupon_code']])->first(); if ($editing && $coupon->coupon_type == 'free_delivery') { $del_c = 0; $coupon = null; } } $details = $order->details; if ($editing) { $details = session('order_cart'); // dd($details); } else { foreach ($details as $key => $item) { $details[$key]->status = true; } } ?>
@forelse ($details as $key => $detail) @if (isset($detail->food_id) && $detail->status ) food == null?1:0; $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) && $detail->status) {{-- {{ dd($detail) }} --}} campaign == null?1:0; $detail->campaign = json_decode($detail->food_details, true); } ?> @php($product_price += $amount) @php($restaurant_discount_amount += $detail['discount_on_food'] * $detail['quantity']) @endif @empty @endforelse

tax_status == 'included'){ $tax_a=0; } if ($editing) { $restaurant_discount = \App\CentralLogics\Helpers::get_restaurant_discount($order->restaurant); if (isset($restaurant_discount)) { if ($product_price + $total_addon_price < $restaurant_discount['min_purchase']) { $restaurant_discount_amount = 0; } if ($restaurant_discount_amount > $restaurant_discount['max_discount']) { $restaurant_discount_amount = $restaurant_discount['max_discount']; } } $coupon_discount_amount = $coupon ? \App\CentralLogics\CouponLogic::get_discount($coupon, $product_price + $total_addon_price - $restaurant_discount_amount) : $order['coupon_discount_amount']; $tax = $order->restaurant->tax; $total_price = $product_price + $total_addon_price - $restaurant_discount_amount - $coupon_discount_amount; $total_tax_amount = $tax > 0 ? ($total_price * $tax) / 100 : 0; $total_tax_amount = round($total_tax_amount, 2); $tax_a=$total_tax_amount; $tax_included = \App\Models\BusinessSetting::where(['key'=>'tax_included'])->first() ? \App\Models\BusinessSetting::where(['key'=>'tax_included'])->first()->value : 0; if ($tax_included == 1){ $tax_a=0; } $restaurant_discount_amount = round($restaurant_discount_amount, 2); if ($order->restaurant->free_delivery) { $del_c = 0; } $free_delivery_over = \App\Models\BusinessSetting::where('key', 'free_delivery_over')->first()->value; if (isset($free_delivery_over)) { if ($free_delivery_over <= $product_price + $total_addon_price - $coupon_discount_amount - $restaurant_discount_amount) { $del_c = 0; } } } else { $restaurant_discount_amount = $order['restaurant_discount_amount']; } ?>
{{ 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 ) {{-- @php($tax_a=0) --}}
{{ translate('messages.vat/tax') }}:
+ {{ \App\CentralLogics\Helpers::format_currency($tax_a) }}
@endif
{{ translate('DM Tips') }}
+ {{ \App\CentralLogics\Helpers::format_currency($deliverman_tips) }}
{{ translate('Delivery Fee') }}
+ {{ \App\CentralLogics\Helpers::format_currency($del_c) }}
{{ translate('messages.total') }}:
{{ \App\CentralLogics\Helpers::format_currency($product_price + $del_c + $tax_a + $total_addon_price + $deliverman_tips - $coupon_discount_amount - $restaurant_discount_amount) }}
@if ($editing)
@endif
@php ($refund= \App\Models\BusinessSetting::where(['key'=>'refund_active_status'])->first()) @if (!empty($order->refund)) @if ( $order->order_status == 'refund_requested' || $order->order_status == 'refunded' || $order->order_status == 'refund_request_canceled')

{{ translate('messages.Refund Request') }}

{{ date('d M Y ' . config('timeformat'), strtotime($order->refund->created_at)) }} @if ($order->order_status == 'refund_requested') {{ translate('messages.pending') }} @elseif($order->order_status == 'refunded') {{ translate('messages.refunded') }} @elseif($order->refund->order_status == 'refund_request_canceled') {{ translate('messages.rejected') }} @endif
@php( $data= (isset($order->refund->image)) ? json_decode($order->refund->image,true) : 0 ) @if ($data) @foreach($data as $key=>$img)
@endforeach @else
@endif

  • {{ translate('Reason') }} {{ $order->refund->customer_reason }}
  • {{ translate('amount') }} {{ $order->refund->refund_amount }}
  • {{ translate('Method') }} {{ $order->refund->refund_method }}
  • {{ translate('Status') }} {{ $order->refund->refund_status }}
  • @if (isset($order->refund->admin_note))
  • {{ translate('Admin Note') }} {{ $order->refund->admin_note ?? 'No Note'}}
  • @endif @if (isset($order->refund->customer_note))
  • {{ translate('Customer Note') }} {{ $order->refund->customer_note ?? 'No Note' }}
  • @endif
@if ($refund && $refund->value == true && $order->order_status == 'refund_requested') @endif @if ( $refund && $refund->value == true && $order->payment_status == 'paid' && $order->order_status != 'refunded' ) @if ($order->order_status == 'refunded' ) @else @endif @endif
@endif @endif
@if (isset($order->restaurant))
@if(empty($order->refund)) @if (!in_array($order['order_status'], ['delivered','take_away','refund_requested','canceled','refunded','refund_request_canceled']) )

{{translate('order_setup')}}

@if ($order['order_type'] != 'take_away' && !$order->delivery_man && (isset($order->restaurant) && ($order->restaurant->restaurant_model == 'commission' && !$order->restaurant->self_delivery_system ) || ($order->restaurant->restaurant_model == 'subscription' && isset($order->restaurant->restaurant_sub) && $order->restaurant->restaurant_sub->self_delivery == 0)))
@endif @endif @endif
@endif {{-- @if (($order['order_type'] != 'take_away' && $order->restaurant && !$order->restaurant->self_delivery_system && !$subscription) || $order->subscription_log) --}} @if ($order->delivery_man && $order->delivery_man->type == 'zone_wise')
{{translate('deliveryman')}}
@if ( !in_array($order['order_status'], ['delivered','refund_requested','canceled','refunded','refund_request_canceled']) && $order['order_type'] != 'take_away' && (isset($order->restaurant) && ($order->restaurant->restaurant_model == 'commission' && !$order->restaurant->self_delivery_system ) || ($order->restaurant->restaurant_model == 'subscription' && isset($order->restaurant->restaurant_sub) && $order->restaurant->restaurant_sub->self_delivery == 0))) {{ translate('messages.change') }} @endif
Image Description
{{ $order->delivery_man['f_name'] . ' ' . $order->delivery_man['l_name'] }} {{ $order->delivery_man->orders_count }} {{ translate('messages.orders_delivered') }} {{ $order->delivery_man['phone'] }} {{ $order->delivery_man['email'] }}

@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 {{-- @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('messages.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('delivery') }} {{ translate('messages.info') }}
@if (isset($address) && isset($order->restaurant)) @endif
@if (isset($address)) {{ translate('name') }} {{ $address['contact_person_name'] }} {{ translate('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 (isset($address['address'])) @if (empty($address['longitude']) && empty($address['latitude']) && isset($address['latitude']) && isset($address['longitude'])) @else
{{ $address['address'] }}
@endif @endif
@endif @endif
@endsection @push('script_2') @endpush