Resort Invoice

Invoice Number: {{ $invoice->slug }}

Date: {{ $invoice->created_at->format('d M Y') }}

Guest Name: {{ $invoice->guest->name }}

Contact: {{ $invoice->guest->phone }}

@if ($invoice->booking) @php $checkIn = \Carbon\Carbon::parse($invoice->booking->check_in_date); $checkOut = \Carbon\Carbon::parse($invoice->booking->check_out_date); $nights = $checkIn->diffInDays($checkOut); $room = $invoice->booking->room; $roomType = $room->roomType; $roomRate = $roomType->base_price; $roomTotal = $nights * $roomRate; $roomTax = $roomTotal * 0.18; $roomCgst = $roomTax / 2; $roomSgst = $roomTax / 2; @endphp

Room: {{ $room->room_number }} ({{ $roomType->name }})

Check-in: {{ $checkIn->format('d M Y') }}

Check-out: {{ $checkOut->format('d M Y') }}

Nights: {{ $nights }}

@endif

Invoice Items

@php $subTotal = 0; $cgstTotal = 0; $sgstTotal = 0; $grandTotal = 0; $i = 1; @endphp @if ($invoice->booking) @php $subTotal += $roomTotal; $cgstTotal += $roomCgst; $sgstTotal += $roomSgst; $total = $roomTotal + $roomTax; $grandTotal += $total; @endphp @endif @foreach ($invoice->items as $item) @php $amount = $item->quantity * $item->unit_price; $tax = $amount * 0.18; $cgst = $tax / 2; $sgst = $tax / 2; $total = $amount + $tax; $subTotal += $amount; $cgstTotal += $cgst; $sgstTotal += $sgst; $grandTotal += $total; @endphp @endforeach
# Item Type Qty Rate Amount CGST SGST Total
{{ $i++ }} Room Rent Room {{ $nights }} {{ number_format($roomRate, 2) }} {{ number_format($roomTotal, 2) }} {{ number_format($roomCgst, 2) }} {{ number_format($roomSgst, 2) }} {{ number_format($total, 2) }}
{{ $i++ }} {{ $item->item->name }} {{ ucfirst($item->item->type) }} {{ $item->quantity }} {{ number_format($item->unit_price, 2) }} {{ number_format($amount, 2) }} {{ number_format($cgst, 2) }} {{ number_format($sgst, 2) }} {{ number_format($total, 2) }}
Subtotal {{ number_format($subTotal, 2) }} {{ number_format($cgstTotal, 2) }} {{ number_format($sgstTotal, 2) }} {{ number_format($grandTotal, 2) }}