@extends('backend.layouts.app') @section('title') {{ __($module_title) }} @endsection @section('content')
logo
{{ __('booking.download_invoice') }} {{ setting('inv_prefix') }}{{ $data->booking->resource->id }}
{{ __('booking.invoice_data') }}: {{ date('d M, Y', strtotime($data->booking->resource->created_at)) }}
{{ __('booking.invoice_time') }}: {{ date('h:m:s', strtotime($data->booking->resource->created_at)) }}
{{ __('booking.customer_info') }}
@php $user = optional(optional($data->booking)->resource)->user; $fullName = isset($user->full_name) && trim($user->full_name) !== '' ? $user->full_name : '-'; $email = isset($user->email) && trim($user->email) !== '' ? $user->email : '-'; $mobile = isset($user->mobile) && trim($user->mobile) !== '' ? $user->mobile : '-'; @endphp

{{ __('booking.name') }}: {{ $fullName }}

{{ __('booking.email') }}: {{ $email }}

{{ __('booking.phone') }}: {{ $mobile }}

@if ($data->booking_transaction)
{{ __('Payment Details') }}
{{--
{{ __('Payment ID:') }} {{ optional($data->booking_transaction)->external_transaction_id }}
--}}
{{ __('Payment Method:') }} {{ optional($data->booking_transaction)->transaction_type === 'upi' ? 'UPI' : ucwords(str_replace('_', ' ', optional($data->booking_transaction)->transaction_type)) }}
@endif
@php $employee = optional(optional($data->booking->resource)->services->first())->employee; $employeeName = isset($employee->full_name) && trim($employee->full_name) !== '' ? $employee->full_name : '-'; @endphp
{{ __('booking.lbl_staff_name') }}

{{ __('booking.name') }}: {{ $employeeName }}

@php $branch = optional($data->booking->resource->branch); $billingAddress = $branch->address; $productPrice = 0; $package_price = 0; @endphp @if($branch)
{{ __('booking.branch_name') }}

{{ $branch->name }}

{{ __('booking.billing_address') }}

{{ optional($billingAddress)->address_line_1 }}, {{ optional($billingAddress)->city }}, {{ optional($billingAddress)->state }}, {{ optional($billingAddress)->country }}

@endif
@foreach ($data->booking->resource->services as $key => $value) @endforeach @foreach ($data->booking->resource->products as $key => $value) @php $price = $value->product_price; $delPrice = false; $discountType = $value->discount_type; $discountValue = $value->discount_value . ($discountType == 'percent' ? '%' : ''); if($price != $value->discounted_price) { $delPrice = $price; $price = $value->discounted_price; } $productPrice=($price * $value->product_qty)+$productPrice @endphp @endforeach @foreach ($data->booking->resource->packages as $key => $value) @endforeach @endforeach @if($data->coupon_discount>0) @endif
{{ __('booking.services') }}/{{ __('booking.products') }} {{ __('booking.unit_price') }} {{ __('booking.qty') }} {{ __('booking.total_price') }}
{{ $value->service_name }}
{{ \Currency::format($value->service_price) }} 1 {{ \Currency::format($value->service_price) }}
{{ $value->product_name }}
{{ \Currency::format($price) }}
{{ $value->product_qty }} {{ \Currency::format($price * $value->product_qty) }}
{{ $value->name }}
{{ \Currency::format($value->package_price) }} 1 {{ \Currency::format($value->package_price) }}
{{ __('booking.sub_total') }}:
{{ \Currency::format($data->services_total_amount + $productPrice + $data->package_amount )}}
{{ __('booking.tips') }}:
{{ \Currency::format(optional($data->booking_transaction)->tip_amount) }} ({{ optional($data->booking_transaction)->tip_type === 'percent' ? 'Percent' : 'Fixed' }}) @php // Decode the tax_percentage field $taxDetails = $data->booking_transaction['tax_percentage']??[]; $serviceTotalAmount = $data->services_total_amount; @endphp @foreach($taxDetails as $tax) @php $taxAmount = 0; if ($tax['type'] == 'percent') { $taxAmount = ($serviceTotalAmount * $tax['percent']) / 100; } else { $taxAmount = $tax['tax_amount']; } @endphp
{{ $tax['name'] }}:
{{ \Currency::format($taxAmount) }} ({{ $tax['type'] === 'percent' ? 'Percent' : 'Fixed' }})
{{ __('booking.coupondiscount') }}:
{{ \Currency::format($data->coupon_discount) }}
{{ __('booking.grand_total') }}
{{ \Currency::format($data->grand_total) }}
@endsection @push('after-scripts') @endpush