{{-- resources/views/invoicing/show.blade.php --}} @extends('layouts.app') @section('title', 'Invoice ' . $invoice->invoice_number) @section('page_title', $invoice->invoice_number) @section('page_subtitle', 'Invoice details') @section('content') @php $sc = [ 'draft' => ['bg'=>'#f1f5f9','color'=>'#475569'], 'issued' => ['bg'=>'#dbeafe','color'=>'#1e40af'], 'partially_paid' => ['bg'=>'#fef3c7','color'=>'#92400e'], 'paid' => ['bg'=>'#d1fae5','color'=>'#065f46'], 'overdue' => ['bg'=>'#fee2e2','color'=>'#991b1b'], 'cancelled' => ['bg'=>'#f1f5f9','color'=>'#9ca3af'], 'written_off' => ['bg'=>'#f1f5f9','color'=>'#9ca3af'], ][$invoice->status] ?? ['bg'=>'#f1f5f9','color'=>'#475569']; @endphp
← Invoices {{ strtoupper(str_replace('_', ' ', $invoice->status)) }}
PDF @if($invoice->status === 'draft')
@csrf
Edit
@csrf @method('DELETE')
@endif @if(in_array($invoice->status, ['issued', 'partially_paid', 'overdue']))
@csrf
@csrf
@endif
{{-- Invoice --}}
{{-- Header --}}
{{ tenant()->name }}
{{ tenant()->address_line1 }} @if(tenant()->city) · {{ tenant()->city }} @endif
@if(tenant()->phone)
{{ tenant()->phone }}
@endif
INVOICE
{{ $invoice->invoice_number }}
{{-- Bill To / Invoice Info --}}
Bill To
@if($invoice->guest)
{{ $invoice->guest->first_name }} {{ $invoice->guest->last_name }}
@if($invoice->guest->email)
{{ $invoice->guest->email }}
@endif @if($invoice->guest->phone)
{{ $invoice->guest->phone }}
@endif @elseif($invoice->company)
{{ $invoice->company->name }}
@if($invoice->company->email)
{{ $invoice->company->email }}
@endif @else
No billing contact
@endif
Invoice Date {{ $invoice->invoice_date->format('d M Y') }}
Due Date {{ $invoice->due_date->format('d M Y') }}
Currency {{ $invoice->currency }}
{{-- Line Items --}} @foreach($invoice->items->sortBy('sort_order') as $item) @endforeach
Description Qty Unit Price Tax Total
{{ $item->description }} @if($item->item_type && $item->item_type !== 'service') {{ ucfirst($item->item_type) }} @endif {{ $item->quantity }} {{ number_format($item->unit_price, 2) }} @if($item->tax_rate > 0) {{ $item->tax_rate }}% @else — @endif {{ number_format($item->total_price, 2) }}
{{-- Totals --}}
Subtotal {{ $invoice->currency }} {{ number_format($invoice->subtotal, 2) }}
@if($invoice->tax_amount > 0)
Tax {{ $invoice->currency }} {{ number_format($invoice->tax_amount, 2) }}
@endif @if($invoice->discount_amount > 0)
Discount -{{ $invoice->currency }} {{ number_format($invoice->discount_amount, 2) }}
@endif
TOTAL {{ $invoice->currency }} {{ number_format($invoice->total_amount, 2) }}
@if($invoice->amount_paid > 0)
Amount Paid {{ $invoice->currency }} {{ number_format($invoice->amount_paid, 2) }}
BALANCE DUE {{ $invoice->currency }} {{ number_format($invoice->balance_due, 2) }}
@endif
{{-- Notes --}} @if($invoice->notes)
Notes
{{ $invoice->notes }}
@endif @if($invoice->terms)
Terms & Conditions
{{ $invoice->terms }}
@endif
{{-- Right Sidebar --}}
{{-- Payment History --}}
Payments
@if($invoice->payments->isEmpty())

No payments yet

@else
@foreach($invoice->payments->sortByDesc('paid_at') as $payment)
{{ $invoice->currency }} {{ number_format($payment->amount, 2) }}
{{ ucfirst(str_replace('_', ' ', $payment->payment_method)) }} @if($payment->transaction_reference) · {{ $payment->transaction_reference }} @endif
{{ $payment->paid_at?->format('d M Y') }}
Receipt →
@endforeach
@endif
{{-- Credit Notes --}} @if($invoice->creditNotes->count() > 0)
Credit Notes
@foreach($invoice->creditNotes as $cn)
{{ $cn->reference }}
{{ $cn->currency }} {{ number_format($cn->amount, 2) }} · {{ $cn->status }}
@endforeach
@endif {{-- Linked reservation --}} @if($invoice->billable_type === \App\Models\Reservation::class && $invoice->billable)
Linked Reservation
{{ $invoice->billable->reference }}
{{ $invoice->billable->check_in_date->format('d M Y') }} → {{ $invoice->billable->check_out_date->format('d M Y') }}
View Reservation →
@endif {{-- Write off --}} @if(in_array($invoice->status, ['issued','partially_paid','overdue']))
@csrf
@endif
{{-- Payment Modal --}} @if(in_array($invoice->status, ['issued','partially_paid','overdue'])) @endif @endsection