INVOICE SUMMARY REPORT

{{ $account->name }}
{{ now()->format('F j, Y') }}
@php $totalAmount = 0; $totalPaid = 0; foreach($sales as $sale) { $totalAmount += $sale->total; $totalPaid += $sale->sale_payment->sum('amount'); } $totalDue = $totalAmount - $totalPaid; @endphp
{{ $sales->count() }}
Invoices
{{ number_format($totalAmount, 0) }}
Total Amount
{{ number_format($totalPaid, 0) }}
Amount Paid
{{ number_format($totalDue, 0) }}
Balance Due
Report Date: {{ now()->format('Y-m-d H:i') }} @if(isset($filters['approval_status'])) Approval: {{ ucfirst($filters['approval_status']) }} @endif @if(isset($filters['payment_status'])) Payment: {{ ucfirst($filters['payment_status']) }} @endif @if(isset($filters['from_date'])) From: {{ $filters['from_date'] }} @endif @if(isset($filters['to_date'])) To: {{ $filters['to_date'] }} @endif
@if($sales->count() > 0) @foreach($sales as $sale) @php $paid = $sale->sale_payment->sum('amount'); $due = $sale->total - $paid; $clientName = $sale->lead?->company?->name ?? $sale->lead?->name ?? 'N/A'; @endphp @endforeach
Invoice # Client Sale Date Total Paid Due Payment Approval
INV-{{ str_pad($sale->id, 6, '0', STR_PAD_LEFT) }}
{{ strtoupper(substr($clientName, 0, 2)) }}
{{ $clientName }}
{{ $sale->product?->name ?? '' }}
{{ $sale->sale_date ? \Illuminate\Support\Carbon::parse($sale->sale_date)->format('M d, Y') : '-' }} {{ number_format($sale->total, 2) }} {{ number_format($paid, 2) }} {{ number_format($due, 2) }} {{ ucfirst($sale->payment_status) }} {{ ucfirst($sale->approval_status) }}
TOTALS {{ number_format($totalAmount, 2) }} {{ number_format($totalPaid, 2) }} {{ number_format($totalDue, 2) }}
@else
📄

No invoices found matching your criteria.

@endif