{{-- resources/views/finance/invoices/show.blade.php --}} @extends('layouts.finance.finance') @section('content')
{{-- Header & Actions --}}

Invoice {{ $invoice->invoice_number ?? ('#' . $invoice->id) }}

@php $statusColor = in_array(strtolower($invoice->status ?? ''), ['paid', 'completed']) ? 'bg-green-100 text-green-800' : (strtolower($invoice->status ?? '') === 'overdue' ? 'bg-red-100 text-red-800' : 'bg-yellow-100 text-yellow-800'); @endphp {{ ucfirst($invoice->status ?? 'Pending') }}
{{-- Placeholder for a Print/Download PDF button --}}
{{-- Invoice Document Card --}}
{{-- Top Section: Company & Client Info --}}

Meking Steel

Old No.110, New No. 37, Nelson Manickam Road, Aminjikarai

Chennai, Tamil Nadu, 600029

info@mekingsteel.com

Billed To

{{ $invoice->project->client_name ?? 'Client Name' }}

Project: {{ $invoice->project->title ?? 'N/A' }}

Project ID: #{{ $invoice->project_id }}

{{-- Middle Section: Dates & Details --}}

Invoice Date

{{ \Carbon\Carbon::parse($invoice->created_at)->format('M d, Y') }}

{{-- Optional: Add a Due Date if your database tracks it --}}

Due Date

{{ $invoice->due_date ? \Carbon\Carbon::parse($invoice->due_date)->format('M d, Y') : 'Upon Receipt' }}

Total Amount

Rs {{ number_format($invoice->amount ?? $invoice->total_amount ?? $invoice->total ?? $invoice->grand_total ?? 0, 2) }}

{{-- Bottom Section: Invoice Notes / Description --}}

Invoice Description

{{ $invoice->description ?? $invoice->notes ?? 'Standard invoice for project services rendered.' }}

{{-- Payment Summary --}}
Subtotal: Rs {{ number_format($invoice->amount ?? $invoice->total_amount ?? $invoice->total ?? 0, 2) }}
Total: Rs {{ number_format($invoice->amount ?? $invoice->total_amount ?? $invoice->total ?? 0, 2) }}
@endsection