@extends('admin.layout') @section('title', 'Detail Invoice #' . $invoice->invoice_number) @section('content')
Informasi lengkap invoice dan booking terkait
| No. Invoice: | {{ $invoice->invoice_number }} |
| Tanggal Invoice: | {{ optional($invoice->issued_at ?? $invoice->created_at)->format('d F Y') }} |
| Tanggal Jatuh Tempo: | @if($invoice->due_date) {{ \Carbon\Carbon::parse($invoice->due_date)->format('d F Y') }} @if($invoice->status !== 'paid' && \Carbon\Carbon::parse($invoice->due_date)->isPast()) Terlambat @endif @else Tidak ditentukan @endif |
| Status: |
| Total Amount: | @php $servicesViewTotal = (int) ($invoice->services_total ?? 0); if ($servicesViewTotal <= 0 && $invoice->booking && $invoice->booking->roomServices) { $servicesViewTotal = (int) $invoice->booking->roomServices->sum('total_price'); } $totalInclude = max(0, (int) ($invoice->subtotal ?? 0) + $servicesViewTotal - (int) ($invoice->discount_amount ?? 0)); @endphp Rp {{ number_format($totalInclude, 0, ',', '.') }} |
| Dibuat: | {{ $invoice->created_at->format('d F Y H:i') }} |
| Terakhir Update: | {{ $invoice->updated_at->format('d F Y H:i') }} |
| Tanggal Pembayaran: | @if($invoice->paid_at) {{ $invoice->paid_at->format('d F Y H:i') }} @else - @endif |
| Booking Code: | @php $bookingCode = optional($invoice->booking)->booking_code; @endphp @if($bookingCode) {{ $bookingCode }} @else N/A @endif Lihat Semua Booking |
| Nama Tamu: | {{ $invoice->guest_name }} |
| Email: | {{ $invoice->guest_email }} |
| Telepon: | {{ $invoice->guest_phone }} |
| Nama Tamu Booking: | {{ $bookingGuestName }} |
| Kamar: | {{ $invoice->room_type ?? optional(optional($invoice->booking)->room->roomType)->name ?? 'N/A' }} @php $roomNumber = $invoice->booking->room->room_number ?? $invoice->room_number ?? $invoice->booking->room->name ?? null; @endphp @if($roomNumber) - {{ $roomNumber }} @endif |
| Check-in: | {{ \Carbon\Carbon::parse($invoice->booking->check_in_date ?? $invoice->check_in_date)->format('d F Y') }} |
| Check-out: | {{ \Carbon\Carbon::parse($invoice->booking->check_out_date ?? $invoice->check_out_date)->format('d F Y') }} |
| Deskripsi | Room | Nights | Rate | Amount | @elseDeskripsi | Periode | Jumlah | @endif
|---|---|---|---|---|---|---|---|
|
@php
$baseCheckIn = $src->booking->check_in_date ?? $src->check_in_date;
$isExtendRow = (\Carbon\Carbon::parse($src->check_in_date)->toDateString() !== \Carbon\Carbon::parse($baseCheckIn)->toDateString());
$startDisp = isset($ov['start']) && $ov['start'] ? \Carbon\Carbon::parse($ov['start'])->format('d M Y') : \Carbon\Carbon::parse($src->check_in_date)->format('d M Y');
$endDisp = isset($ov['end']) && $ov['end'] ? \Carbon\Carbon::parse($ov['end'])->format('d M Y') : \Carbon\Carbon::parse($src->check_out_date)->format('d M Y');
@endphp
{{ $src->room_type ?? ($src->booking->room->roomType->name ?? 'Room') }}@if($isExtendRow) (Extend)@endif
{{ $startDisp }} - {{ $endDisp }}
|
{{ $src->room_number ?? ($src->booking->room->room_number ?? '-') }} | {{ $nights }} | Rp {{ number_format($rate, 0, ',', '.') }} | Rp {{ number_format($amount, 0, ',', '.') }} | |||
| {{ $name }} |
{{ $start }} - {{ $end }}
{{ $nights }} malam | Rate: Rp {{ number_format(($ov['rate'] ?? 0), 0, ',', '.') }} |
Rp {{ number_format($amount, 0, ',', '.') }} | |||||
|
{{ $invoice->room_type ?? ($invoice->booking->room->roomType->name ?? 'Room') }}
@if($isExtend) (Extend) @endif |
{{ \Carbon\Carbon::parse($invoice->check_in_date)->format('d M Y') }} -
{{ \Carbon\Carbon::parse($invoice->check_out_date)->format('d M Y') }}
{{ $invoice->nights ?? \Carbon\Carbon::parse($invoice->check_in_date)->diffInDays(\Carbon\Carbon::parse($invoice->check_out_date)) }} malam |
@php $roomSubtotal = $invoice->subtotal ?? round((($invoice->room_rate ?? 0) * ($invoice->nights ?? 0)), 2); @endphp Rp {{ number_format($roomSubtotal, 0, ',', '.') }} | |||||
|
Room Service - {{ $service->service_name }}
Layanan Tambahan |
Qty: {{ $service->quantity }} | 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, ',', '.') }} | ||||||