Bilan Financier

Rapport financier détaillé des actifs et passifs

Sélection de la Période

Résultat Net

{{ number_format($totalActif - $totalPassif, 0) }}
.{{ substr(number_format($totalActif - $totalPassif, 2), -2) }} DH

Résultat d'exploitation

Détail des Actifs

Total Actif: {{ number_format($totalActif, 2) }} DH
Description Montant (DH)
Montant payé cette année pour les années antérieures {{ number_format($totalAnciennesAnnees ?? 0, 2) }} DH
Montant payé dans l'année en cours ({{ $selectedYearLabel }}) {{ number_format($totalAnneeCourante ?? 0, 2) }} DH
Montant non payé dans l'année en cours ({{ $selectedYearLabel }}) {{ number_format($totalUnpaid, 2) }} DH
Montant partiellement payé dans l'année en cours ({{ $selectedYearLabel }}) {{ number_format($totalPartial, 2) }} DH
Montant en cours de validation dans l'année en cours ({{ $selectedYearLabel }}) {{ number_format($totalValidation, 2) }} DH

Détail des Passifs

Total Passif: {{ number_format($totalPassif, 2) }} DH
@foreach ($chargesByRubrique as $charge) @endforeach
Rubrique Montant (DH)
{{ $charge->rubrique }} {{ number_format($charge->total, 2) }} DH

Récapitulatif des Actifs

{{ number_format($totalActif, 0) }}
.{{ substr(number_format($totalActif, 2), -2) }} DH

Total des ressources et créances

Récapitulatif des Passifs

{{ number_format($totalPassif, 0) }}
.{{ substr(number_format($totalPassif, 2), -2) }} DH

Total des dettes et obligations

Résultat Net d'Exploitation

{{ ($totalActif - $totalPassif) >= 0 ? '' : '' }}

RÉSULTAT NET D'EXPLOITATION

{{ number_format($totalActif - $totalPassif, 2) }} DH

{{ ($totalActif - $totalPassif) >= 0 ? 'Excédent budgétaire' : 'Déficit budgétaire' }}

@php // Calculate total actif including cotisations with count_current_year flag $totalActif = \App\Models\Cotisation::where(function($query) use ($selectedYearId) { $query->where('annee', $selectedYearId) ->orWhere('count_current_year', true); })->sum('montant'); // Log the total actif for debugging \Log::info('Total Actif:', ['totalActif' => $totalActif]); // Calculate total paid for the current year $totalAnneeCourante = \App\Models\Cotisation::where(function($query) use ($selectedYearId) { $query->where('annee', $selectedYearId) ->orWhere('count_current_year', true); })->where('statut_paiement', 1) ->sum('montant'); // Calculate total for previous years paid this year $totalAnciennesAnnees = \App\Models\Cotisation::where('annee', '<', $selectedYearId) ->where('count_current_year', true) ->sum('montant'); @endphp