@extends('layouts.admin.app') @section('title', translate('Order Details')) @push('css_or_js') @endpush @section('content')

{{ translate('Order_Details') }}

{{ $order->details->count() }}

{{ translate('order') }} #{{ $order['id'] }}

{{ translate('Order_Date_&_Time') }}: {{ date('d M Y', strtotime($order['created_at'])) }} {{ date('h:i A', strtotime($order['created_at'])) }}
@if ($order['order_status'] == 'canceled')
{{ translate('Order_Canceled_Date_&_Time') }}: {{ date('d M Y', strtotime($order['updated_at'])) }} {{ date('h:i A', strtotime($order['updated_at'])) }}
@endif @if ($order['order_status'] == 'completed')
{{ translate('Order_Delivered_Date_&_Time') }}: {{ date('d M Y', strtotime($order['updated_at'])) }} {{ date('h:i A', strtotime($order['updated_at'])) }}
@endif
{{ translate('order') }} {{ translate('note') }} : {{ $order['order_note'] }}
{{-- --}}
{{ translate('Status') }} :
@if ($order['order_status'] == 'pending') {{ translate('pending') }} @elseif($order['order_status'] == 'confirmed') {{ translate('confirmed') }} @elseif($order['order_status'] == 'processing') {{ translate('processing') }} @elseif($order['order_status'] == 'out_for_delivery') {{ translate('out_for_delivery') }} @elseif($order['order_status'] == 'delivered') {{ translate('delivered') }} @elseif($order['order_status'] == 'failed') {{ translate('failed_to_deliver') }} @else {{ str_replace('_', ' ', $order['order_status']) }} @endif
{{ translate('payment') }} {{ translate('method') }} : {{ str_replace('_', ' ', $order['payment_method']) }}
{{ translate('Payment_Status') }} :
@if ($order['payment_status'] == 'paid') {{ translate('paid') }} @else {{ translate('unpaid') }} @endif
{{ translate('order') }} {{ translate('type') }} :
@if ($order['order_type'] == 'gas_refill') @endif @php($sub_total = 0) @php($total_tax = 0) @php($total_dis_on_pro = 0) @foreach ($order->details as $detail) @php($tot_discount = $detail['discount_on_product'] * $detail['quantity']) @php( $item_name =json_decode($detail->service_details,true)) @if ($order['order_type'] == 'gas_refill') @endif @php($total_dis_on_pro += $tot_discount) @php($sub_total += $amount) @endforeach
{{ translate('SL') }} {{ translate('Item Details') }} {{ translate('Quantity') }}{{ translate('Type') }}{{ translate('Price') }} {{ translate('Total_price') }}
{{ $loop->iteration }}
{{$order['order_type'] == 'gas_refill' ? $item_name['name'] : $detail->service_name }}
{{ $detail->quantity }} {{ $detail->item_type ?? 'N/A' }} @php($amount = $detail['price'] * $detail['quantity']) {{ \App\CentralLogics\Helpers::set_symbol($detail['price']) }} {{ \App\CentralLogics\Helpers::set_symbol($amount - $tot_discount ) }}

{{ translate('items') }} {{ translate('price') }} :
{{ \App\CentralLogics\Helpers::set_symbol($sub_total) }}
{{ translate('subtotal') }} :
{{ \App\CentralLogics\Helpers::set_symbol($sub_total = $sub_total - $total_dis_on_pro) }}
{{ translate('coupon') }} {{ translate('discount') }} :
- {{ \App\CentralLogics\Helpers::set_symbol($order['coupon_discount_amount']) }}
{{ translate('delivery') }} {{ translate('fee') }} :
@if ($order['order_type'] == 'take_away') @php($del_c = 0) @else @php($del_c = $order['delivery_charge']) @endif {{ \App\CentralLogics\Helpers::set_symbol($del_c) }}
{{ translate('total') }} :
{{--
{{ \App\CentralLogics\Helpers::set_symbol($sub_total+$del_c+$total_tax+$add_ons_cost-$order['coupon_discount_amount']-$order['extra_discount']) }}
--}}
{{ \App\CentralLogics\Helpers::set_symbol($sub_total - $order['coupon_discount_amount'] - $order['extra_discount'] + $del_c) }}
{{-- @if ($order->customer) --}}
@if ($order['order_type'] != 'pos')

{{ translate('Order_Setup') }}

@if ($order['order_status'] == 'confirmed' || $order['order_status'] == 'pending' || $order['order_status'] == 'processing' || $order['order_status'] == 'out_for_delivery')
@endif @if ($order['order_status'] == 'confirmed' || $order['order_status'] == 'pending' || $order['order_status'] == 'processing' || $order['order_status'] == 'out_for_delivery')
@endif @if ($order['order_status'] == 'confirmed' || $order['order_status'] == 'pending' || $order['order_status'] == 'processing')
@if ( $order['order_type'] != 'take_away' && $order['order_type'] != 'pos' && $order['order_type'] != 'dine_in' && !$order['delivery_man_id'] ) {{ translate('Assign_Delivery_Man') }} @endif @endif @if ($order->delivery_man_id && $order['order_status'] != 'delivered')

{{ translate('Assigned Vehicle') }} @if ($order['order_status'] == 'confirmed' || $order['order_status'] == 'pending' || $order['order_status'] == 'processing') {{ translate('Change') }} @endif


@endif @if ($order['order_type'] != 'take_away' && $order['order_type'] != 'pos' && $order['order_type'] != 'dine_in')

{{ translate('Delivery_Informatrion') }}

@if ($order['order_status'] == 'confirmed' || $order['order_status'] == 'pending' || $order['order_status'] == 'processing')
@endif
@php($address = \App\Models\CustomerAddress::find($order['delivery_address_id']))
{{ translate('Name') }}
{{ $address ? $address['contact_person_name'] : '' }}
{{ translate('flat') }}
{{ $address['floor'] ?? '' }}
{{ translate('house') }}
{{ $address['house'] ?? '' }}
{{ translate('road') }}
{{ $address['road'] ?? '' }}
{{ translate('block') }}
{{ $address['block'] ?? '' }}

@if (isset($address['address']) && isset($address['latitude']) && isset($address['longitude']))       {{ $address['address'] }} @else       {{ translate('no_location_found') }} @endif
@endif
@endif @if ($order->customer)

{{ \App\CentralLogics\translate('Customer Information') }}

@else

{{ \App\CentralLogics\translate('Customer information') }}

@endif
{{-- @endif --}}
@endsection @push('script_2') @endpush