@if ($participant->workshops->count() > 0)
@if ($event->slug === '13jmfm') @php $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; $computedTotal = ($inscriptionRow ? $inscriptionRow->price : 0) + $formationTotal + collect($otherRows)->sum('price'); @endphp @if ($inscriptionRow) @endif @if ($formationCount > 0) @endif @foreach ($otherRows as $o) @endforeach @else @php $visibleWorkshops = $participant->workshops->filter(fn($pw) => $pw->workshop?->visible_be); $groupedWorkshops = $visibleWorkshops->groupBy('workshop_id'); $visibleTotal = $visibleWorkshops->sum('price'); @endphp @foreach ($groupedWorkshops as $workshopId => $entries) @endforeach @endif
Désignation Prix
{{ $inscriptionRow->workshop->titre }} {{ $inscriptionRow->price }} TND
Ateliers ({{ $formationCount }})
    @foreach ($formations as $f)
  • {{ $f->workshop->titre }}
  • @endforeach
{{ $formationTotal }} TND
{{ $o->workshop->titre }} {{ $o->price }} TND
Total {{ $computedTotal }} TND
{{ $entries->first()->workshop->titre }} @if ($entries->count() > 1) ×{{ $entries->count() }} @endif {{ $entries->sum('price') }} TND
Total {{ $visibleTotal }} TND
Moyen de paiement {{ $participant->paiement_mode }}
@endif