@php $t = \App\Helpers\TranslationHelper::getUserTranslations(); $date = isset($declaration->work_date) ? \Carbon\Carbon::parse($declaration->work_date) : null; $year = $date ? (int)$date->format('Y') : null; $month = $date ? (int)$date->format('n') : null; $day = $date ? $date->format('d') : ''; $monthKey = $date ? strtolower($date->format('F')) : null; $fullMonth = $date ? ($t['translations']['months'][$monthKey] ?? $date->translatedFormat('F')) : ''; if (function_exists('mb_substr')) { $monthAbbr = ucfirst(mb_substr($fullMonth, 0, 3, 'UTF-8')).'.'; } else { $monthAbbr = ucfirst(substr($fullMonth,0,3)).'.'; } $clientName = $declaration->client_name ?? ($t['translations']['interventions']['client'] ?? 'Client'); // Utiliser ServiceIconHelper pour uniformiser les icônes et classes $serviceType = $declaration->service_type ?? 'cleaning'; $config = \App\Helpers\ServiceIconHelper::getConfig($serviceType); $serviceIcon = $config['icon']; $serviceClass = $config['class']; $serviceLabel = $t['translations']['cleaning'][$config['label_key']] ?? $config['fallback']; $start = isset($declaration->start_time) ? substr($declaration->start_time,0,5) : null; $end = isset($declaration->end_time) ? substr($declaration->end_time,0,5) : null; $minutes = isset($declaration->minutes_worked) ? (int)$declaration->minutes_worked : null; $sep = $t['translations']['schedules']['hour_separator'] ?? 'h'; $hoursText = $minutes !== null ? (floor($minutes/60).$sep.str_pad((string)($minutes%60), 2, '0', STR_PAD_LEFT)) : ''; $isValidated = (int)($declaration->status ?? 0) === 1; $statusClass = $isValidated ? 'validated' : 'pending'; @endphp
@endif
@if($date)