Team Compensation Summary

Bonus distribution and financial forecast per team

{{-- Filters --}}
@php $teams = $this->getComputedData(); @endphp @if(empty($teams))
No data available.
@else
@foreach($teams as $t)
{{-- Team Header --}}

{{ $t['team']->name }}

{{ date('F', mktime(0,0,0,$month,1)) }} {{ $year }}

@if($t['bonus_pool'] > 0) @php $utilBg = $t['utilization'] <= 100 ? 'bg-success-100 text-success-700 dark:bg-success-900 dark:text-success-300' : 'bg-danger-100 text-danger-700 dark:bg-danger-900 dark:text-danger-300'; @endphp Pool Utilization: {{ $t['utilization'] }}% @else No bonus data @endif
{{-- Finance Summary --}}

Finance Summary

@if(!$t['income'] && !$t['expense'])

No finance report for this period.

@else
@php $finMetrics = [ ['label' => 'Income', 'value' => $t['income'], 'color' => 'text-success-600 dark:text-success-400'], ['label' => 'Expense', 'value' => $t['expense'], 'color' => 'text-danger-600 dark:text-danger-400'], ['label' => 'Balance', 'value' => $t['balance'], 'color' => $t['balance'] >= 0 ? 'text-success-600 dark:text-success-400' : 'text-danger-600 dark:text-danger-400'], ['label' => 'Saving', 'value' => $t['saving'], 'color' => 'text-blue-600 dark:text-blue-400'], ]; @endphp @foreach($finMetrics as $fm)
{{ $fm['label'] }} {{ number_format($fm['value'], 0, ',', '.') }}
@endforeach
@endif
{{-- Bonus Distribution --}}

Bonus Distribution

@if(!$t['bonus'])

No bonus record for this period.

@else
Bonus Pool {{ number_format($t['bonus_pool'], 0, ',', '.') }}
Total Outcome {{ number_format($t['outcome'], 0, ',', '.') }}
@php $roles = [ 'PM' => $t['bonus']->pm_percentage, 'Developer' => $t['bonus']->dev_percentage, 'Marketing' => $t['bonus']->marketing_percentage, 'Koordinator' => $t['bonus']->koordinator_percentage, ]; $roleColors = ['PM' => 'bg-blue-100 text-blue-700', 'Developer' => 'bg-purple-100 text-purple-700', 'Marketing' => 'bg-pink-100 text-pink-700', 'Koordinator' => 'bg-orange-100 text-orange-700']; @endphp
@foreach($roles as $role => $pct) @if($pct) {{ $role }}: {{ $pct }}% @endif @endforeach
@if($t['apresiasi_count'] > 0)
{{ $t['apresiasi_count'] }} appreciation {{ Str::plural('entry', $t['apresiasi_count']) }} recorded
@endif
@endif
{{-- Forecast Comparison --}}

Forecast vs Real

@if(!$t['forecast'])

No forecast data for this period.

@else @php $f = $t['forecast']; $forecastRows = [ ['label' => 'Income', 'target' => $f->income_total_nominal_target, 'real' => $f->income_total_nominal_real], ['label' => 'Est. Profit', 'target' => $f->estimated_profit_target, 'real' => $f->estimated_profit_real], ['label' => 'Ending Balance', 'target' => $f->ending_balance_target, 'real' => $f->ending_balance_real], ]; @endphp
Target
Real
@foreach($forecastRows as $row) @php $variance = ($row['real'] ?? 0) - ($row['target'] ?? 0); $varColor = $variance >= 0 ? 'text-success-600 dark:text-success-400' : 'text-danger-600 dark:text-danger-400'; @endphp
{{ $row['label'] }}
{{ $row['target'] !== null ? number_format($row['target'], 0, ',', '.') : '—' }}
{{ $row['real'] !== null ? number_format($row['real'], 0, ',', '.') : '—' }}
@endforeach
@endif
@endforeach
@endif