@extends('layouts.app') @section('title', 'عرض الميزانية - '.config('app.name')) @section('breadcrumb') الرئيسية المحاسبة الموازنات عرض @endsection @section('content')

{{ $budget->name }}

الفترة: {{ $budget->start_date->format('Y-m-d') }} - {{ $budget->end_date->format('Y-m-d') }}

السنة المالية: {{ $budget->fiscal_year }}

المخطط

SAR {{ erp_money((float) ($analysis['totals']['planned'] ?? 0)) }}

الفعلي

SAR {{ erp_money((float) ($analysis['totals']['actual'] ?? 0)) }}

@php $totalVariance = (float) ($analysis['totals']['variance'] ?? 0); $totalVarianceClass = $totalVariance > 0 ? 'text-red-600' : 'text-emerald-600'; @endphp

الانحراف

SAR {{ erp_money($totalVariance) }}

@forelse(($analysis['lines'] ?? []) as $line) @php $overBudget = (float) $line['actual'] > (float) $line['planned']; $varianceClass = $overBudget ? 'text-red-600' : 'text-emerald-700'; $barClass = $overBudget ? 'bg-red-500' : 'bg-emerald-500'; $consumePercent = max(0, min(100, (float) $line['consumption_percent'])); @endphp @empty @endforelse
الحساب مركز التكلفة المخطط الفعلي الانحراف نسبة الانحراف استهلاك الموازنة التوزيع الشهري
{{ $line['account_name'] }}
{{ $line['account_code'] }}
{{ $line['cost_center'] ?? '—' }} SAR {{ erp_money((float) $line['planned']) }} SAR {{ erp_money((float) $line['actual']) }} SAR {{ erp_money((float) $line['variance']) }} {{ erp_qty((float) $line['variance_percent']) }}%
{{ erp_qty((float) $line['consumption_percent']) }}%
عرض شهري
@foreach(($line['monthly'] ?? []) as $month) @endforeach
الشهر المخطط الفعلي الانحراف
{{ $month['label'] }} SAR {{ erp_money((float) $month['planned']) }} SAR {{ erp_money((float) $month['actual']) }} SAR {{ erp_money((float) $month['variance']) }}
لا توجد بنود داخل هذه الموازنة
@endsection