|
@php
$logoSrc = null;
$logoVal = $settings->hotel_logo ?? '';
if (!empty($logoVal)) {
if (preg_match('/^https?:\\/\\//i', $logoVal)) {
$logoSrc = $logoVal;
} else {
$diskPath = \Illuminate\Support\Facades\Storage::disk('public')->path($logoVal);
if (is_file($diskPath)) {
$mime = @mime_content_type($diskPath) ?: 'image/png';
$data = @file_get_contents($diskPath);
if ($data !== false) {
$logoSrc = 'data:' . $mime . ';base64,' . base64_encode($data);
}
}
if (!$logoSrc) {
$logoSrc = asset(\Illuminate\Support\Facades\Storage::url($logoVal));
}
}
}
@endphp
@if($logoSrc)
@if($settings)
{{ $settings->hotel_address }}
{{ $settings->hotel_phone }} | {{ $settings->hotel_email }}
@endif
|
INVOICE# {{ $invoice->invoice_number }}
{{ $invoice->created_at->format('d F Y') }}
@if(($invoice->non_refundable ?? false) || (!empty($invoice->notes) && preg_match('/non[- ]?refund/i', $invoice->notes)))
NON-REFUNDABLE
@endif
|
|
Bill To:
{{ $invoice->guest_name }}
@php
$companyName = null;
$notesSrc = trim((string)($invoice->notes ?? ''));
if ($notesSrc !== '' && stripos($notesSrc, 'Perusahaan:') !== false) {
$seg = explode('Perusahaan:', $notesSrc)[1] ?? '';
$companyName = trim(explode('|', $seg)[0] ?? '');
}
if (!$companyName && $invoice->booking && !empty($invoice->booking->special_requests)) {
$sr = (string)$invoice->booking->special_requests;
if ($sr !== '' && stripos($sr, 'Perusahaan:') !== false) {
$seg = explode('Perusahaan:', $sr)[1] ?? '';
$companyName = trim(explode('|', $seg)[0] ?? '');
}
}
if (!$companyName && $invoice->booking && $invoice->booking->guest && !empty($invoice->booking->guest->notes)) {
$gn = (string)$invoice->booking->guest->notes;
if ($gn !== '' && stripos($gn, 'Perusahaan:') !== false) {
$seg = explode('Perusahaan:', $gn)[1] ?? '';
$companyName = trim(explode('|', $seg)[0] ?? '');
}
}
@endphp
@if(!empty($companyName))
{{ $companyName }}
@endif
{{ $invoice->guest_email }}
@if($invoice->guest_phone)
{{ $invoice->guest_phone }}
@endif
|
Booking Details:
@if($invoice->booking_id)
Booking ID: {{ optional($invoice->booking)->booking_code ?? 'N/A' }}
@endif
@php
$bookingGuestName = optional(optional($invoice->booking)->guest)->name ?? optional($invoice->booking)->guest_name;
@endphp
@if($bookingGuestName && ($bookingGuestName !== $invoice->guest_name))
Guest: {{ $bookingGuestName }}
@endif
Check-in: {{ $invoice->check_in_date->format('d/m/Y') }}
Check-out: {{ $invoice->check_out_date->format('d/m/Y') }}
Duration: {{ $invoice->nights }} {{ $invoice->nights > 1 ? 'nights' : 'night' }}
@if($invoice->paymentChannel)
Payment Method: {{ $invoice->paymentChannel->name }}
@endif
@if($invoice->paid_at)
Paid At: {{ $invoice->paid_at->format('d/m/Y H:i') }}
@endif
{{ ucfirst($invoice->status ?? 'Draft') }}
|
| Description | {{ ($invoice->booking->booking_type ?? 'room') === 'ballroom' ? 'Ballroom' : 'Room' }} | {{ ($invoice->booking->booking_type ?? 'room') === 'ballroom' ? 'Days' : 'Nights' }} | Rate | Amount |
|---|---|---|---|---|
|
{{ $roomTypeDisp }} Room
{{ \Carbon\Carbon::parse($minDate)->format('d M Y') }} - {{ \Carbon\Carbon::parse($maxDate)->format('d M Y') }}
|
{{ $roomNumberDisp }} | {{ $nightsMerged }} | Rp {{ number_format($ratePerNightMerged, 0, ',', '.') }} | Rp {{ number_format($combinedSubtotal, 0, ',', '.') }} |
|
{{ $name }} Room
@if(!empty($item['start']) && !empty($item['end']))
{{ \Carbon\Carbon::parse($item['start'])->format('d M Y') }} - {{ \Carbon\Carbon::parse($item['end'])->format('d M Y') }}
@endif
|
{{ $roomDisplay }} | {{ $item['nights'] }} | Rp {{ number_format($item['rate'], 0, ',', '.') }} | Rp {{ number_format($item['subtotal'], 0, ',', '.') }} |
|
{{ ($invoice->booking->room->roomType->name ?? $invoice->room_type) }} Room
{{ $invoice->check_in_date->format('d M Y') }} - {{ $invoice->check_out_date->format('d M Y') }}
|
{{ $invoice->room_number }} | {{ $invoice->nights }} | @php $ratePerNight = (int) ($invoice->room_rate ?? (((($invoice->nights ?? 1) > 0) ? (int) (($invoice->subtotal ?? 0) / ($invoice->nights ?? 1)) : (int) ($invoice->subtotal ?? 0)))); @endphpRp {{ number_format($ratePerNight, 0, ',', '.') }} | Rp {{ number_format($invoice->subtotal, 0, ',', '.') }} |
| Room Service - {{ $service->service_name }} | - | {{ $service->quantity }} | Rp {{ number_format($service->unit_price, 0, ',', '.') }} | Rp {{ number_format($service->total_price, 0, ',', '.') }} |
| Total Included Tax: | Rp {{ number_format($totalInclude, 0, ',', '.') }} |
| Card Charge: | Rp {{ number_format($cardCharge, 0, ',', '.') }} |
| Total: | Rp {{ number_format($finalTotal, 0, ',', '.') }} |
| Tax Included: | Rp {{ number_format($computedTax, 0, ',', '.') }} |