{{__('message.order_detail')}}
@if($data['status'] != 'completed') @endif
@if(Auth::user()->user_type == 'admin') {{ __('message.back') }} @else {{ __('message.back') }} @endif
@if($data['status'] == 'reschedule')
{{ __('message.order_has_been_rechedule') . ' : ' . dateAgoFormate($data->rescheduledatetime) }}
@elseif($data['is_shipped'] == 1)
{{--
{{ __('message.order_has_been_shipped') . '' . __('message.via') . '' . $courierCompany->name . ' : ' . dateAgoFormate($data->shipped_verify_at)}}
--}}
{{ __('message.order_has_been_shipped') . ' ' . __('message.via') . ' ' . optional($data->couriercompany)->name . ' : ' . dateAgoFormate($data->shipped_verify_at) }}
@endif @if($data['bid_type'] == 1)
{{ __('message.order_has_bids') }}
@endif

{{ __('message.parcel_details') }}

{{ __('message.parcel_type') }}

{{ isset($data->parcel_type) ? $data->parcel_type : '-' }}

{{ __('message.total_weight') }}

{{ isset($data->total_weight) ? $data->total_weight : '-' }} {{optional($data->country)->weight_type}}

{{ __('message.total_parcel') }}

{{ isset($data->total_parcel) ? $data->total_parcel : '-' }}

{{ __('message.payment_details') }}

@if(isset($data->payment) && !in_array(optional($data->payment)->payment_type, ['wallet', 'cash']))
{{ __('message.payment_type') }}: {{ optional($data->payment)->payment_type ?? '-' }}
|
{{ __('message.txn_id') }}: {{ optional($data->payment)->txn_id ?? '-' }}
@else
{{ __('message.payment_type') }}

{{ optional($data->payment)->payment_type ?? ($data->payment_type ?? '-') }}

@endif
{{ __('message.payment_status') }}

{{ optional($data->payment)->payment_status ?? '-' }}

{{ __('message.payment_collect_from') }}

{{ isset($data->payment_collect_from) ? __('message.'.$data->payment_collect_from) : '-' }}

{{ __('message.pickup_address') }}

@if($data['status'] == 'courier_picked_up' || $data['status'] == 'completed' || $data['status'] == 'courier_departed')

{{__('message.picked')}} {{ dateAgoFormate($data->pickup_datetime) }}

@endif

{{ $data->pickup_point['address'] }}

{{ auth()->user()->hasRole('admin') ? maskSensitiveInfo('contact_number',$data->pickup_point['contact_number']) : maskSensitiveInfo('contact_number',$data->pickup_point['contact_number']) }}
@if(!empty($data->pickup_point['name']))

{{ $data->pickup_point['name'] }}

@endif @if(!empty($data->pickup_point['description']))

{{ __('message.description') }}: {{ $data->pickup_point['description'] }}

@endif @if(!empty($data->pickup_point['instruction']))

{{ __('message.instruction') }}: {{ $data->pickup_point['instruction'] }}

@endif

{{ __('message.delivery_address') }}

@if($data['status'] == 'completed')

{{__('message.delivered_at')}} {{ dateAgoFormate($data->delivery_datetime) }}

@endif

{{ $data->delivery_point['address'] }}

{{ auth()->user()->hasRole('admin') ? maskSensitiveInfo('contact_number',$data->delivery_point['contact_number']) : maskSensitiveInfo('contact_number',$data->delivery_point['contact_number']) }}
@if(!empty($data->delivery_point['name']))

{{ $data->delivery_point['name'] }}

@endif @if(!empty($data->delivery_point['description']))

{{ __('message.description') }}: {{ $data->delivery_point['description'] }}

@endif @if(!empty($data->delivery_point['instruction']))

{{ __('message.instruction') }}: {{ $data->delivery_point['instruction'] }}

@endif
@if($data->packaging_symbols != null)

{{ __('message.packaging_symbol') }}

@php $packagingSymbols = json_decode($data->packaging_symbols, true); @endphp @if (is_array($packagingSymbols)) @foreach ($packagingSymbols as $symbol) @php $icon = ''; switch ($symbol['key']) { case 'fragile': $icon = asset('images/fragile.png'); break; case 'keep_dry': $icon = asset('images/keep-dry.png'); break; case 'this_way_up': $icon = asset('images/up-arrows-couple-sign-for-packaging.png'); break; case 'do_not_stack': $icon = asset('images/do-not-stack.png'); break; case 'temperature_sensitive': $icon = asset('images/temperature.png'); break; case 'recycle': $icon = asset('images/symbols.png'); break; case 'do_not_use_hooks': $icon = asset('images/do-not-hook.png'); break; case 'explosive_material': $icon = asset('images/flammable.png'); break; case 'hazardous_material': $icon = asset('images/hazard.png'); break; case 'perishable': $icon = asset('images/ice-cube.png'); break; case 'do_not_open_with_sharp_objects': $icon = asset('images/knives.png'); break; case 'bike_delivery': $icon = asset('images/fast-delivery.png'); break; default: $icon = ''; break; } @endphp @if ($icon)
@if (strpos($icon, 'http') === 0) @else {!! $icon !!} @endif
@endif @endforeach @endif
@endif @if($customerSupport->isNotEmpty())

{{ __('message.customers_supports') }}

@endif
@if ($data['status'] == 'courier_picked_up' || $data['status'] == 'completed' || $data['status'] == 'courier_departed')

{{ __('message.pickup_signature') }}

@if( isset($data)&& optional($data)->hasMedia('pickup_time_signature') )
@foreach(optional($data)->getMedia('pickup_time_signature') as $media) @endforeach
@else
profile-pic
@endif
@endif @if($data['status'] == 'completed')

{{ __('message.delivery_signature') }}

@if( isset($data)&& optional($data)->hasMedia('delivery_time_signature') )
@foreach(optional($data)->getMedia('delivery_time_signature') as $media) @endforeach
@else
profile-pic
@endif
@endif
@if($mediaItems['prof_file'] !=null)

{{ __('message.profofpicture') }}

@foreach ($mediaItems['prof_file'] as $file) @if(str_contains($file->mime_type, 'image')) @endif @endforeach
@foreach ($mediaItems['prof_file'] as $file) @if(str_contains($file->mime_type, 'video')) @endif @endforeach
@endif @if($data['status'] == 'cancelled')

{{ __('message.cancelled_reason') }}

{{($data->reason)}}
@endif @if ($data['status'] == 'cancelled' && $data['status'] == 'return')

{{ __('message.cancelled_reason') }}

{{($data->reason)}}
@endif @if($data['reason'] != null && $data['status'] != 'cancelled')

{{ __('message.return_reason') }}

{{ $data['reason'] }}
{{ __('message.view_old_order')}}
@endif @if($complate_data != null)

{{ __('message.return_reason') }}

{{ $complate_data->reason }}
{{ __('message.view_new_order')}}
@endif
@if ($data->weight_charge != null) @endif @if ($data->vehicle_charge != null) @endif @if ($data['distance_charge'] != '0') @endif @if ($data['insurance_charge'] != '0') @endif @if ($data['discount_amount'] != '0') @endif @if($data->extra_charges != null) @endif @if(!empty($data->extra_charges)) @php if (is_string($data->extra_charges)) { $data->extra_charges = json_decode($data->extra_charges, true); } $extra_charges_texts = []; $extra_charges_values = []; $totall = $data->fixed_charges + $data->distance_charge + $data->weight_charge + $data->vehicle_charge + $data->insurance_charge; if (is_array($data->extra_charges)) { foreach ($data->extra_charges as $item) { if (isset($item['value_type'])) { $formatted_value = ($item['value_type'] == 'percentage') ? $item['value'] . '%' : $data->currency . '' . number_format( (float) $item['value'],2,'.','' ); if ($item['value_type'] == 'percentage') { $data_value = $totall * $item['value'] / 100; $key = str_replace('_', ' ', ucfirst($item['key'])); $extra_charges_texts[] = $key . ' (' . $formatted_value . ')'; $extra_charges_values[] = $data->currency . '' . number_format( (float) $data_value,2,'.',''); } else { $key = str_replace('_', ' ', ucfirst($item['key'])); $extra_charges_texts[] = $key . ' (' . $formatted_value . ')'; $extra_charges_values[] = $formatted_value; } } } if(isset($item['value_type'])){ $values = []; $countFixed = 0; foreach ($data->extra_charges as $item) { if (in_array($item['value_type'], ['percentage', 'fixed'])) { if ($item['value_type'] == 'percentage') { $values[] = $totall * $item['value'] / 100; } elseif ($item['value_type'] == 'fixed') { $values[] = $item['value']; } } } $totalextracharge = array_sum($values); } } $extra_charges_text_with_br = implode('
', $extra_charges_texts); $extra_charges_text_values = implode('
', $extra_charges_values); @endphp @foreach ($extra_charges_texts as $index => $text) @endforeach @endif @php if (isset($data->extra_charges)) { $totalextracharge = 0; if (isset($values)) { $totalextracharge = array_sum($values); } $total_amount = $data->fixed_charges + $data->distance_charge + $data->weight_charge + $data->vehicle_charge + $data->insurance_charge + $totalextracharge; } else { $total_amount = $data->fixed_charges + $data->distance_charge + $data->weight_charge + $data->vehicle_charge + $data->insurance_charge; } if($data['bid_type'] == 1){ $total_amount = $data->total_amount; } @endphp @if($data['status'] != 'cancelled') @endif @if($data['status'] == 'cancelled') @php $totalextracharge = $totalextracharge ?? 0; $original_total_amount = $data->fixed_charges + $data->distance_charge + $data->weight_charge + $data->vehicle_charge + $data->insurance_charge + $totalextracharge; $cancel_charges = optional($data->payment)->cancel_charges; $total_with_cancel_charges = $cancel_charges; @endphp @endif
{{ __('message.description') }} {{ __('message.sub_total') }}
{{ __('message.delivery_charges') }} {{ $data->currency }}{{ number_format( (float) $data->fixed_charges, 2,'.','') }}
{{ __('message.weight_charge') }} {{ $data->currency }}{{ number_format( (float) $data->weight_charge , 2,'.','') }}
{{ __('message.vehicle_charge') }} {{ $data->currency }}{{ number_format( (float) $data->vehicle_charge , 2,'.','') }}
{{ __('message.distance_charge') }} {{ $data->currency }}{{ number_format( (float) $data->distance_charge,2,'.','') }}
{{ __('message.insurance_charge') }} {{ $data->currency }}{{ number_format( (float) $data->insurance_charge,2,'.','') }}
{{ __('message.discount') }} {{ $data->currency }} {{ number_format( (float) $data->discount_amount,2,'.','') }}
{{ __('message.extra_charges') }}
{{ $text }} {{ $extra_charges_values[$index] }}
{{ __('message.total') }} {{$data->currency}}{{ number_format( (float) $total_amount,2,'.','') }}
{{ __('message.total') }} {{$data->currency}}{{ number_format( (float) $original_total_amount,2,'.','') }}
{{ __('message.cancel_charges') }} {{ number_format( (float) $total_with_cancel_charges,2,'.','') }}
@if($data->status != 'cancelled' && $data->status != 'completed') {{ __('message.cancel_order') }} @endif
@if(auth()->user()->user_type == 'client') @else

{{ __('message.about_user') }}


profile-pic
{{ optional($data->client)->name ?? '' }}
{{ maskSensitiveInfo('email',optional($data->client)->email) }}
{{ maskSensitiveInfo('contact_number',optional($data->client)->contact_number) }}
{{--
{{ optional($data->client)->address ?? '' }}
`
--}}
@endif @if($data['delivery_man_id'] != null)

{{ __('message.about_delivery_man') }}


profile-pic
{{ optional($data->delivery_man)->name ?? '' }}
{{ maskSensitiveInfo('email',optional($data->delivery_man)->email) }}
{{ maskSensitiveInfo('contact_number',optional($data->delivery_man)->contact_number) }}
{{ optional($data->user)->address ?? '' }}
@else @endif @if( isset($data) && optional($data->vehicle)->hasMedia('vehicle_image') )

{{ __('message.vehicle') }}


@foreach(optional($data->vehicle)->getMedia('vehicle_image') as $media) @endforeach
{{ __('message.vehicle_name') }}

{{optional($data->vehicle)->title}}

@endif @if($data['status'] == 'completed' && $data['is_shipped'] == 1)

{{ __('message.courier_companies') }}


{{__('message.name')}} :
{{__('message.link')}} :
  • {{ $courierCompany->name ?? '-' }}
  • {{ $courierCompany->link ?? '-' }}
  • @endif @if(in_array($data['status'], ['courier_departed', 'courier_picked_up']))

    {{ __('message.courier_companies') }}


    {!! html()->form('PUT', route('courier.couriercompany',$data->id))->id('couriercompany-form')->open() !!} {!! html()->hidden('is_shipped', 0) !!} {!! html()->hidden('status', 'courier_departed') !!} {!! html()->hidden('status', 'courier_departed') !!} @php $disabled = isset($data->couriercompany_id) && $data->couriercompany_id ? 'disabled' : null; @endphp
    {!! html()->label(__('message.courier_companies') . ' *')->class('form-control-label')->for('couriercompany_id') !!} {!! html()->select('couriercompany_id', isset($data) ? [optional($data->couriercompany)->id => optional($data->couriercompany)->name] : []) ->class('select2js form-group couriercompany_id') ->attribute('data-placeholder', __('message.courier_companies')) ->attribute('data-ajax--url', route('ajax-list', ['type' => 'couriercompany-list'])) ->attributeIf($disabled, 'disabled') !!}
    @php $readonly = isset($data->couriercompany_id) && $data->couriercompany_id ? 'readonly' : null; @endphp
    {!! html()->label(__('message.tracking_id') . ' *')->class('form-control-label')->for('tracking_id') !!} {!! html()->number('tracking_id', old('tracking_id', $trackingId)) ->class('form-control') ->placeholder(__('message.enter_ids')) ->attributeIf($readonly, 'readonly') !!}
    {!! html()->label(__('message.tracking_details') . ' *')->class('form-control-label')->for('tracking_details') !!} {!! html()->text('tracking_details', old('tracking_details')) ->class('form-control') ->placeholder(__('message.tracking_details')) ->required() !!}
    {!! html()->label(__('message.tracking_number') . ' *')->class('form-control-label')->for('tracking_number') !!} {!! html()->number('tracking_number', old('tracking_number')) ->id('insurance_text') ->class('form-control') ->placeholder(__('message.tracking_number')) ->attribute('min', 0) ->attributeIf($disabled, 'disabled') !!}
    @php $readonly = isset($data->tracking_details) && $data->tracking_details ? 'readonly' : null; @endphp
    {!! html()->label(__('message.shipping_provider') . ' *')->class('form-control-label')->for('shipping_provider') !!} {!! html()->text('shipping_provider', old('shipping_provider')) ->class('form-control') ->placeholder(__('message.shipping_provider')) ->attributeIf($readonly, 'readonly') !!}
    {!! html()->label(__('message.date_shipped') . ' *')->class('form-control-label')->for('date_shipped') !!} {!! html()->input('datetime-local', 'date_shipped', old('date_shipped')) ->class('form-control datetimepicker') ->placeholder(__('message.date')) ->attributeIf($readonly, 'readonly') !!}
    @if(!$data->couriercompany_id)
    {!! html()->submit(__('message.shipped'))->class('btn btn-sm btn-primary float-right') !!}
    @endif {!! html()->form()->close() !!}
    @endif

    {{ __('message.orderhistory') }}


    @if(count($data->orderhistory) > 0)
      @foreach($data->orderhistory as $history) @php switch ($history->history_type) { case 'create': $iconClass = 'fa-solid fa-file-pen'; break; case 'courier_assigned': $iconClass = 'fa-solid fa-file-signature'; break; case 'courier_arrived': $iconClass = 'fa-solid fa-file-arrow-down'; break; case 'courier_picked_up': $iconClass = 'fa-solid fa-truck-fast'; break; case 'courier_departed': $iconClass = 'fa fa-plane-departure'; break; case 'payment_status_message': $iconClass = 'fa fa-credit-card'; break; case 'courier_transfer': $iconClass = 'fas fa-box'; break; case 'completed': $iconClass = 'fa fa-square-check'; break; case 'return': $iconClass = "fa fa-rotate"; break; case 'courier_auto_assign_cancelled': $iconClass = "fa-solid fa-ban"; break; case 'cancelled': $iconClass = "fa-solid fa-xmark"; break; case 'isrechedule': $iconClass = "fa-solid fa-calendar-day"; break; case 'shipped_order': $iconClass = "fa-solid fa-ship"; break; case 'bid_placed': $iconClass = "fa-solid fa-bell"; break; case 'reject_bid': $iconClass = "fa-solid fa-right-from-bracket"; break; case 'active': $iconClass = "fa-solid fa-car-rear"; break; default: $iconClass = 'fa-solid fa-question-circle'; break; } @endphp
    • @php $deliveryManId = $history->history_data['delivery_man_id'] ?? null; @endphp
      {{ __('message.' . $history->history_type)}}
      {{ dateAgoFormate($history->created_at) }}

      {{ $history->history_message }} @if($deliveryManId) {{ __('message.view_more') }} @endif

    • @endforeach
    @endif
    @section('bottom_script') @endsection