FICHE DÉTAILLÉE DU MARCHÉ

Référence: {{ $marche->numero_marche }} | Généré le: {{ $date }}

📋 INFORMATIONS GÉNÉRALES

Numéro du marché: {{ $marche->numero_marche }} Opérateur: {{ $marche->operateur->nom ?? 'N/A' }}
Objet du marché: {{ $marche->objet }}
Description: {{ $marche->description ?? 'Aucune description' }}
Date de début: {{ $marche->date_debut->format('d/m/Y') }} Date de fin: {{ $marche->date_fin->format('d/m/Y') }}
Durée restante: @php $joursRestants = now()->diffInDays($marche->date_fin, false); @endphp @if($joursRestants > 0) {{ $joursRestants }} jours @else Expiré @endif Statut: {{ strtoupper($marche->statut) }}

💰 INFORMATIONS FINANCIÈRES

Montant global: {{ number_format($marche->montant_global, 2, ',', ' ') }} FCFA Montant facturé: {{ number_format($marche->montant_global - $marche->montant_restant, 2, ',', ' ') }} FCFA
Montant restant: {{ number_format($marche->montant_restant, 2, ',', ' ') }} FCFA Taux d'exécution: {{ round($marche->progression, 2) }}%
{{ round($marche->progression, 2) }}%
@if($marche->exercices->count() > 0)

📅 RÉPARTITION PAR EXERCICE BUDGÉTAIRE

@foreach($marche->exercices as $exercice) @php $montantUtilise = $marche->factures->where('exercice_id', $exercice->id)->sum('montant'); $solde = $exercice->pivot->montant - $montantUtilise; $tauxUtilisation = $exercice->pivot->montant > 0 ? ($montantUtilise / $exercice->pivot->montant) * 100 : 0; @endphp @endforeach
Exercice Montant Alloué Montant Utilisé Solde Taux d'Utilisation État
{{ $exercice->annee }} {{ number_format($exercice->pivot->montant, 2, ',', ' ') }} FCFA {{ number_format($montantUtilise, 2, ',', ' ') }} FCFA {{ number_format($solde, 2, ',', ' ') }} FCFA {{ round($tauxUtilisation, 2) }}% @if($solde < 0) ⚠️ Dépassement @elseif($tauxUtilisation > 80) ⚠️ Attention @else ✅ Normal @endif
TOTAL {{ number_format($marche->exercices->sum('pivot.montant'), 2, ',', ' ') }} FCFA {{ number_format($marche->factures->sum('montant'), 2, ',', ' ') }} FCFA {{ number_format($marche->montant_restant, 2, ',', ' ') }} FCFA {{ round($marche->progression, 2) }}% @if($marche->montant_restant < 0) ❌ DÉPASSEMENT GLOBAL @elseif($marche->progression > 80) ⚠️ RISQUE DE DÉPASSEMENT @else ✅ BUDGET MAÎTRISÉ @endif
@endif @if($marche->factures->count() > 0)

🧾 FACTURES ASSOCIÉES ({{ $marche->factures->count() }})

@foreach($marche->factures as $facture) @endforeach @php $statuts = $marche->factures->groupBy('statut'); @endphp @foreach($statuts as $statut => $factures) @endforeach
N° Facture Exercice Date Montant Statut Date Validation Date Paiement
{{ $facture->numero_facture }} {{ $facture->exercice->annee }} {{ $facture->date_facture->format('d/m/Y') }} {{ number_format($facture->montant, 2, ',', ' ') }} FCFA {{ strtoupper($facture->statut) }} {{ $facture->date_validation ? $facture->date_validation->format('d/m/Y') : 'N/A' }} {{ $facture->date_paiement ? $facture->date_paiement->format('d/m/Y') : 'N/A' }}
SOUS-TOTAL PAR STATUT {{ number_format($marche->factures->sum('montant'), 2, ',', ' ') }} FCFA
{{ strtoupper($statut) }}: {{ $factures->count() }} facture(s) {{ number_format($factures->sum('montant'), 2, ',', ' ') }} FCFA
@else

🧾 FACTURES ASSOCIÉES

Aucune facture n'a été enregistrée pour ce marché.

@endif

📊 SYNTHÈSE

Nombre total d'exercices: {{ $marche->exercices->count() }}
Nombre total de factures: {{ $marche->factures->count() }}
Montant total engagé: {{ number_format($marche->montant_global - $marche->montant_restant, 2, ',', ' ') }} FCFA
Solde disponible: {{ number_format($marche->montant_restant, 2, ',', ' ') }} FCFA
Taux d'exécution global: {{ round($marche->progression, 2) }}%