@include('modules.reports.partials.pdf-company-details')

CLIENT STATEMENT

Client: {{ $selectedClient ? ($selectedClient->fullName ?? $selectedClient->full_name ?? $selectedClient->name ?? 'Client') : 'N/A' }}
Period: {{ \Carbon\Carbon::parse($dateFrom)->format('M j, Y') }} - {{ \Carbon\Carbon::parse($dateTo)->format('M j, Y') }}
Currency: {{ $currency ? (($currency->currency_code ?? $currency->currency_id) . ' - ' . ($currency->currency_name ?? '')) : ($currencyId ?? 'USD') }}
Generated: {{ now()->format('M j, Y H:i') }}
Summary
Opening Balance {{ number_format((float)($openingBalance ?? 0), 2) }}
Total Invoices {{ number_format((float)($metrics['totalInvoices'] ?? 0), 2) }}
Total Receipts {{ number_format((float)($metrics['totalReceipts'] ?? 0), 2) }}
Closing Balance {{ number_format((float)($metrics['balance'] ?? 0), 2) }}
Statement Transactions @forelse(($transactions ?? collect()) as $txn) @empty @endforelse
Date Reference Description Debit Credit Balance
{{ $txn['date'] ? \Carbon\Carbon::parse($txn['date'])->format('Y-m-d') : '' }} {{ $txn['reference'] ?? '' }}
{{ $txn['description'] ?? '' }}
{{ strtoupper((string)($txn['type'] ?? '')) }}{{ !empty($txn['status']) ? (' • ' . (string)$txn['status']) : '' }}
{{ !empty($txn['debit']) ? number_format((float)$txn['debit'], 2) : '' }} {{ !empty($txn['credit']) ? number_format((float)$txn['credit'], 2) : '' }} {{ number_format((float)($txn['balance'] ?? 0), 2) }}
No transactions found for selected period.
Note: This statement is generated from invoices and receipts recorded for the client in the selected period.