@php
$lotPrices = $lot->prices;
$prixImmoTTC = $lotPrices->where('type', 'prix_immo_ttc')->first()?->value ?? 0;
// Le prix foncier est calculé : Prix de vente TTC - Total des travaux en read_only
$prixFoncier = $lot->getPrixFoncier();
$montantTravauxCommTTC = $lotPrices->where('type', \App\Enums\PriceTypeTravaux::PRIX_TRAVAUX_ELIGIBLE->value)->first()?->value ?? 0;
$loyerMensuel = $lotPrices->where('type', 'loyer_mensuel')->first()?->value ?? 0;
// Date de livraison du programme
$program = $lot->program;
$dateLivraison = $program->dates->where('type', 'date_livraison')->first();
$dateLivraisonValue = $dateLivraison ? $dateLivraison->value : null;
// Calcul du nombre d'années de travaux pour la répartition des appels de fonds
$nb_annees_repartiton = $dateLivraisonValue ? (intval(date('Y', strtotime($dateLivraisonValue))) - intval(date('Y')) + 1) : 1;
$nb_annees_repartiton = $nb_annees_repartiton < 1 ? 1 : $nb_annees_repartiton;
// Répartition par défaut en fonction du nombre d'années de travaux
$repartition = [100, 0, 0, 0];
switch ($nb_annees_repartiton) {
case 1:
$repartition = [100];
break;
case 2:
$repartition = [50, 50];
break;
case 3:
$repartition = [40, 30, 30];
break;
case 4:
$repartition = [25, 25, 25, 25];
break;
default:
$repartition = [100];
break;
}
@endphp
Récapitulatif de l'investissement de votre client
€
€
€
Données nécessaires au calcul du financement de votre client