@extends('dashboard.layouts.app') @section('content')
Payrolls
@php($teamBreakdown = $teamBreakdowns[$activeTab])
Q{{ $quarter }} {{ $year }} · {{ ucfirst($activeTab) }} Track Breakdown
@foreach ($teamBreakdown['rows'] as $trackRow) @endforeach
{{ $activeTab === 'sales' ? 'SALES' : ($activeTab === 'retention' ? 'RET' : 'REC') }} Count Level Total Average
{{ $trackRow['label'] }} {{ number_format($trackRow['count']) }} {{ number_format($trackRow['level']) }} {{ $trackRow['total'] > 0 ? number_format($trackRow['total'], 2) : '-' }} {{ $trackRow['average'] !== null ? number_format($trackRow['average'], 2) : '-' }}
Total {{ number_format($teamBreakdown['total']['count']) }} {{ number_format($teamBreakdown['total']['level']) }} {{ number_format($teamBreakdown['total']['amount'], 2) }} {{ $teamBreakdown['total']['average'] !== null ? number_format($teamBreakdown['total']['average'], 2) : '-' }}
Q{{ $quarter }} {{ $year }} · Paid Invoices by Currency
@foreach ($currencyBreakdown['currencies'] as $currency) @endforeach @foreach ($currencyBreakdown['currencies'] as $currency) @endforeach @foreach ([ 'Sales' => ['total' => $teamBreakdowns['sales']['total'], 'amounts' => $currencyBreakdown['teams']['sales']], 'Retention' => ['total' => $teamBreakdowns['retention']['total'], 'amounts' => $currencyBreakdown['teams']['retention']], 'Recommendation' => ['total' => $teamBreakdowns['recommendation']['total'], 'amounts' => $currencyBreakdown['teams']['recommendation']], ] as $departmentName => $departmentTotal) @foreach ($currencyBreakdown['currencies'] as $currency) @endforeach @foreach ($currencyBreakdown['currencies'] as $currency) @endforeach @endforeach
DEP Total StudentsPaid {{ $currency }}Equivalent {{ $currency }}
{{ $departmentName }} {{ number_format($departmentTotal['total']['students']) }}{{ number_format($departmentTotal['amounts']['native'][$currency] ?? 0, 2) }} {{ $departmentTotal['amounts']['equivalent'][$currency] !== null ? number_format($departmentTotal['amounts']['equivalent'][$currency], 2) : '-' }}
@if ($activeTab === 'sales')
Sales Agents
{{ number_format($summary['employees']) }}
Total Target
{{ number_format($summary['target'], 2) }}
Total Paid Sales
{{ number_format($summary['achieved'], 2) }}
Estimated Bonuses
{{ number_format($summary['bonuses'], 2) }}
{{ $summary['eligible'] }} eligible employees
Q{{ $quarter }} {{ $year }} · Sales Agents
@foreach ($currencyBreakdown['currencies'] as $currency) @endforeach @foreach ($currencyBreakdown['currencies'] as $currency) @endforeach @forelse ($rows as $row) @foreach ($currencyBreakdown['currencies'] as $currency) @endforeach @foreach ($currencyBreakdown['currencies'] as $currency) @endforeach @empty @endforelse @if ($rows->isNotEmpty()) @foreach ($currencyBreakdown['currencies'] as $currency) @endforeach @foreach ($currencyBreakdown['currencies'] as $currency) @endforeach @endif
Code Name Unique Students Invoices Paid Unpaid Target Net (invoice amounts) Percentage Pro Pro percentagePaid {{ $currency }}Equivalent {{ $currency }}
{{ $row['staff_no'] ?: '—' }} {{ $row['name'] }} {{ number_format($row['unique_paid_students']) }} {{ number_format($row['total_invoices']) }} {{ number_format($row['paid_invoices']) }} {{ number_format($row['unpaid_invoices']) }} {{ $row['has_configuration'] ? number_format($row['target'], 2) : '—' }} {{ $row['achieved'] > 0 ? number_format($row['achieved'], 2) : '—' }} {{ number_format($row['achievement_percentage'], 2) }}% {{ $row['bonus_amount'] > 0 ? number_format($row['bonus_amount'], 2) : '—' }} {{ number_format($row['pro_percentage'], 2) }}%{{ number_format(data_get($row, 'currency_amounts.native.'.$currency, 0), 2) }} {{ data_get($row, 'currency_amounts.equivalent.'.$currency) !== null ? number_format(data_get($row, 'currency_amounts.equivalent.'.$currency), 2) : '-' }}
No Sales Agents found.
Total {{ number_format($rows->sum('unique_paid_students')) }} {{ number_format($rows->sum('total_invoices')) }} {{ number_format($rows->sum('paid_invoices')) }} {{ number_format($rows->sum('unpaid_invoices')) }} {{ number_format($summary['target'], 2) }} {{ number_format($summary['achieved'], 2) }} — {{ number_format($summary['bonuses'], 2) }} —{{ number_format($currencyBreakdown['teams']['sales']['native'][$currency] ?? 0, 2) }} {{ $currencyBreakdown['teams']['sales']['equivalent'][$currency] !== null ? number_format($currencyBreakdown['teams']['sales']['equivalent'][$currency], 2) : '-' }}
@endif
@endsection @push('styles') @endpush @push('scripts') @endpush