@php // Construction du titre dynamique $titleParts = []; // Période if ($from && $to) { $titleParts[] = 'du ' . \Carbon\Carbon::parse($from)->format('d/m/Y') . ' au ' . \Carbon\Carbon::parse($to)->format('d/m/Y'); } elseif ($from) { $titleParts[] = 'à partir du ' . \Carbon\Carbon::parse($from)->format('d/m/Y'); } elseif ($to) { $titleParts[] = 'jusqu\'au ' . \Carbon\Carbon::parse($to)->format('d/m/Y'); } else { $titleParts[] = 'toutes périodes'; } // Type d'opération if (request('type')) { $type = request('type'); if ($type === 'entrée') { $titleParts[] = 'entrées'; } elseif ($type === 'sortie') { $titleParts[] = 'sorties'; } } else { $titleParts[] = 'entrées et sorties'; } // Agence if ($isSuperAdmin && request('agence_id')) { $agence = \App\Models\Agency::find(request('agence_id')); if ($agence) { $titleParts[] = 'de l\'agence "' . $agence->name . '"'; } } elseif ($isSuperAdmin) { $titleParts[] = 'de toutes les agences'; } else { $titleParts[] = 'de l\'agence "' . (auth()->user()->agencie->name ?? '') . '"'; } $dynamicTitle = 'Rapport des opérations de caisse (' . implode(', ', $titleParts) . ')'; @endphp

{{ $dynamicTitle }}

Généré le {{ now()->format('d/m/Y à H:i') }}

Résumé des opérations

{{ number_format($totalEntrees, 0, ',', ' ') }} F
Total Entrées
{{ number_format($totalSorties, 0, ',', ' ') }} F
Total Sorties
{{ number_format($solde, 0, ',', ' ') }} F
Solde
{{ $nbOperations }}
Nb Opérations
@if(isset($pages) && count($pages) > 0) @foreach($pages as $pageIndex => $page) @if($pageIndex > 0)
@endif
Page {{ $page['page_number'] }} sur {{ $page['total_pages'] }}
@if(in_array('operation_date', $columns)) @endif @if(in_array('type', $columns)) @endif @if(in_array('amount', $columns)) @endif @if(in_array('uuid', $columns)) @endif @if(in_array('external_reference', $columns)) @endif @if($isSuperAdmin && in_array('agency', $columns)) @endif @if(in_array('reason', $columns)) @endif @if(in_array('added_by', $columns)) @endif @if(in_array('date_added', $columns)) @endif @if(in_array('exported_by', $columns)) @endif @if(in_array('date_export', $columns)) @endif @if(in_array('is_exported_to_comptability', $columns)) @endif @foreach($page['data'] as $rowIndex => $op) @php $addAction = $op->actionOperations->where('type_action', 'Enregistrement d\'opération')->first(); $exportAction = $op->actionOperations->where('type_action', 'Export vers comptabilité')->first(); // Utiliser le numéro d'ordre global passé depuis le contrôleur $orderNumber = $op->order_number ?? (($page['page_number'] - 1) * 30) + $rowIndex + 1; @endphp @if(in_array('operation_date', $columns)) @endif @if(in_array('type', $columns)) @endif @if(in_array('amount', $columns)) @endif @if(in_array('uuid', $columns)) @endif @if(in_array('external_reference', $columns)) @endif @if($isSuperAdmin && in_array('agency', $columns)) @endif @if(in_array('reason', $columns)) @endif @if(in_array('added_by', $columns)) @endif @if(in_array('date_added', $columns)) @endif @if(in_array('exported_by', $columns)) @endif @if(in_array('date_export', $columns)) @endif @if(in_array('is_exported_to_comptability', $columns)) @endif @endforeach
DateTypeMontantIdentifiantRéférenceAgenceMotifCaissierDate ajoutExporté parDate exportExporté
{{ $orderNumber }}{{ $op->operation_date ? $op->operation_date->format('d/m/Y H:i') : 'N/A' }} {{ ucfirst($op->type) }} {{ number_format($op->amount, 0, ',', ' ') }} F{{ $op->uuid ?? 'N/A' }}{{ $op->external_reference ?? 'N/A' }}{{ $op->agencie->name ?? 'N/A' }}{{ Str::limit($op->reason, 20) ?? 'N/A' }}{{ $addAction && $addAction->user ? $addAction->user->first_name . ' ' . $addAction->user->last_name : 'N/A' }}{{ $addAction ? $addAction->created_at->format('d/m/Y H:i') : 'N/A' }}{{ $exportAction && $exportAction->user ? $exportAction->user->first_name . ' ' . $exportAction->user->last_name : 'N/A' }}{{ $exportAction ? $exportAction->created_at->format('d/m/Y H:i') : 'N/A' }}{{ $op->is_exported_to_comptability ? 'Oui' : 'Non' }}
@endforeach @else

Aucune opération trouvée pour les critères sélectionnés.

@endif