@php $normalizeNumber = fn (mixed $value): float => abs((float) $value) < 0.005 ? 0.0 : (float) $value; $formatScore = fn (mixed $value): string => $value === null ? '—' : number_format($normalizeNumber($value), 2, ',', ' '); $formatSignedScore = function (mixed $value) use ($normalizeNumber): string { if ($value === null) { return '—'; } $number = $normalizeNumber($value); return ($number > 0 ? '-' : '') . number_format($number, 2, ',', ' '); }; $formatCoefficient = function (mixed $value) use ($normalizeNumber): string { if ($value === null) { return '—'; } return rtrim(rtrim(number_format($normalizeNumber($value), 2, ',', ' '), '0'), ','); }; $formatDate = fn ($date): string => $date ? $date->format('d/m/Y') : '—'; $todayActivityDetails = data_get($todayScore, 'calculation_details.activities', []); $todayGoalDetails = collect(data_get($todayScore, 'calculation_details.goals', [])); $todayActivitySessions = collect(data_get($todayActivityDetails, 'sessions', [])); $activityScore = data_get($todayScore, 'activities_score'); $goalScore = data_get($todayScore, 'goals_score'); $phonePenalty = data_get($todayScore, 'phone_penalty'); $stateCoefficient = data_get($todayScore, 'state_coefficient'); $subtotal = data_get($todayScore, 'calculation_details.base_score', (float) $activityScore + (float) $goalScore - (float) $phonePenalty); @endphp

{{ __('Life Analytics') }}

{{ __('Scores') }}

{{ __('Dashboard') }}

{{ __('Période d’analyse') }}

@foreach ($periodOptions as $periodValue => $periodLabel) {{ __($periodLabel) }} @endforeach
@if ($chartPoints === [])
{{ __('Aucun score calculé sur cette période.') }}
@else @endif

{{ __('Historique') }}

{{ __('Scores journaliers') }}

{{ trans_choice('ui.common.days', data_get($summary, 'count', 0), ['count' => data_get($summary, 'count', 0)]) }}
@forelse ($scores as $score) @empty @endforelse
{{ __('Date') }} {{ __('Score final') }} {{ __('Total activités') }} {{ __('Total objectifs') }} {{ __('Malus téléphone') }} {{ __('Coeff. état') }}
{{ $formatDate($score->dailyEntry?->entry_date) }} {{ $formatScore($score->final_score) }} {{ $formatScore($score->activities_score) }} {{ $formatScore($score->goals_score) }} {{ $formatSignedScore($score->phone_penalty) }} ×{{ $formatCoefficient($score->state_coefficient) }}
{{ __('Aucun score calculé sur cette période.') }}

{{ __('Calcul du jour') }}

{{ __('Détails des sous-calculs') }}

@if ($todayActivitySessions->isNotEmpty())

{{ __('Activités') }}

@foreach ($todayActivitySessions as $session)
{{ data_get($session, 'label') }} {{ $formatScore(((float) data_get($session, 'duration_minutes') / 60) * (float) data_get($session, 'effective_score_weight')) }} × {{ $formatCoefficient(data_get($session, 'satisfaction_coefficient')) }} × {{ $formatCoefficient(data_get($session, 'progression_coefficient')) }} = {{ $formatScore(data_get($session, 'score')) }}
@endforeach
@endif @if ($todayGoalDetails->isNotEmpty())

{{ __('Objectifs') }}

@foreach ($todayGoalDetails as $goal)
{{ data_get($goal, 'label') }} {{ $formatScore(data_get($goal, 'weight')) }} × {{ $formatCoefficient(data_get($goal, 'completion_coefficient')) }} = {{ $formatScore(data_get($goal, 'score')) }}
@endforeach
@endif