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

@php // Get the logo URL from your existing function $logoUrl = getSingleMedia(appSettingData('get'),'site_logo',null); // Convert it to a public path $relativePath = str_replace(url('/'), '', $logoUrl); $logoPath = public_path($relativePath); $extra_charges_texts = []; // Convert to base64 $logoType = pathinfo($logoPath, PATHINFO_EXTENSION); $logoData = file_exists($logoPath) ? base64_encode(file_get_contents($logoPath)) : ''; $logoSrc = $logoData ? 'data:image/' . $logoType . ';base64,' . $logoData : ''; @endphp {{ __('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') }}
@if($user_type == 'admin') @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 @elseif($user_type == 'rider') @elseif($user_type == 'driver') @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_fare') }} {{ getPriceFormat($ride_detail->per_distance_charge) }}
{{ __('message.time_fare') }} {{ getPriceFormat($ride_detail->per_minute_time_fare_charge) }}
{{ __('message.time_idling') }} {{ 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 {{ getPriceFormat($extra_charges) }} @else {{ getPriceFormat($ride_detail->extra_charges_amount) }} @endif
{{ __('message.company_fee') }} {{ getPriceFormat($ride_detail->company_fee_charge) }}
{{ __('message.expenses_charge') }} {{ getPriceFormat($ride_detail->expenses_charge) }}
{{ __('message.coupon_discount') }} -{{ getPriceFormat($ride_detail->coupon_discount) }}
{{ __('message.credits_used') }} {{ getPriceFormat($ride_detail->credit_used) }}
{{ __('message.fixed_charges') }} ({{ __('message.surge_price') }}) {{ getPriceFormat($fixed_charge) }}
{{ __('message.ride_amount') }} @php $sub_total = $ride_detail->subtotal; $subTotal = $sub_total + ($ride_detail->coupon_discount ? $ride_detail->coupon_discount : 0); $subTotal = $subTotal; @endphp {{ getPriceFormat($subTotal) }}
{{ __('message.coupon_discount') }} {{ getPriceFormat($ride_detail->coupon_discount) }}
{{ __('message.tips') }} {{ getPriceFormat($ride_detail->tips) }}
{{ __('message.passenger_payment') }} @php $sub_total = $ride_detail->subtotal + $ride_detail->coupon_discount; //$subTotal = $sub_total + ($fixed_charge ? $fixed_charge : 0) $subTotal = $sub_total; @endphp {{ getPriceFormat($subTotal) }}
{{ __('message.external_fees') }} {{ getPriceFormat($ride_detail->expenses_charge) }}
{{ __('message.wayvers_fees') }} {{ getPriceFormat($ride_detail->company_fee_charge) }}
{{ __('message.driver_earning') }} {{ getPriceFormat($ride_detail->payment->driver_fee) }}
@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) $subTotal = $sub_total; @endphp {{ getPriceFormat($subTotal) }}
{{ $text }} {{ $extra_charges_values[$index] }}
{{ __('message.total') }} @php //$sub_total = $ride_detail->subtotal; $grand_total = $sub_total; //$grandTotal = $grand_total + ($fixed_charge ? $fixed_charge : 0) $grandTotal = $grand_total; @endphp {{ getPriceFormat($grandTotal) }}

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