@php $bussiness = App\Models\Business::first(); @endphp

{{ isset($bussiness) && isset($bussiness->name) ? $bussiness->name : 'Hotel Management' }}

@if(isset($bussiness)) @if(isset($bussiness->address)) {{$bussiness->address}} @endif @if(isset($bussiness->address_two)) , {{$bussiness->address_two}}
@endif @if(isset($bussiness->city)) {{$bussiness->city}}
@endif @if(isset($bussiness->country)) {{$bussiness->country}}
@endif @if(isset($bussiness->mobile)) {{$bussiness->mobile}} @endif @if(isset($bussiness->phone)) ,{{$bussiness->phone}} @endif @endif

@php $startTimeStamp = strtotime($booking->check_in_at); $endTimeStamp = strtotime($booking->check_out_at); $timeDiff = abs($endTimeStamp - $startTimeStamp); $hour = request()->session()->get('business.day_duration') ?? 24; $numberDays = $timeDiff/($hour * 60 * 60); $discount = 0; $no_of_days = round($numberDays) < $numberDays ? round($numberDays) + 1 : round($numberDays); $total_rent = $room->sum('rent'); if($booking->discount_type == 'percentage') { $discount = $booking->discount_amount/100 * $total_rent; } else { $discount = $booking->discount_amount; } $total_payable_aft_dis = $total_rent - $discount + $booking->servise_charge; @endphp

Ref No : {{ $booking->ref_no ?? '' }}
Booking Date : {{ $booking->created_at ?? '' }}
Customer : {{$booking->customer->first_name ?? '' }}
Address : {{$booking->customer->address ?? '' }}
Email : {{$booking->customer->email ?? '' }}
Phone : {{$booking->customer->contact_no ?? '' }}

Checkin At : {{ $booking->check_in_at ?? '' }}
Checkout At : {{ $booking->check_out_at ?? '' }}
Room No : {!! $result !!}
Status : INVOICED
No of Rooms : {{$room->count()}}
Days : {{$no_of_days}}

@foreach($room as $key => $single_room) @php $total = $single_room->rent + $single_room->bed_amount + $single_room->person_amount + $single_room->child_amount ; $com_rate = App\Models\Complementary::where('id', $single_room->complementry_id)->sum('rate'); $complementary_amount = $single_room->number; $complementary = $com_rate * $complementary_amount; @endphp @endforeach
No Date Amount
{{$key + 1}} {{ date('Y-m-d', strtotime($single_room->created_at)) }} {{number_format($total + $complementary, 2)}}
@php $startTimeStamp = strtotime($booking->check_in_at); $endTimeStamp = strtotime($booking->check_out_at); $timeDiff = abs($endTimeStamp - $startTimeStamp); $hour = request()->session()->get('business.day_duration') ?? 24; $numberDays = $timeDiff/($hour * 60 * 60); $discount = 0; $no_of_days = round($numberDays) < $numberDays ? round($numberDays) + 1 : round($numberDays); $total_rent = $room->sum('rent'); if($booking->discount_type == 'percentage') { $discount = $booking->discount_amount/100 * $total_rent; } else { $discount = $booking->discount_amount; } $total_payable_aft_dis = $total_rent - $discount + $booking->servise_charge; $comIds = $room->pluck('complementry_id')->toArray(); $com_rate = App\Models\Complementary::whereIn('id', $comIds)->sum('rate'); $complementary_amount = $room->sum('number'); $complementary = $com_rate * $complementary_amount; @endphp
@if($booking->additional_note) @endif
Room Rent Amt. {{ number_format($total_rent,2) }}
Discount Amt. {{ number_format($discount, 2) }}
{{$booking->additional_note}} {{ $booking->additional_charge ?? '0.00' }}
Total Room Rent Amt. {{ number_format($total_payable_aft_dis, 2) }}
Complementary Amt. {{ number_format($complementary,2)}}
Room Expense. {{ $expenses->sum('final_total') > 0 ? number_format($expenses->sum('final_total'), 2) : '0.00' }}
Total Amt. {{ number_format($total_payable_aft_dis + $complementary + $expenses->sum('final_total'), 2)}}