@include('backend.manage.show-user-data')
@include('backend.manage.summary')
@php
// Compute total from participant workshops (respect visibility and special tiers)
if ($event->slug === '13jmfm') {
$formationTiers = [1 => 40, 2 => 80, 3 => 100, 4 => 130, 5 => 150];
$inscriptionRow = null;
$formations = [];
$otherRows = [];
foreach ($participant->workshops as $pw) {
if (!$pw->workshop?->visible_be) {
continue;
}
if ($pw->workshop->f2 === 'formation') {
$formations[] = $pw;
} elseif ($pw->workshop->f2 === 'inscription') {
$inscriptionRow = $pw;
} else {
$otherRows[] = $pw;
}
}
$formationCount = count($formations);
$formationTotal = $formationTiers[$formationCount] ?? $formationCount * 40;
$participant_total_price =
($inscriptionRow ? $inscriptionRow->price : 0) +
$formationTotal +
collect($otherRows)->sum('price');
} else {
$visibleWorkshops = $participant->workshops->filter(fn($pw) => $pw->workshop?->visible_be);
$participant_total_price = $visibleWorkshops->sum('price');
}
@endphp
Les montants saisis ne correspondent pas au total de l'inscription !