{{__('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($ride_detail->multi_drop_location)) @php $multiDropLocations = json_decode($ride_detail->multi_drop_location, true); @endphp @if(is_array($multiDropLocations)) @else @endif @endif --}}
{{__('message.pickup_address')}} :
{{__('message.drop_address')}}
{{ $ride_detail->start_address }} {{ $ride_detail->end_address }}
{{__('message.drop_location') . 's'}} :

@foreach($multiDropLocations as $key => $item) {{ $item['address'] ?? '-' }} - {{ __('message.dropped_at') }}: {{ date('d/m/Y H:i', strtotime($item['dropped_at'])) ?? '-' }}
@endforeach

{{ __('message.no_multi_drop_location') }}
{{ __('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($fixed_charge) }}
@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') }} {{ getPriceFormat($ride_detail->approvedBids->bid_amount) }}
{{ __('message.sub_total') }} @php $subTotal = $sub_total + ($fixed_charge ? $fixed_charge : 0) @endphp {{ getPriceFormat($subTotal) }}
{{ $text }} {{ $extra_charges_values[$index] }}
{{ __('message.total') }} @php $grandTotal = $grand_total + ($fixed_charge ? $fixed_charge : 0) @endphp {{ getPriceFormat($grandTotal) }}

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