@extends('layouts.layout-horizontal') @section('title', 'Proforma Invoices') @section('css') @include('partials._index-table-styles') @endsection @section('content')
{{-- Compact header --}}
Proforma Invoices
{{ $proformas->count() }} proformas New Proforma
@php $avatarColors = ['#6366f1','#ec4899','#f59e0b','#10b981','#3b82f6','#8b5cf6','#ef4444','#14b8a6','#f97316','#06b6d4']; $grouped = $proformas->groupBy(fn($s) => $s->invoice_date->format('Y-m-d')); @endphp @forelse ($grouped as $date => $dateProformas) {{-- Date group header --}} @php $dateObj = \Carbon\Carbon::parse($date); $dateLabel = $dateObj->isToday() ? 'Today' : ($dateObj->isYesterday() ? 'Yesterday' : $dateObj->format('d M Y')); $dayTotal = $dateProformas->sum('grand_total'); @endphp @foreach ($dateProformas as $pi) @php $initial = strtoupper(substr($pi->party?->name ?? '?', 0, 1)); $colorIdx = ($pi->party_id ?? 0) % count($avatarColors); @endphp @endforeach @empty @endforelse @if ($proformas->count()) @endif
Party Proforma No Status Grand Total Actions
{{ $dateLabel }} ({{ $dateProformas->count() }}) ₹{{ indian_number($dayTotal, 2) }}
{{ $initial }} {{ $pi->party?->name ?? '—' }}
{{ $pi->proforma_no }} @if($pi->status === 'converted') Converted @else Open @endif ₹{{ indian_number($pi->grand_total, 2) }}
@if($pi->status === 'open') @endif @if($pi->party && $pi->party->mobile) @endif @if($pi->status === 'open') @endif
@include('partials._empty-state', [ 'icon' => 'ph-receipt', 'title' => 'No proforma invoices yet', 'subtitle' => 'Create your first proforma invoice.', 'action' => route('proforma-invoices.create'), 'actionLabel' => 'Create Proforma', ])
{{ $proformas->count() }} proformas ₹{{ indian_number($proformas->sum('grand_total'), 2) }}
@endsection @push('scripts') @php $companyName = currentCompany()->name ?? config('app.name'); @endphp @endpush