@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 ?? '' }} {{$booking->customer->last_name ?? '' }}
Address:
{{$booking->customer->address_one ?? '' }} {{$booking->customer->address_two ?? '' }}
Email:
{{$booking->customer->email ?? '' }}
Phone:
{{$booking->customer->mobile_no ?? '' }}
NIC / Passport:
{{$booking->customer->national_id ?? '' }}
Country:
{{$booking->customer->country ?? '' }}
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}}
| No |
Date |
Amount |
@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
| {{$key + 1}} |
{{ date('Y-m-d', strtotime($single_room->created_at)) }} |
{{number_format($total + $complementary, 2)}} |
@endforeach
@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;
$due_order = 0;
if(isset($booking) && isset($booking->contact_id)) {
try {
// Simple query to get due orders for this customer
$due_order = DB::table('transactions')
->where('type', 'order')
->where('status', 'final')
->where('contact_id', $booking->contact_id)
->where('payment_status', 'paid')
->where('is_include', 1)
->where('hotel_transaction_id', $booking->transaction_id)
->sum('final_total');
\Log::info('Blade SIMPLE: Due order calculated: ' . $due_order);
} catch (\Exception $e) {
\Log::error('Blade SIMPLE: Error: ' . $e->getMessage());
$due_order = 0;
}
}
@endphp
| Room Rent Amt. |
{{ number_format($total_rent,2) }} |
| Discount Amt. |
{{ number_format($discount, 2) }} |
@if($booking->additional_note)
| {{$booking->additional_note}} |
{{ $booking->additional_charge ?? '0.00' }} |
@endif
| 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' }} |
| Rest Orders. |
{{ $due_order > 0 ? number_format($due_order, 2) : '0.00' }} |
| Total Amt. |
{{ number_format($total_payable_aft_dis + $complementary + $due_order + $expenses->sum('final_total'), 2)}} |
Bank Details
Account Name: Sabari Hotel & Restaurant (PVT) Ltd
Account No: 1001022862
Swift Code: CCEYLKLX
Bank Name & Code: Commercial Bank of Ceylon PLC (7056)
Branch Name & Code: Achchuvely Branch (156)