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

Dotation Budgétaire - Exercice {{ $dotation->exercice->annee }}

Informations générales

Exercice: {{ $dotation->exercice->annee }}
Période: Du {{ $dotation->date_debut->format('d/m/Y') }} au {{ $dotation->date_fin->format('d/m/Y') }}
Statut: {{ ucfirst($dotation->statut) }}
Description: {{ $dotation->description ?? 'N/A' }}

Informations financières

Montant alloué: {{ number_format($dotation->montant_alloue, 2, ',', ' ') }} FCFA
Montant utilisé: {{ number_format($dotation->montant_utilise, 2, ',', ' ') }} FCFA
Montant restant: {{ number_format($dotation->montant_restant, 2, ',', ' ') }} FCFA
Taux d'utilisation:
{{ round($dotation->taux_utilisation, 2) }}%

Factures payées sur cette dotation

@php $factures = \App\Models\Facture::where('exercice_id', $dotation->exercice_id) ->where('statut', 'payee') ->with('marche.operateur') ->orderBy('date_paiement', 'desc') ->get(); @endphp @if($factures->count() > 0)
@foreach($factures as $facture) @endforeach
N°Facture Marché Titulaire Date de paiement Montant Statut
{{ $facture->numero_facture }} {{ $facture->marche->reference }} {{ $facture->marche->operateur->denomination }} {{ $facture->date_paiement->format('d/m/Y') }} {{ number_format($facture->montant, 2, ',', ' ') }} FCFA Payée
Total: {{ number_format($factures->sum('montant'), 2, ',', ' ') }} FCFA
@else
Aucune facture n'a été payée avec cette dotation budgétaire.
@endif

Statistiques avancées

Nombre de factures

{{ $factures->count() }}

Moyenne par facture

{{ $factures->count() > 0 ? number_format($factures->avg('montant'), 2, ',', ' ') : '0,00' }} FCFA

Plus petite facture

{{ $factures->count() > 0 ? number_format($factures->min('montant'), 2, ',', ' ') : '0,00' }} FCFA

Plus grande facture

{{ $factures->count() > 0 ? number_format($factures->max('montant'), 2, ',', ' ') : '0,00' }} FCFA

Retour à la liste @if($dotation->statut === 'actif')
@csrf
@endif @if($dotation->statut === 'actif' && $dotation->montant_utilise == 0)
@csrf @method('DELETE')
@endif
@endsection @push('styles') @endpush