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

{{-- --}} {{ __('message.invoice_no') }} : {{ optional($ride_detail)->id }}
{{ __('message.title_date', ['title' => __('message.invoice')]) }} : {{ $today }}
{{ __('message.title_date', ['title' => __('message.booked')]) }} : {{ date('d/m/Y', strtotime($ride_detail->created_at)) }}
{{ __('message.payment_via') }} : {{ ucfirst(optional($ride_detail->payment)->payment_type) }}
{{ __('message.title_date', ['title' => __('message.payment')]) }} : {{ date('d/m/Y', strtotime($ride_detail->payment->created_at)) }}
@if((!empty($data->multi_drop_location) && is_array($data->multi_drop_location)) || (!empty($data->drop_location) && is_array($data->drop_location))) @php // Use multi_drop_location if available, otherwise process drop_location if (!empty($data->multi_drop_location)) { $dropLocations = $data->multi_drop_location; } elseif (!empty($data->drop_location)) { $dropLocations = array_map(fn($item) => json_decode($item, true), $data->drop_location); } else { $dropLocations = []; } @endphp
@if(is_array($dropLocations) && count($dropLocations) > 0) @foreach($dropLocations as $item)

{{ $item['address'] ?? '-' }}
{{ __('message.dropped_at') }}: {{ !empty($item['dropped_at']) ? date('Y-m-d H:i', strtotime($item['dropped_at'])) : '-' }}

@endforeach @else

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

@endif
@endif
{{__('message.pickup_address')}} :
{{__('message.drop_address')}}
{{ $ride_detail->start_address }} {{ $ride_detail->end_address }}
{{ __('message.detail_form_title',['form' => __('message.driver')]) }} : {{ __('message.detail_form_title',['form' => __('message.rider')]) }} :
{{ __('message.name') }}: {{ $ride_detail->driver->display_name }}
{{ __('message.contact') }}: {{ $ride_detail->driver->contact_number }}
{{-- {{ __('message.car_model') }}: {{ $ride_detail->driver->userDetail->car_model }}
{{ __('message.car_plate_number') }}: {{ $ride_detail->driver->userDetail->car_plate_number }} --}}
{{ __('message.name') }}: {{ $ride_detail->rider->display_name }}
{{ __('message.contact') }}: {{ $ride_detail->rider->contact_number }}
@if ($ride_detail->ride_has_bid == 1) @else @php $distance_unit = $ride_detail->distance_unit; $extra_charges_values = []; $extra_charges_texts = []; $sub_total = $ride_detail->subtotal; $grand_total = $sub_total; // Calculate extra charges if (is_array($ride_detail->extra_charges)) { foreach ($ride_detail->extra_charges as $item) { if (isset($item['value_type'])) { $formatted_value = ($item['value_type'] == 'percentage') ? $item['value'] . '%' : getPriceFormat($item['value']); if ($item['value_type'] == 'percentage') { $data_value = $sub_total * $item['value'] / 100; $key = str_replace('_', ' ', ucfirst($item['key'])); $extra_charges_texts[] = $key . ' (' . $formatted_value . ')'; $extra_charges_values[] = getPriceFormat($data_value); $grand_total += $data_value; } else { $key = str_replace('_', ' ', ucfirst($item['key'])); $extra_charges_texts[] = $key . ' (' . $formatted_value . ')'; $extra_charges_values[] = $formatted_value; $grand_total += $item['value']; } } } } // Add tips if available //if (isset($ride_detail->tips)) { // $grand_total += $ride_detail->tips; //} @endphp @if($ride_detail->minimum_fare == ($ride_detail->subtotal - $ride_detail->extra_charges_amount)) @else @endif @endif
{{ __('message.description') }} {{ __('message.detail_form_title',['form' => '']) }}
{{ __('message.total_distance') }} {{ $ride_detail->distance ?? 0 }} {{ $ride_detail->distance_unit }}
{{ __('message.total_duration') }} {{ $ride_detail->duration }} {{ __('message.min') }}
{{ __('message.sub_total') }} {{ getPriceFormat($ride_detail->approvedBids->bid_amount) }}
{{ __('message.minimum_fare') }} {{ getPriceFormat($ride_detail->minimum_fare) }}
{{ __('message.base_fare') }} {{ getPriceFormat($ride_detail->base_fare) }}
{{ __('message.distance') }} {{ getPriceFormat($ride_detail->per_distance_charge) }}
{{ __('message.duration') }} {{ getPriceFormat($ride_detail->per_minute_drive_charge) }}
{{ __('message.wait_time') }} {{ getPriceFormat($ride_detail->per_minute_waiting_charge) }}
{{ __('message.extra_charges') }} @if(count($ride_detail->extra_charges) > 0) @php $extra_charges = collect($ride_detail->extra_charges)->pluck('value')->sum(); @endphp {{ $extra_charges }} @else {{ getPriceFormat($ride_detail->extra_charges_amount) }} @endif
{{ __('message.coupon_discount') }} {{ getPriceFormat($ride_detail->coupon_discount) }}
{{ __('message.fixed_charges') }} {{ getPriceFormat($ride_detail->surge_amount) }}
@if ($ride_detail->ride_has_bid == 1) @else @if($ride_detail->extra_charges) @foreach ($extra_charges_texts as $index => $text) @endforeach @endif @endif
{{ __('message.total') }} @php $totalwithBid = $ride_detail->approvedBids->bid_amount + $ride_detail->surge_amount; @endphp {{ getPriceFormat($totalwithBid) }}
{{ __('message.sub_total') }} @php $subTotal = $sub_total + $ride_detail->surge_amount @endphp {{ getPriceFormat($subTotal) }}
{{ $text }} {{ $extra_charges_values[$index] }}
{{ __('message.total') }} @php $grandTotal = $grand_total + $ride_detail->surge_amount @endphp {{ getPriceFormat($grandTotal) }}

{{ __('message.note_pdf_report') }}
{{ __('message.tip_not_include') }}