@extends('layouts.master') @section('content')

📊 Tableau de Bord Budgétaire

Total Ressources

{{ number_format($totalRessources,0,',',' ') }} FCFA

Total Emplois

{{ number_format($totalDepenses,0,',',' ') }} FCFA

@php $totalBudget = 0; $totalEngagement = 0; @endphp @forelse($besoins as $index => $b) @foreach($b->budgetdepenses as $d) @php $budget = $d->montant ?? 0; $engagement = $d->engagement ?? 0; $ecart = $budget - $engagement; $taux = $budget > 0 ? ($engagement / $budget) * 100 : 0; $totalBudget += $budget; $totalEngagement += $engagement; @endphp @endforeach @empty @endforelse @php $totalEcart = $totalBudget - $totalEngagement; $totalTaux = $totalBudget > 0 ? ($totalEngagement / $totalBudget) * 100 : 0; @endphp
# Compte Libellé Rubrique Poste Budget Engagement Ecart %
{{ $index + 1 }} {{ optional($d->comptesyscohada)->code ?? '-' }} {{ optional($d->comptesyscohada)->libelle ?? '-' }} {{ optional($d->rubrique5)->libelle ?? '-' }} {{ optional($d->postegestion)->libelle ?? '-' }} {{ number_format($budget,0,',',' ') }} {{ number_format($engagement,0,',',' ') }} {{ number_format($ecart,0,',',' ') }} {{ number_format($taux,2) }} %
Aucun besoin budgétaire trouvé
TOTAL GENERAL {{ number_format($totalBudget,0,',',' ') }} {{ number_format($totalEngagement,0,',',' ') }} {{ number_format($totalEcart,0,',',' ') }} {{ number_format($totalTaux,2) }} %
@endsection