@extends('layouts.master') @section('title', 'Détails Marché') @section('content')
@if(session()->has('success'))
@endif @if(session()->has('errors'))
@endif

Détails du Marché: {{ $marche->reference }}

Informations générales

Reférence {{ $marche->reference }}
Intitulé {{ $marche->intitule }}
Opérateur {{ $marche->operateur->denomination ?? 'N/A' }}
Montant Initial {{ number_format($marche->cout_initial, 2, ',', ' ') }} FCFA
Avenants {{ number_format($marche->avenants, 2, ',', ' ') }} FCFA
Montant Final {{ number_format($marche->cout_final, 2, ',', ' ') }} FCFA
Montant restant {{ number_format($marche->montant_restant, 2, ',', ' ') }} FCFA

Dates et statut

Début {{ $marche->formatDate($marche->date_debut) }}
Fin {{ $marche->formatDate($marche->date_fin) }}
Statut {{ ucfirst($marche->statut) }}
Progression
{{ round($marche->progression, 2) }}%

Impact par exercice

@if($marche->exercices->count() > 0)
@foreach($marche->exercices as $exercice) @php $montantUtilise = $marche->factures() ->where('exercice_id', $exercice->id) ->sum('montant'); $montantAlloue = $exercice->pivot->montant; $reste = $montantAlloue - $montantUtilise; $pourcentage = $montantAlloue > 0 ? ($montantUtilise / $montantAlloue) * 100 : 0; @endphp @endforeach
Années Date début Date fin Ordonnancement prévu (A) Prise en charge sur le marché (B) Reste à ordonnancer (A-B) Taux d'execution (B/A)
{{ $exercice->annee }} {{ $exercice->date_debut->format('d/m/Y') }} {{ $exercice->date_fin->format('d/m/Y') }} {{ number_format($montantAlloue, 2, ',', ' ') }} FCFA {{ number_format($montantUtilise, 2, ',', ' ') }} FCFA {{ number_format($reste, 2, ',', ' ') }} FCFA
{{ round($pourcentage, 2) }}%
@else
Ce marché n'a aucun exercice associé.
@endif
@endsection