@php
$totalKpiScore = 0;
foreach ($existingKpiScores as $score) {
$weight = $score->kpiindicator->weight ?? 0;
$totalKpiScore += ($score->score ?? 0) * ($weight / 100);
}
$totalPotencyScore = 0;
foreach ($existingPotencyScores as $score) {
$weight = $score->kpipotency->weight ?? 0;
$totalPotencyScore += ($score->score ?? 0) * ($weight / 100);
}
$performancePortion = $totalKpiScore * 0.8;
$performancePortionPotency = $totalPotencyScore * 0.2;
$finalScore = round((($performancePortion + $performancePortionPotency) / 5) * 100, 2);
@endphp
Skor KPI (80%): {{ round($performancePortion, 2) }}
Skor Potensi (20%): {{ round($performancePortionPotency, 2) }}
Total Akhir: {{ $finalScore }}%