@extends('layouts.app') @section('title', 'Salary History โ€” ' . $employee->full_name) @section('breadcrumbs') @endsection @section('content')
{{-- Header --}}
{{ strtoupper(substr($employee->first_name, 0, 1)) }}

{{ $employee->full_name }}

{{ $employee->employee_code }} ยท Salary Revision History

{{-- Current Salary --}}

Current Salary

Effective from {{ $currentSalary->first() ? $currentSalary->first()->effective_from->format('d M Y') : 'โ€”' }}
@if($currentSalary->isEmpty())

No salary assigned yet.

@else
@foreach($currentSalary as $sal)
{{ $sal->component->name ?? '' }} {{ number_format($sal->amount, 3) }}
@endforeach
Total Monthly OMR {{ number_format($currentSalary->sum('amount'), 3) }}
@endif
{{-- History Timeline --}}

Revision History

@if($history->isEmpty())

No revision history

Salary revisions will appear here as a timeline.

@else
@foreach($history as $date => $revisions)
{{ \Carbon\Carbon::parse($date)->format('d M Y') }}
Total: OMR {{ number_format($revisions->sum('amount'), 3) }}
@foreach($revisions as $rev)
{{ $rev->component->name ?? '' }}: {{ number_format($rev->amount, 3) }}
@endforeach
@endforeach
@endif
โ† Back to Salaries
@endsection