{{-- |-------------------------------------------------------------------------- | ملف عرض قائمة الموظفين (employees.index) |-------------------------------------------------------------------------- | | يعرض هذا الملف جدولاً لجميع الموظفين مع إحصائيات علوية وخيارات تصفية متقدمة. | تم تحديثه ليعكس التغييرات في الموديل، خاصة حقل 'incentives' بدلاً من 'allowances'. | | التعديلات الرئيسية: | 1. إظهار 'البدلات/الحوافز (incentives)' بدلاً من 'العلاوات (allowances)'. | 2. إضافة زر الإضافة 'إضافة موظف جديد' تحت حماية الصلاحيات. | 3. تحديث منطق الفلترة (JavaScript) في الأسفل ليعمل بشكل صحيح. | 4. تضمين جميع العناصر المطلوبة مثل الترقيم والإحصائيات. | --}} @extends('layouts.app') @section('title', __('app.employees')) @section('content')
{{ __('employees.stats.inactive_title') }}
{{ __('employees.stats.inactive_subtitle') }}
{{ __('employees.stats.active_title') }}
{{ __('employees.stats.active_subtitle') }}
{{ __('employees.stats.pending_title') }}
{{ __('employees.stats.pending_subtitle') }}
{{ __('employees.stats.total_title') }}
{{ __('employees.stats.total_subtitle') }}
| {{ __('employees.table.photo') }} | {{ __('employees.table.name') }} | {{ __('employees.table.email') }} | {{ __('employees.table.department') }} | {{ __('employees.table.salary', ['currency' => $currency_name]) }} | {{-- ✅ الحقل المُعدّل: البدلات/الحوافز --}}{{ __('employees.table.incentives', ['currency' => $currency_name]) }} | {{ __('app.additional_components_total') }} | {{ __('app.overtime_hourly_rate_label') }} | {{ __('app.leave_accrual_label') }} | {{ __('app.missing_hours_deduction_label') }} | {{ __('app.overtime_hours_12m_label') }} | {{ __('app.overtime_status_label') }} | {{ __('app.overtime_pay_12m_label') }} | {{ __('employees.table.status') }} | {{ __('employees.table.position') }} | {{ __('employees.table.actions') }} |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
{{-- استخدام مسار التخزين العام --}}
|
{{-- عمود الاسم --}}
{{ $employee->name }}#{{ $employee->employee_id }} |
{{-- عمود البريد الإلكتروني --}}
{{ $employee->email }} | {{-- عمود القسم (للفلترة) --}}{{ $employee->department->name ?? __('employees.table.not_specified') }} | {{-- عمود الراتب الأساسي --}}{{ number_format($employee->salary ?? 0, 2) }} | {{-- ✅ عمود البدلات/الحوافز (المُعدّل) --}}{{ number_format($employee->incentives ?? 0, 2) }} | @php // relational components total (pivot value) try { if ($employee->relationLoaded('salaryComponents')) { $relComponents = $employee->salaryComponents->sum(fn($c) => (float) ($c->pivot->value ?? 0)); } else { $relComponents = $employee->salaryComponents()->sum('employee_salary_components.value'); } } catch (\Throwable $e) { $relComponents = 0; } // named components (component_1..component_7) $namedComponents = 0; for ($i = 1; $i <= 7; $i++) { $namedComponents += (float) ($employee->{"component_$i"} ?? 0); } $additionalTotal = $relComponents + $namedComponents; @endphp {{ number_format($additionalTotal ?? 0, 2) }} | {{ number_format($employee->overtime_hourly_rate ?? 0, 2) }} | @if($employee->accrue_leaves) {{ __('app.enabled') }} @else {{ __('app.disabled') }} @endif |
{{-- Deduct missing hours flag/status --}}
@if(isset($employee->deduct_if_underworked) && $employee->deduct_if_underworked)
{{ __('app.deduct_missing_hours_enabled') ?? 'خصم الساعات' }}
@if(isset($employee->missing_hours_deduction_amount))
{{ number_format($employee->missing_hours_deduction_amount,2) }}
@endif
@else
{{ __('app.deduct_missing_hours_disabled') ?? 'لا يخصم' }}
@endif
|
{{ number_format($employee->overtime_hours_last_12m ?? 0, 2) }} | {{-- Overtime paid flag/status --}} @if(isset($employee->overtime_paid) && $employee->overtime_paid) {{ __('app.overtime_paid') ?? 'يتم دفع الأوفرتايم' }} @else {{ __('app.overtime_not_paid') ?? 'غير مدفوع' }} @endif | {{ number_format($employee->overtime_pay_last_12m ?? 0, 2) }} | {{-- عمود الحالة (للفلترة) --}}@php $statusClass = ''; $statusText = ''; $statusKey = $employee->status; switch ($employee->status) { case 'active': $statusClass = 'badge-soft-success'; $statusText = __('app.status.active'); break; case 'inactive': $statusClass = 'badge-soft-danger'; $statusText = __('app.status.inactive'); break; case 'pending': $statusClass = 'badge-soft-warning'; $statusText = __('app.status.pending'); break; default: $statusClass = 'badge-soft-secondary'; $statusText = __('employees.status_unknown'); $statusKey = 'unknown'; break; } @endphp {{ $statusText }} | {{-- عمود الوظيفة (للفلترة) --}}{{ position_label($employee->position) ?? __('employees.table.not_specified') }} | {{-- عمود الإجراءات --}}|
|
{{ __('app.no_employees') }} |
|||||||||||||||