@extends('dashboard.layouts.app') @section('title', 'Détails courrier - UAC eservices') @section('page-title', 'Détails du courrier') @section('breadcrumb') @endsection @section('content')

{{ $courrier->objet }}

Détails du courrier

@if(in_array(auth()->user()->role->nom, ['Administrateur', 'Chef de Service', 'Responsable RH'])) Modifier @endif Retour
Informations générales
Objet:

{{ $courrier->objet }}

Référence:

{{ $courrier->reference ?: 'Non spécifiée' }}

Type:

@if($courrier->type === 'DA') DA (Demande d'Autorisation) @elseif($courrier->type === 'MI') MI (Mise en Information) @else {{ $courrier->type }} @endif

Statut:

{{ $courrier->statut }}

Date de réception:

{{ $courrier->date_reception->format('d/m/Y') }}

Délai de traitement:

{{ $courrier->delai_traitement_jours ?: 'Non défini' }} jour(s)

@if($courrier->date_limite)
Date limite:

{{ $courrier->date_limite->format('d/m/Y') }}

@if($courrier->date_traitement_final)
Date de traitement final:

{{ $courrier->date_traitement_final->format('d/m/Y') }}

@endif
@endif
Affecté par:

{{ $courrier->affectateur ? $courrier->affectateur->name : 'Non spécifié' }}

@forelse ($courrier->agentsTraitants as $agent) {{ $agent->name }} @empty

Ce courrier n'est affecté à aucun agent pour l'instant.

@endforelse
{{-- Instructions / Actions prescrites --}} @if($courrier->type === 'ARRIVEE')
Instructions / Actions prescrites : @php $instructions = $courrier->instructions ?? []; @endphp @if(!empty($courrier->instructions)) @foreach($courrier->instructions as $instr) {{ $instr }} @endforeach @else

Aucune instruction définie pour ce courrier.

@endif
@endif
@if($courrier->file_path)
Document du courrier

Fichier: {{ basename($courrier->file_path) }}

Cliquez sur les boutons pour prévisualiser ou télécharger
@php $extension = strtolower(pathinfo($courrier->file_path, PATHINFO_EXTENSION)); $isImage = in_array($extension, ['jpg', 'jpeg', 'png']); $isPdf = $extension === 'pdf'; @endphp @if($isImage || $isPdf) @endif Télécharger @if(in_array(auth()->user()->role->nom, ['Administrateur', 'Chef de Service', 'Responsable RH'])) @endif
@endif
État d'avancement
@if($courrier->delai_traitement_jours && $courrier->date_reception) @php $joursEcoules = (int) $courrier->date_reception->diffInDays(now()); $pourcentage = min(100, ($joursEcoules / $courrier->delai_traitement_jours) * 100); $statutCouleur = $pourcentage > 100 ? 'danger' : ($pourcentage > 75 ? 'warning' : 'success'); @endphp
{{ round($pourcentage) }}%
{{ $joursEcoules }} jour(s) écoulé(s) sur {{ $courrier->delai_traitement_jours }}
@else

Aucun délai défini

@endif
@php $isAgentTraitant = $courrier->agentsTraitants->contains('id', auth()->id()); @endphp @if(auth()->user()->role->nom === 'Agent' && $isAgentTraitant)
Actions sur le courrier
{{-- Marquer comme traité --}} @if($courrier->statut === 'En traitement')
@csrf @method('PATCH')
@endif {{-- Déjà traité --}} @if($courrier->statut === 'Traité')
Courrier déjà traité
@endif
@endif @if(in_array(auth()->user()->role->nom, ['Administrateur', 'Chef de Service', 'Responsable RH']))
Actions
Modifier
@csrf @method('DELETE')
@if($courrier->type === 'DEPART' && auth()->user()->role->nom === 'Administrateur') Relancer @endif
@endif
@endsection @if($courrier->file_path) @php $extension = strtolower(pathinfo($courrier->file_path, PATHINFO_EXTENSION)); $isImage = in_array($extension, ['jpg', 'jpeg', 'png']); $isPdf = $extension === 'pdf'; @endphp @if($isImage || $isPdf) @endif @endif @push('styles') @endpush