@extends('layouts.app') @section('title', 'مراكز التكلفة - DOTS HR Pro') @push('styles') @endpush @section('content') @php $costCenters = $costCenters ?? collect(); @endphp @if(session('success'))
{{ session('success') }}
@endif
@if($costCenters->count() > 0)
@foreach($costCenters as $center) @php $utilization = ($center->budget ?? 0) > 0 ? round(($center->actual_spend / $center->budget) * 100, 1) : 0; $barColor = $utilization > 90 ? '#ef4444' : ($utilization > 70 ? '#f59e0b' : '#10b981'); @endphp @endforeach
الرمز الاسم القسم الميزانية الإنفاق الفعلي نسبة الاستخدام الإجراءات
{{ $center->code ?? '-' }} {{ $center->name ?? '-' }} {{ $center->department->name ?? $center->department ?? '-' }} {{ number_format($center->budget ?? 0, 2) }} ر.س {{ number_format($center->actual_spend ?? 0, 2) }} ر.س
{{ $utilization }}%
@if(Route::has('cost-centers.edit')) @endif
@if(method_exists($costCenters, 'links'))
{{ $costCenters->links() }}
@endif @else

لا توجد مراكز تكلفة

@endif
@endsection