@php $t = \App\Helpers\TranslationHelper::getUserTranslations(); // Event date $eventDate = isset($declaration->event_date) ? \Carbon\Carbon::parse($declaration->event_date) : null; $eventDateFormatted = $eventDate ? $eventDate->format('d/m/Y') : '—'; // For filtering by month $year = $eventDate ? $eventDate->format('Y') : ''; $month = $eventDate ? (int)$eventDate->format('n') : ''; // Client name $clientName = $declaration->client_name ?? $declaration->client ?? $declaration->client_company_name ?? ($t['translations']['interventions']['client'] ?? 'Client'); // Status $isValidated = (int)($declaration->status ?? 0) === 1; $statusClass = $isValidated ? 'validated' : 'pending'; // Participants $totalParticipants = (int)($declaration->total_participants ?? 1); if ($totalParticipants < 1) { $totalParticipants = 1; } // Amounts $declaredAmount = (float)($declaration->declared_amount ?? 0); $shareAmount = (float)($declaration->share_amount ?? 0); // Display share if available, otherwise declared amount $displayAmount = $shareAmount > 0 ? $shareAmount : $declaredAmount; @endphp
@php $clientType = strtolower($declaration->client_type ?? ''); $isParticulier = $clientType === 'particulier'; @endphp @if($isParticulier)
@php $nameParts = explode(' ', trim($clientName)); $initials = ''; if (count($nameParts) >= 2) { $initials = strtoupper(substr($nameParts[0], 0, 1) . substr($nameParts[1], 0, 1)); } else { $initials = strtoupper(substr($clientName, 0, 2)); } @endphp {{ $initials }}
@else @endif
{{ $eventDate ? $eventDate->format('d') : '' }}
@if($eventDate) @php $monthKey = strtolower($eventDate->format('F')); $fullMonth = $t['translations']['months'][$monthKey] ?? $eventDate->translatedFormat('F'); if (function_exists('mb_substr')) { $monthAbbr = mb_strtolower(mb_substr($fullMonth, 0, 3, 'UTF-8'), 'UTF-8') . '.'; } else { $monthAbbr = strtolower(substr($fullMonth, 0, 3)) . '.'; } @endphp {{ $monthAbbr }} @endif
{{ $eventDate ? $eventDate->format('Y') : '' }}
{{ $clientName }}
@if(!empty($declaration->client_type)) @php $typeClass = strtolower($declaration->client_type); $typeKey = 'client_type_' . $typeClass; $typeLabel = $t['translations']['declaration'][$typeKey] ?? $declaration->client_type; @endphp
{{ $typeLabel }}
@endif
@if(!empty($declaration->short_address))
{{ $declaration->short_address }}
@endif
{{ $t['translations']['declaration']['declarants_title'] ?? 'Déclarants' }} {{ $totalParticipants }}
{{ $t['translations']['declaration']['event_total_amount'] ?? ($t['translations']['declaration']['amount_title'] ?? 'Somme du service') }}
{{ number_format($declaredAmount, 2, ',', ' ') }} €
{{ $t['translations']['declaration']['event_date_label'] ?? 'Date événement' }}
{{ $eventDateFormatted }}
{{ $t['translations']['declaration']['event_package_title'] ?? 'Événement' }}
{{ $t['translations']['declaration']['your_share_label'] ?? ($t['translations']['declaration']['declared_label'] ?? 'Votre part :') }}
{{ number_format($displayAmount, 2, ',', ' ') }} €