|
Désignation
|
Prix
|
@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)
| {{ $inscriptionRow->workshop->titre }} |
{{ $inscriptionRow->price }} TND
|
@endif
@if ($formationCount > 0)
Ateliers ({{ $formationCount }})
@foreach ($formations as $f)
- {{ $f->workshop->titre }}
@endforeach
|
{{ $formationTotal }} TND |
@endif
@foreach ($otherRows as $o)
| {{ $o->workshop->titre }} |
{{ $o->price }} TND |
@endforeach
| Total |
{{ $computedTotal }} TND |
@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)
|
{{ $entries->first()->workshop->titre }}
@if ($entries->count() > 1)
×{{ $entries->count() }}
@endif
|
{{ $entries->sum('price') }} TND
|
@endforeach
| Total |
{{ $visibleTotal }} TND |
@endif
|
Moyen de paiement
|
{{ $participant->paiement_mode }}
|