@php $totalPax = []; $totalPax['total'] = 0; $totalRevenue = []; $totalRevenue['total'] = 0; $totalYield = []; @endphp @foreach($data as $cabin => $array) @php $totalPax[$cabin] = 0; $totalRevenue[$cabin] = 0; @endphp @foreach($array as $i => $each) @php $totalPax['total'] += $each->pax @endphp @php $totalRevenue['total'] += $each->revenue @endphp @php $totalPax[$cabin] += $each->pax @endphp @php $totalRevenue[$cabin] += $each->revenue @endphp @if ($i == count($array) - 1) @endif @endforeach @endforeach @if ($totalPax['total']) @endif
No. RBD PAX @lang("content.yield") @lang("content.revenue")
{{ ucwords($cabin) }} Class
{{ $i + 1 }} {{ $each->grouped_field }} {{ $each->pax }} {{ number_format(round($each->revenue/$each->pax)) }} {{ number_format($each->revenue) }}
@lang("content.total") {{ $totalPax[$cabin] }} {{ number_format(round($totalRevenue[$cabin] / $totalPax[$cabin])) }} {{ number_format($totalRevenue[$cabin]) }}
@lang("content.grand_total") {{ $totalPax['total'] }} {{ number_format(round($totalRevenue['total'] / $totalPax['total'])) }} {{ number_format($totalRevenue['total']) }}