|
@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);
}
}
}
}
@endphp
@if($logoSrc)
{{ strtoupper($settings->hotel_name ?? 'Lumbu Hotel') }}
@endif
@if($settings)
{{ $settings->hotel_address }}
{{ $settings->hotel_phone }} | {{ $settings->hotel_email }}
@endif
|
INVOICE# {{ $invoice->invoice_number }}
{{ optional($invoice->issued_at ?? $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 }}
@php
$guestAddress = '';
if (!empty($invoice->guest_address ?? '')) {
$guestAddress = $invoice->guest_address;
} elseif ($invoice->booking && $invoice->booking->guest && !empty($invoice->booking->guest->address)) {
$guestAddress = $invoice->booking->guest->address;
} elseif (!empty($invoice->notes)) {
if (preg_match('/Alamat:\s*([^|]+)/i', (string)$invoice->notes, $am)) {
$guestAddress = trim($am[1] ?? '');
}
}
@endphp
@if(!empty($guestAddress))
{{ $guestAddress }}
@endif
@if($invoice->guest_phone)
{{ $invoice->guest_phone }}
@endif
@php
$guestNationality = '';
if (!empty($invoice->guest_nationality ?? '')) {
$guestNationality = $invoice->guest_nationality;
} elseif ($invoice->booking && $invoice->booking->guest && !empty($invoice->booking->guest->nationality)) {
$guestNationality = $invoice->booking->guest->nationality;
}
@endphp
@if(!empty($guestNationality))
{{ $guestNationality }}
@endif
|
Details:
@php
$isWalkinBooking = strtolower(trim((string) optional($invoice->booking)->booking_source)) === 'walkin';
@endphp
@if($invoice->booking_id && !$isWalkinBooking)
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
@php
$durationNights = (int) ($invoice->nights ?? 0);
if ($durationNights <= 0) {
$durationStart = optional($invoice->booking)->check_in_date ?? $invoice->check_in_date;
$durationEnd = optional($invoice->booking)->check_out_date ?? $invoice->check_out_date;
if ($durationStart && $durationEnd) {
$durationNights = \Carbon\Carbon::parse($durationStart)->diffInDays(\Carbon\Carbon::parse($durationEnd));
}
$durationNights = max(1, (int) $durationNights);
}
@endphp
Check-in: {{ $invoice->check_in_date->format('d/m/Y') }}
Check-out: {{ $invoice->check_out_date->format('d/m/Y') }}
Duration: {{ $durationNights }} {{ $durationNights > 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') }}
@endif
{{ ucfirst($invoice->status ?? 'Draft') }}
|
| Description | {{ ($invoice->booking->booking_type ?? 'room') === 'ballroom' ? 'Ballroom' : 'Room' }} | {{ ($invoice->booking->booking_type ?? 'room') === 'ballroom' ? 'Days' : 'Nights' }} | Rate | Discount | Amount |
|---|---|---|---|---|---|
|
{{ $typeLabel }} Room
@if(!empty($inv->check_in_date) && !empty($inv->check_out_date))
{{ \Carbon\Carbon::parse($inv->check_in_date)->format('d M Y') }} - {{ \Carbon\Carbon::parse($inv->check_out_date)->format('d M Y') }}
@endif
|
{{ $roomNumberDisp }} | {{ $nightsMerged }} | Rp {{ number_format($ratePerNightMerged, 0, ',', '.') }} | {{ number_format($lineDiscountPercent, 2, ',', '.') }}% | Rp {{ number_format($combinedSubtotal, 0, ',', '.') }} |
| Room Service - {{ $displayService['name'] }} | - | {{ $displayService['qty'] }} | Rp {{ number_format($displayService['unit'], 0, ',', '.') }} | 0% | Rp {{ number_format($displayService['total'], 0, ',', '.') }} |
| Room Service - {{ $displayService['name'] }} | - | {{ $displayService['qty'] }} | Rp {{ number_format($displayService['unit'], 0, ',', '.') }} | 0% | Rp {{ number_format($displayService['total'], 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, ',', '.') }} | {{ number_format($invoiceDiscountPercent, 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)))); if ($hasOverrideMarker && (int) ($invoice->nights ?? 0) > 0) { $ratePerNight = (int) round((int) ($invoice->subtotal ?? 0) / (int) $invoice->nights); } $singleEstimatedBase = (int) ($ratePerNight * (int) ($invoice->nights ?? 0)); $singleDiscount = $effectiveDiscountAmount > 0 ? $effectiveDiscountAmount : max(0, $singleEstimatedBase - (int) ($invoice->subtotal ?? 0)); $singleLineAmount = $isNonStayInvoice ? max(0, (int) ($invoice->subtotal ?? 0) - (int) $effectiveDiscountAmount) : (int) ($invoice->subtotal ?? 0); @endphpRp {{ number_format($ratePerNight, 0, ',', '.') }} | {{ number_format($invoiceDiscountPercent, 0, ',', '.') }}% | Rp {{ number_format($singleLineAmount, 0, ',', '.') }} |
| Room Service - {{ $displayService['name'] }} | - | {{ $displayService['qty'] }} | Rp {{ number_format($displayService['unit'], 0, ',', '.') }} | 0% | Rp {{ number_format($displayService['total'], 0, ',', '.') }} |
| Room Service - {{ $displayService['name'] }} | - | {{ $displayService['qty'] }} | Rp {{ number_format($displayService['unit'], 0, ',', '.') }} | 0% | Rp {{ number_format($displayService['total'], 0, ',', '.') }} |
| Tax Included: | Rp {{ number_format($computedTax, 0, ',', '.') }} |
| Discount: | - Rp {{ number_format($effectiveDiscountAmount, 0, ',', '.') }} |
| Total Included Tax: | Rp {{ number_format($totalInclude, 0, ',', '.') }} |
| Card Charge{{ $chargePercent > 0 ? ' (' . number_format($chargePercent, 0, ',', '.') . '%)' : '' }}: | Rp {{ number_format($cardCharge, 0, ',', '.') }} |
|
Total:
Terbilang: {{ $terbilangTotal }}
|
Rp {{ number_format($finalTotal, 0, ',', '.') }} |
|
Pembayaran dapat transfer melalui Bank Mandiri a.n PT. Lumbu Hotel Cabang Sangatta No. Rek: 148 001 257 3542
Terimakasih sudah menginap di Hotel Lumbu.
Semoga Anda puas dengan pelayanan kami dan kembali menginap disini.
Syarat dan Ketentuan:
|
Payment Information:
Payment Method: {{ $invoice->paymentChannel->name }}
@if($invoice->paymentChannel->description)
{{ $invoice->paymentChannel->description }}
@endif
@if(is_array($invoice->paymentChannel->settings) && count($invoice->paymentChannel->settings) > 0)
@foreach($invoice->paymentChannel->settings as $key => $val)
{{ $key === 'charge_percent' ? 'Card Charge' : ucwords(str_replace('_', ' ', $key)) }}:
{{ e($val) }}{{ $key === 'charge_percent' ? '%' : '' }}
@if(!$loop->last) | @endif
@endforeach
@endif
@endif
@if($invoice->paid_at)
Payment Date: {{ $invoice->paid_at->format('d F Y') }}
✓ PAID
@else
⚠ UNPAID
|