{{optional($companyName)->value }}

{{__('message.contact_number')}}: {{ optional($companynumber)->value }}
{{__('message.invoice_no')}} {{ optional($order)->id }}
{{__('message.invoice_date')}} {{ $today }}
{{__('message.order_date')}} {{date('d/m/Y', strtotime($order->created_at)) }}
{{__('message.pickup_from')}}
{{ $order->pickup_point['address'] }}
{{__('message.deliverd_to')}}
{{ $order->delivery_point['address'] }}
{{__('message.payment_via').''.':'}} {{ ucfirst(optional($order->payment)->payment_type) }} {{__('message.payment_date').''.':'}} {{ date('d/m/Y', strtotime($order->payment->created_at ?? null)) }}
@if($order->bid_type == 0) @if(!is_null($order->vehicle_charge) && $order->vehicle_charge > 0) @endif @if(!is_null($order->insurance_charge) && $order->insurance_charge > 0) @endif @endif @php $extra_charges_values = []; $grand_total = 0; $service_class = 'd-none'; $percentage = 0; $extra_charges_texts = []; if($order->bid_type == 0){ $sub_total = $order->fixed_charges + $order->distance_charge + $order->weight_charge + $order->vehicle_charge + $order->insurance_charge ; }else{ $sub_total = $order->total_amount; } if(is_array($order->extra_charges)){ foreach($order->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); } 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 ($order->extra_charges as $item) { if (in_array($item['value_type'], ['percentage', 'fixed'])) { if ($item['value_type'] == 'percentage') { $values[] = $sub_total * $item['value'] / 100; } elseif ($item['value_type'] == 'fixed') { $values[] = $item['value']; } } } $percentage = array_sum($values); } } @endphp
{{__('message.description')}} ({{ optional($order)->parcel_type }}) {{__('message.price')}}
{{__('message.delivery_charges')}} {{ getPriceFormat($order->fixed_charges) }}
{{__('message.distance_charge')}} {{ getPriceFormat($order->distance_charge) }}
{{__('message.weight_charge')}} {{ getPriceFormat($order->weight_charge) }}
{{ __('message.vehicle_charge') }} {{ getPriceFormat($order->vehicle_charge) }}
{{__('message.insurance_charge')}} {{ getPriceFormat($order->insurance_charge) }}
@if($order->extra_charges != null) @foreach ($extra_charges_texts as $index => $text) @endforeach @else @endif
{{__('message.sub_total')}} {{ getPriceFormat($sub_total) }}
{{ $text }} {{ $extra_charges_values[$index] }}
{{__('message.total')}} {{ getPriceFormat($percentage + $sub_total) ?? getPriceFormat($sub_total) }}

{{ __('message.address') . ':' }}

{{ optional($companyAddress)->value }}

{{ __('message.notes') . ':' }} {{ __('message.this_report_was_generated_by_a_computer_and_does_not_require_a_signature_or_company_stamp_to_be_considered_valid') }}