@extends('layouts.app') @php $locale = app()->getLocale(); $isRtl = $locale === 'ar'; $currency = \App\Models\Setting::currencyLabel($locale); $assetsTotal = (float)($totals['assets'] ?? 0); $liabilitiesTotal = (float)($totals['liabilities'] ?? 0); $equityTotal = (float)($totals['equity'] ?? 0); $balanced = abs($assetsTotal - ($liabilitiesTotal + $equityTotal)) < 0.01; @endphp @section('title', $isRtl ? 'الميزانية العمومية' : 'Balance Sheet') @section('content')

{{ $isRtl ? 'الميزانية العمومية' : 'Balance Sheet' }}

{{ $isRtl ? 'الأصول والخصوم وحقوق الملكية' : 'Assets, liabilities and equity' }}

{{ $balanced ? ($isRtl ? 'متوازنة' : 'Balanced') : ($isRtl ? 'غير متوازنة' : 'Not balanced') }}

{{ $isRtl ? 'الأصول' : 'Assets' }}

{{ number_format($assetsTotal, 2) }} {{ $currency }}
@forelse($assets as $row) @empty @endforelse
{{ $isRtl ? 'الحساب' : 'Account' }} {{ $isRtl ? 'الرصيد' : 'Balance' }}
{{ $row['account']->code ?? '—' }} — {{ $isRtl ? ($row['account']->name_ar ?: $row['account']->name) : ($row['account']->name ?? '—') }} {{ number_format((float)$row['balance'], 2) }}
{{ $isRtl ? 'لا توجد بيانات' : 'No data' }}

{{ $isRtl ? 'الخصوم' : 'Liabilities' }}

{{ number_format($liabilitiesTotal, 2) }} {{ $currency }}
@forelse($liabilities as $row) @empty @endforelse
{{ $isRtl ? 'الحساب' : 'Account' }} {{ $isRtl ? 'الرصيد' : 'Balance' }}
{{ $row['account']->code ?? '—' }} — {{ $isRtl ? ($row['account']->name_ar ?: $row['account']->name) : ($row['account']->name ?? '—') }} {{ number_format((float)$row['balance'], 2) }}
{{ $isRtl ? 'لا توجد بيانات' : 'No data' }}

{{ $isRtl ? 'حقوق الملكية' : 'Equity' }}

{{ number_format($equityTotal, 2) }} {{ $currency }}
@forelse($equity as $row) @empty @endforelse
{{ $isRtl ? 'الحساب' : 'Account' }} {{ $isRtl ? 'الرصيد' : 'Balance' }}
{{ $row['account']->code ?? '—' }} — {{ $isRtl ? ($row['account']->name_ar ?: $row['account']->name) : ($row['account']->name ?? '—') }} {{ number_format((float)$row['balance'], 2) }}
{{ $isRtl ? 'لا توجد بيانات' : 'No data' }}

{{ $isRtl ? 'معادلة الميزانية' : 'Balance Equation' }}

{{ $isRtl ? 'الأصول = الخصوم + حقوق الملكية' : 'Assets = Liabilities + Equity' }}

{{ number_format($assetsTotal, 2) }} = {{ number_format($liabilitiesTotal, 2) }} + {{ number_format($equityTotal, 2) }} {{ $currency }}

@endsection