@include('Partials.sidebar')
@include('Partials.header')

{{ $invoice->typeLabel() }} #{{ $invoice->invoice_number }}

Issued {{ $invoice->issued_at->format('d M Y, h:i A') }} @if($invoice->email_sent_at)  ·  Emailed {{ $invoice->email_sent_at->format('d M Y') }} @if($invoice->email_sent_to) → {{ $invoice->email_sent_to }} @endif @if($invoice->broker_copy_sent) + Broker Copy @endif @endif

  1. Invoices
  2. #{{ $invoice->invoice_number }}
{{-- Resend email --}} @if($invoice->status === 'issued')
@csrf
@endif {{-- Print button --}} {{-- Cancel invoice --}} @if($invoice->status === 'issued')
@csrf
@endif Back
@foreach(['success','error'] as $t) @if(session($t))
{{ session($t) }}
@endif @endforeach
{{-- ── Left: meta cards ──────────────────────────────────────────────── --}}
{{-- Status card --}}
Status
{!! $invoice->statusBadge() !!}
@if($invoice->status === 'issued') ✅ @elseif($invoice->status === 'cancelled') 🚫 @else 🔄 @endif
{{-- Payment summary --}}
Payment Summary
@php $sym = $invoice->currency_symbol ?? '₹'; $dec = (int)($invoice->currency_decimals ?? 2); $pos = $invoice->currency_symbol_position ?? 'before'; $fmt = fn($n) => $pos === 'after' ? number_format((float)$n, $dec, '.', ',') . ' ' . $sym : $sym . number_format((float)$n, $dec, '.', ','); $labels = $invoice->fee_labels ?? []; @endphp @if($invoice->processing_fee > 0)@endif @if($invoice->stamp_duty > 0)@endif @if($invoice->registration_fee > 0)@endif @if($invoice->maintenance_charge> 0)@endif @if($invoice->custom_fee1 > 0)@endif @if($invoice->custom_fee2 > 0)@endif @if($invoice->tax_amount > 0) @endif @if($invoice->balance_due > 0) @else @endif
Unit Price {{ $fmt($invoice->unit_price) }}
{{ $labels['processing'] ?? 'Processing Fee' }}{{ $fmt($invoice->processing_fee) }}
{{ $labels['stamp_duty'] ?? 'Stamp Duty' }}{{ $fmt($invoice->stamp_duty) }}
{{ $labels['registration'] ?? 'Registration Fee' }}{{ $fmt($invoice->registration_fee) }}
{{ $labels['maintenance'] ?? 'Maintenance' }}{{ $fmt($invoice->maintenance_charge) }}
{{ $labels['custom1'] ?? 'Custom Fee 1' }}{{ $fmt($invoice->custom_fee1) }}
{{ $labels['custom2'] ?? 'Custom Fee 2' }}{{ $fmt($invoice->custom_fee2) }}
{{ $labels['tax'] ?? ($invoice->tax_label ?? 'Tax') }} @if($invoice->tax_rate > 0)({{ $invoice->tax_rate }}%)@endif {{ $fmt($invoice->tax_amount) }}
Grand Total {{ $fmt($invoice->total_amount) }}
{{ $invoice->type === 'milestone' ? 'This Payment' : 'Amount Paid' }} {{ $fmt($invoice->amount_paid) }}
Balance Due {{ $fmt($invoice->balance_due) }}
✓ Fully Paid
{{-- Client info --}}
Client
{{ $invoice->client_name }}
@if($invoice->client_phone)
{{ $invoice->client_phone }}
@endif @if($invoice->client_email)
{{ $invoice->client_email }}
@endif @if($invoice->client_address)
{{ $invoice->client_address }}
@endif
{{-- Unit info --}}
Unit Details
Unit {{ $invoice->plot_number }}
@if($invoice->plot_type)
{{ $invoice->plot_type }}
@endif @if($invoice->area)
{{ $invoice->area }} {{ $invoice->area_unit }}
@endif @if($invoice->project_name)
📍 {{ $invoice->project_name }}{{ $invoice->block_name ? ' — '.$invoice->block_name : '' }}
@endif @if($invoice->payment_plan_name)
Plan: {{ $invoice->payment_plan_name }}
@endif
Booking #{{ $invoice->booking_id }}
{{-- Milestone snapshot --}} @if($invoice->milestones_snapshot && count($invoice->milestones_snapshot))
Payment Schedule
@foreach($invoice->milestones_snapshot as $i => $m) @php $isCurrent = !empty($m['is_current']); $sc = match($m['status'] ?? 'pending') { 'paid' => '#22c55e', 'overdue' => '#ef4444', default => '#f59e0b', }; @endphp @endforeach
# Milestone Amount Status
{{ $i + 1 }} {{ $m['label'] }} @if($isCurrent)This Payment@endif {{ $fmt($m['display_amount'] ?? 0) }} {{ $m['status'] ?? 'pending' }}
@endif {{-- Meta / audit --}}
Audit Info
Invoice Type {{ $invoice->typeLabel() }}
Currency {{ $invoice->currency_code }} ({{ $invoice->currency_symbol }})
@if($invoice->tax_system)
Tax System {{ $invoice->tax_system }}
@endif @if($invoice->payment_mode)
Payment Mode {{ str_replace('_', ' ', $invoice->payment_mode) }}
@endif
Issued At {{ $invoice->issued_at->format('d M Y, h:i A') }}
@if($invoice->email_sent_at)
Email Sent {{ $invoice->email_sent_at->format('d M Y, h:i A') }}
@endif @if($invoice->broker_copy_sent)
Broker Copy Sent ✓
@endif @if($invoice->meta) @php $meta = is_array($invoice->meta) ? $invoice->meta : json_decode($invoice->meta, true); @endphp @if(!empty($meta['milestone_label']))
Milestone {{ $meta['milestone_label'] }}
@endif @if(!empty($meta['broker_name']))
Broker {{ $meta['broker_name'] }}
@endif @endif
{{-- ── Right: invoice iframe preview ────────────────────────────────── --}}
Invoice Preview
Open
{{-- iframe renders the blade invoice HTML --}}
@include('Partials.footer')