@extends('layouts.app') @section('title', $costCenter->name) @section('content') @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
{{ number_format($costCenter->annual_budget, 0) }}
الميزانية السنوية
{{ number_format($costCenter->spent_amount, 0) }}
المصروف
{{ number_format($costCenter->remaining_budget, 0) }}
المتبقي
{{ number_format($salaryCost, 0) }}
تكلفة الرواتب الشهرية

استخدام الميزانية

@php $usage = $costCenter->budget_usage_percent; @endphp
{{ $usage }}%
المصروف: {{ number_format($costCenter->spent_amount, 0) }} ر.س الميزانية: {{ number_format($costCenter->annual_budget, 0) }} ر.س

البيانات الأساسية

الرمز{{ $costCenter->code }}
الاسم{{ $costCenter->name }}
الاسم الإنجليزي{{ $costCenter->name_en ?? '—' }}
النوع{{ $costCenter->type_label }}
المركز الرئيسي{{ $costCenter->parent ? $costCenter->parent->name : 'مركز رئيسي' }}
مدير المركز{{ $costCenter->manager_name ?? '—' }}
البريد{{ $costCenter->manager_email ?? '—' }}
الحالة{{ $costCenter->is_active ? 'نشط' : 'غير نشط' }}
@if($costCenter->description)
الوصف{{ $costCenter->description }}
@endif
@if($costCenter->children->isNotEmpty())

المراكز الفرعية ({{ $costCenter->children->count() }})

@foreach($costCenter->children as $child) @endforeach
الرمزالاسمالنوعالميزانيةالحالة
{{ $child->code }} {{ $child->name }} {{ $child->type_label }} {{ number_format($child->annual_budget, 0) }} {{ $child->is_active ? 'نشط' : 'غير نشط' }}
@endif

الأقسام المرتبطة ({{ $costCenter->departments->count() }})

@csrf
@if($costCenter->departments->isNotEmpty())
@foreach($deptBreakdown as $item) @endforeach
القسمعدد الموظفينتكلفة الرواتب
{{ $item['department']->name }} {{ $item['employee_count'] }} {{ number_format($item['salary_cost'], 0) }} ر.س
@else

لا توجد أقسام مرتبطة

@endif

الموظفون ({{ $costCenter->employees->count() }})

@csrf
@if($costCenter->employees->isNotEmpty())
@foreach($costCenter->employees as $emp) @endforeach
الرمزالاسمالقسمالراتب الأساسيإجمالي الحزمةإجراء
{{ $emp->employee_code }} {{ $emp->first_name }} {{ $emp->last_name }} {{ $emp->department->name ?? '—' }} {{ number_format($emp->basic_salary, 0) }} {{ number_format($emp->basic_salary + ($emp->housing_allowance ?? 0) + ($emp->transport_allowance ?? 0) + ($emp->other_allowances ?? 0), 0) }}
@csrf @method('DELETE')
@else

لا يوجد موظفون معيّنون

@endif
@endsection