{{-- resources/views/employees/show.blade.php --}} @extends('layouts.app') @section('content')
{{ __('employees.show.jump_description') }}
Profile Picture

{{ $employee->name }}

{{ $employee->position->name ?? __('employees.show.profile.position_placeholder') }}

{{ $employee->department->name ?? __('employees.show.profile.department_placeholder') }}

{{ __('employees.show.profile.badges.id') }}: {{ $employee->employee_id }} {{ $employee->email }} {{ $employee->phone ?? __('employees.show.profile.position_placeholder') }}
@can('edit employee') {{ __('employees.show.actions.edit') }} @endcan @can('delete employee')
@csrf @method('DELETE')
@endcan {{ __('employees.show.actions.back') }}
{{ __('employees.show.sections.personal_info') }}

{{ $employee->birth_date ? $employee->birth_date->format('Y-m-d') : __('employees.table.not_specified') }}

{{ $employee->age ? $employee->age . ' ' . __('employees.show.personal.age_unit') : __('employees.table.not_specified') }}

{{ $employee->national_id ?? __('employees.table.not_specified') }}

{{ $employee->qualification ?? __('employees.table.not_specified') }}

{{ $employee->address ?? __('employees.table.not_specified') }}

@php $statusLabel = __('employees.show.personal.status_labels.' . ($employee->status ?? 'unknown')); $statusClass = match ($employee->status) { 'active' => 'bg-success', 'inactive' => 'bg-secondary', 'pending' => 'bg-warning', default => 'bg-dark', }; @endphp {{ $statusLabel }}

{{ __('employees.show.sections.salary_components') }}
@php $allComponents = $employee->addition_components; $totalSalary = $employee->getTotalSalaryWithComponentsAttribute(); @endphp @if($allComponents && $allComponents->count() > 0)
@foreach($allComponents as $comp) @endforeach
{{ __('employees.show.salary.name') }} {{ __('employees.show.salary.value') }}
{{ $comp['name'] }} {{ number_format($comp['value'], 2) }}
@else

{{ __('employees.show.salary.no_components') }}

@endif
{{ __('employees.show.salary.total') }} {{ number_format($totalSalary, 2) }} {{ get_currency_code() }}
{{-- Salary history (effective-dated compensation) --}} @include('employees.partials.salary_histories', ['employee' => $employee, 'histories' => $employee->salaryHistories()->orderBy('effective_from', 'desc')->get()])
{{ __('employees.show.leave_accrual.title') }}
{{ __('employees.show.leave_accrual.print') }}
@php $leaveMonthlyDetails = $employee->calculateLeaveDeductionDetailsNew(now()->year, now()->month); @endphp @if(!$employee->isAccrualEnabled()) @elseif($leaveMonthlyDetails && count($leaveMonthlyDetails) > 0)
@foreach($leaveMonthlyDetails as $detail) @endforeach
{{ __('employees.show.leave_accrual.labels.monthly') }} {{ __('employees.show.leave_accrual.labels.annual') }}
{{ __('employees.show.leave_accrual.columns.year') }} {{ __('employees.show.leave_accrual.columns.month') }} {{ __('employees.show.leave_accrual.columns.granted') }} (شهري) {{ __('employees.show.leave_accrual.columns.used') }} (شهري) {{ __('employees.show.leave_accrual.columns.balance_before') }} (شهري) {{ __('employees.show.leave_accrual.columns.balance_after') }} (شهري) {{ __('employees.show.leave_accrual.columns.excess') }} (شهري) {{ __('employees.show.leave_accrual.columns.amount', ['currency' => get_currency_code()]) }} (شهري) الإجمالي
{{ get_currency_code() }}
{{ __('employees.show.leave_accrual.columns.used') }} (سنوي) {{ __('employees.show.leave_accrual.columns.balance_before') }} (سنوي) {{ __('employees.show.leave_accrual.columns.balance_after') }} (سنوي) {{ __('employees.show.leave_accrual.columns.excess') }} (سنوي) {{ __('employees.show.leave_accrual.columns.amount', ['currency' => get_currency_code()]) }} (سنوي) {{ __('employees.show.leave_accrual.columns.annual_entitlement') }}
{{ $detail['year'] }} {{ $detail['month_name'] ?? \Carbon\Carbon::create()->month($detail['month'])->translatedFormat('F') }} {{ number_format($detail['granted_monthly'] ?? 0, 2) }} {{ number_format($detail['used_monthly'] ?? 0, 2) }} {{ number_format($detail['balance_before_monthly'] ?? 0, 2) }} {{ number_format($detail['balance_after_monthly'] ?? 0, 2) }} {{ number_format($detail['excess_monthly'] ?? 0, 2) }} {{ format_currency($detail['deduction_amount_monthly'] ?? 0) }} {{ format_currency($detail['leave_deduction_amount'] ?? 0) }} {{ number_format($detail['used_annual'] ?? 0, 2) }} {{ number_format($detail['balance_before_annual'] ?? 0, 2) }} {{ number_format($detail['balance_after_annual'] ?? 0, 2) }} {{ number_format($detail['excess_annual'] ?? 0, 2) }} {{ format_currency($detail['deduction_amount_annual'] ?? 0) }} {{ number_format($employee->annual_entitlement ?? ($employee->monthly_leave_days_allowed * 12), 2) }}
@php $currentYear = now()->year; $currentYearMonthlyDeductions = $leaveMonthlyDetails ->filter(fn($d) => $d['year'] == $currentYear) ->sum('deduction_amount_monthly'); $currentYearAnnualDeductions = $leaveMonthlyDetails ->filter(fn($d) => $d['year'] == $currentYear) ->sum('deduction_amount_annual'); $totalCurrentYearDeductions = $currentYearMonthlyDeductions + $currentYearAnnualDeductions; @endphp @else @endif
{{ __('employees.show.attendance.title') }}
{{ __('employees.show.filters.print_record') }}
@forelse($attendances as $attendance) @empty @endforelse
{{ __('employees.show.attendance.columns.date') }} {{ __('employees.show.attendance.columns.check_in') }} {{ __('employees.show.attendance.columns.check_out') }} {{ __('employees.show.attendance.columns.duration') }} {{ __('payroll.labels.overtime_hours') }} {{ __('payroll.labels.overtime_amount') }} {{ __('payroll.labels.underworked_hours') }} {{ __('payroll.labels.underworked_amount') }} {{ __('employees.show.attendance.columns.status') }} {{ __('employees.show.attendance.columns.actions') }}
{{ $attendance->date->format('Y-m-d') }} {{ $attendance->check_in ?? '—' }} {{ $attendance->check_out ?? '—' }} {{ $attendance->duration ?? '—' }} {{ number_format($attendance->getOvertimeHours(), 2) }} {{ number_format((($employee->overtime_paid ?? true) ? ($attendance->getOvertimeHours() * ($employee->overtime_hourly_rate ?? 0)) : 0), 2) }} {{ get_currency_code() }} {{ number_format($attendance->getUnderworkedHours(), 2) }} {{ number_format($attendance->getUnderworkedValue(), 2) }} {{ get_currency_code() }} @php $displayStatus = $attendance->status; @endphp @if($displayStatus === 'present_on_official_holiday') {{ __('calendar.statuses.present_on_official_holiday') }} @elseif($displayStatus === 'present_on_weekly_off') {{ __('calendar.statuses.present_on_weekly_off') }} @else {{ __('app.attendance_status.' . $attendance->status) }} @endif
{{ __('employees.show.attendance.no_records') }}
{{ __('employees.show.leaves.title') }}
{{ __('employees.show.filters.print_record') }}
@forelse($leaves as $leave) @empty @endforelse
{{ __('employees.show.leaves.columns.id') }} {{ __('employees.show.leaves.columns.type') }} {{ __('employees.show.leaves.columns.start') }} {{ __('employees.show.leaves.columns.end') }} {{ __('employees.show.leaves.columns.days') }} {{ __('employees.show.leaves.columns.reason') }} {{ __('employees.show.leaves.columns.status') }} {{ __('employees.show.leaves.columns.actions') }}
{{ $leave->id }} {{ __('app.leave_types.' . $leave->leave_type) }} {{ $leave->start_date->format('Y-m-d') }} {{ $leave->end_date->format('Y-m-d') }} {{ $leave->days_count }} {{ Str::limit($leave->reason, 30) }} {{ __('employees.show.leaves.statuses.' . $leave->status) }} @can('view leave') @endcan @can('edit leave') @endcan @can('delete leave')
@csrf @method('DELETE')
@endcan
{{ __('employees.show.leaves.no_records') }}
{{ __('employees.show.loans.title') }}
{{ __('employees.show.filters.print_record') }}
@forelse($loans as $loan) @empty @endforelse
{{ __('employees.show.loans.columns.id') }} {{ __('employees.show.loans.columns.amount') }} {{ __('employees.show.loans.columns.interest') }} {{ __('employees.show.loans.columns.total') }} {{ __('employees.show.loans.columns.installments') }} {{ __('employees.show.loans.columns.monthly') }} {{ __('employees.show.loans.columns.date') }} {{ __('employees.show.loans.columns.status') }} {{ __('employees.show.loans.columns.actions') }}
{{ $loan->id }} {{ number_format($loan->amount, 2) }} {{ get_currency_code() }} {{ number_format($loan->interest_rate, 2) }}% {{ number_format($loan->total_amount, 2) }} {{ get_currency_code() }} {{ $loan->installment_count }} {{ number_format($loan->installment_amount, 2) }} {{ get_currency_code() }} {{ $loan->created_at->format('Y-m-d H:i') }} @php $loanStatusClass = match ($loan->status) { 'pending' => 'badge-warning', 'approved' => 'badge-primary', 'active' => 'badge-success', 'rejected' => 'badge-danger', 'paid' => 'badge-info', 'cancelled' => 'badge-secondary', default => 'badge-dark', }; @endphp {{ __('employees.show.loans.statuses.' . ($loan->status ?? 'unknown')) }} @can('view loan') @endcan @can('edit loan') @endcan @can('delete loan')
@csrf @method('DELETE')
@endcan
{{ __('employees.show.loans.no_records') }}
{{ __('employees.show.deductions.title') }}
{{ __('employees.show.filters.print_record') }}
@forelse($deductions as $deduction) @php $rawType = (string) ($deduction->type ?? ''); $typeTranslations = [ 'social_insurance' => 'التأمين الاجتماعي', 'health_insurance' => 'التأمين الصحي', 'health-insurance' => 'التأمين الصحي', 'health insurance' => 'التأمين الصحي', 'healthinsurance' => 'التأمين الصحي', 'loan' => 'سداد القرض', 'tax' => 'الضرائب', 'penalty' => 'غرامة', 'other' => 'أخرى', 'miscellaneous' => 'متفرقات', 'pension' => 'التقاعد', 'unemployment' => 'التأمين ضد البطالة', ]; $typeLabel = $typeTranslations[strtolower($rawType)] ?? \Illuminate\Support\Str::title(str_replace(['_', '-'], ' ', $rawType)); @endphp @empty @endforelse
{{ __('employees.show.deductions.columns.id') }} {{ __('employees.show.deductions.columns.description') }} {{ __('employees.show.deductions.columns.amount') }} {{ __('employees.show.deductions.columns.type') }} {{ __('employees.show.deductions.columns.date') }} {{ __('employees.show.deductions.columns.status') }} {{ __('employees.show.deductions.columns.actions') }}
{{ $deduction->id }} {{ $deduction->description }} {{ number_format($deduction->amount, 2) }} {{ get_currency_code() }}{{ $typeLabel }} {{ $deduction->deduction_date->format('Y-m-d') }} @php $deductionStatusClass = match ($deduction->status) { 'applied' => 'badge-success', 'pending' => 'badge-warning', 'cancelled' => 'badge-secondary', default => 'badge-dark', }; @endphp {{ $deduction->status }} @can('view deduction') @endcan @can('edit deduction') @endcan @can('delete deduction')
@csrf @method('DELETE')
@endcan
{{ __('employees.show.deductions.no_records') }}
{{ __('employees.show.paid_salaries.title') }}
{{ __('employees.show.filters.print_record') }}
@forelse($paidPayrolls as $payroll) @empty @endforelse
الشهر والسنة تاريخ الدفع عرض الراتب
{{ \Carbon\Carbon::create()->month($payroll->month)->translatedFormat('F') }} {{ $payroll->year }} {{ $payroll->paid_at ? $payroll->paid_at->format('Y-m-d H:i') : __('employees.show.paid_salaries.not_paid') }} عرض الراتب
{{ __('employees.show.paid_salaries.no_records') }}
@push('scripts') @push('styles') @endpush @endpush @endsection