@use('App\Helpers\Helpers') @php $currency = Helpers::getDefaultCurrency()?->symbol; $addons = $booking?->additional_services ?? collect(); $addonsChargeAmount = $addons->sum(fn($a) => $a->pivot?->total_price ?? (($a->pivot?->price ?? 0) * ($a->pivot?->qty ?? 1))); @endphp {{ env('APP_NAME') }}

{{ __('static.booking.invoice') }}

{{ __('static.booking.order_id_title') }} {{$booking?->booking_number}}

{{ __('static.booking.order_date_title') }} {{$booking?->created_at->format("d/m/Y")}}

{{ __('static.booking.payment_method_title') }} {{$booking?->payment_method}}

{{ __('static.booking.customer_address') }}

{{$booking?->consumer?->getPrimaryAddressAttribute()?->area}}

{{$booking?->consumer?->getPrimaryAddressAttribute()?->postal_code}},

{{$booking?->consumer?->getPrimaryAddressAttribute()?->city}},

{{$booking?->consumer?->getPrimaryAddressAttribute()?->state?->name}}, {{$booking?->consumer?->getPrimaryAddressAttribute()?->country?->name}}

Contact: ({{$booking?->consumer?->code}}) {{$booking?->consumer?->phone}}

Customer Name: {{$booking?->consumer?->name}}

{{-- Inline Add-ons --}} @if($addons->count() > 0) @endif
{{ __('static.booking.invoice_no') }} {{ __('static.booking.invoice_service_name') }} {{ __('static.booking.invoice_price') }} {{ __('static.booking.invoice_per_serviceman_charge') }} {{ __('static.booking.invoice_extra_charge') }} {{ __('static.booking.invoice_platform_fees') }} {{ __('static.booking.invoice_subtotal') }} {{ __('static.booking.invoice_grand_total') }}
1 {{$booking?->service?->title}} {{$booking?->service_price}} {{$booking?->per_serviceman_charge}} {{ $booking?->extra_charges->isNotEmpty() ? $booking?->extra_charges->sum('total') : '0.00' }} {{$booking?->platform_fees}} {{$booking?->subtotal}} {{ $booking?->extra_charges->isNotEmpty() ? $booking?->subtotal + $booking?->tax + $booking?->extra_charges->sum('total') : $booking?->subtotal + $booking?->tax }}

{{ __('static.booking.invoice_add_ons') }}

@foreach($addons as $index => $addon) @php $qty = $addon->pivot?->qty ?? 1; $price = $addon->pivot?->price ?? 0; $total = $addon->pivot?->total_price ?? ($qty * $price); @endphp

{{ $index + 1 }}. {{ $addon->title ?? '-' }} — {{ $qty }} × {{ $currency }}{{ number_format($price, 2) }} = {{ $currency }}{{ number_format($total, 2) }}

@endforeach

{{ __('static.booking.invoice_sub_total') }}

{{ __('static.booking.invoice_tax') }}

{{ __('static.booking.invoice_platform_fees') }}

{{ __('static.booking.invoice_extra_charge') }}

{{ __('static.booking.invoice_add_ons') }}

{{ __('static.booking.invoice_total_payable') }}

{{ $currency }}{{$booking?->subtotal}}

{{ $currency }}{{$booking?->tax}}

{{ $currency }}{{$booking?->platform_fees}}

{{ $currency }}{{ $booking?->extra_charges?->sum('total') ?? 0 }}

{{ $currency }}{{ number_format($addonsChargeAmount, 2) }}

{{ $currency }}{{ number_format($booking?->total + ($booking?->extra_charges?->sum('total') ?? 0) + $addonsChargeAmount, 2) }}