Bilan des dépenses du chantier

Information Détails
Nom du chantier : {{ $chantier->nom }}
Adresse : {{ $chantier->adresse }}
Montant vendu : {{ number_format($chantier->montant_vendu, 2) }} €
Référence chantier : {{ $chantier->nomenclature ? $chantier->nomenclature : 'N/A' }}
Référence agence : {{ $chantier->agence ? $chantier->agence->nomenclature : 'N/A' }}
Nom de l'agence : {{ $chantier->agence ? $chantier->agence->nom : 'N/A' }}
@foreach($depensesGroupedByCategory as $category => $total)

{{ ucfirst($category) }}

Catégorie Total
{{ ucfirst($category) }} {{ number_format($depensesGroupedByCategory[$category], 2) }} €
@endforeach

Résumé des dépenses

Catégorie Coût Total
Personnel {{ $depensesGroupedByCategory['personnel'] ?? 0 }}
Fournitures {{ $depensesGroupedByCategory['fournitures'] ?? 0 }}
Matériel {{ $depensesGroupedByCategory['materiel'] ?? 0 }}
Location {{ $depensesGroupedByCategory['location'] ?? 0 }}
Sous-traitant {{ $depensesGroupedByCategory['soustraitant'] ?? 0 }}
@php $totalExpenses = array_sum($depensesGroupedByCategory); $projectProfit = $chantier->montant_vendu - $totalExpenses; @endphp

Total des dépenses : {{ number_format($totalExpenses, 2) }} €

Profit du projet : {{ number_format($projectProfit, 2) }} €

Le projet est {{ $projectProfit >= 0 ? 'rentable' : 'non rentable' }}.