@extends('layouts.app') @php $locale = app()->getLocale(); $isRtl = $locale === 'ar'; $currency = \App\Models\Setting::currencyLabel($locale); $statusColors = [ 'draft' => 'bg-amber-100 text-amber-700 border-amber-200', 'posted' => 'bg-emerald-100 text-emerald-700 border-emerald-200', 'reversed' => 'bg-rose-100 text-rose-700 border-rose-200', ]; $statusLabels = [ 'draft' => $isRtl ? 'مسودة' : 'Draft', 'posted' => $isRtl ? 'مرحل' : 'Posted', 'reversed' => $isRtl ? 'معكوس' : 'Reversed', ]; @endphp @section('title', ($isRtl ? 'تفاصيل القيد' : 'Entry Details') . ' - ' . $entry->entry_number) @section('content')

{{ $isRtl ? 'تفاصيل القيد' : 'Entry Details' }}

{{ $entry->entry_number }}

{{ $statusLabels[$entry->status] ?? $entry->status }} @if($entry->status === 'draft')
@csrf
@endif @if($entry->status === 'posted') @endif

{{ $isRtl ? 'التاريخ' : 'Date' }}

{{ $entry->entry_date?->format('Y-m-d') ?? '—' }}

{{ $isRtl ? 'النوع' : 'Type' }}

{{ $entry->type }}

{{ $isRtl ? 'المرجع' : 'Reference' }}

{{ $entry->reference ?? '—' }}

{{ $isRtl ? 'المنشئ' : 'Created By' }}

{{ $entry->createdBy->name ?? '—' }}

{{ $isRtl ? 'الوصف' : 'Description' }}

{{ $entry->description }}

@if($entry->notes)

{{ $entry->notes }}

@endif
@if($entry->status === 'reversed')

{{ $isRtl ? 'سبب العكس' : 'Reversal Reason' }}

{{ $entry->reversal_reason ?? '—' }}

@endif

{{ $isRtl ? 'إجمالي المدين' : 'Total Debit' }}

{{ number_format((float)$entry->total_debit, 2) }} {{ $currency }}

{{ $isRtl ? 'إجمالي الدائن' : 'Total Credit' }}

{{ number_format((float)$entry->total_credit, 2) }} {{ $currency }}

{{ $isRtl ? 'التوازن' : 'Balance' }}

{{ ((float)$entry->total_debit === (float)$entry->total_credit) ? ($isRtl ? 'متوازن' : 'Balanced') : ($isRtl ? 'غير متوازن' : 'Not balanced') }}

{{ $isRtl ? 'بنود القيد' : 'Lines' }}

{{ $entry->lines->count() }} {{ $isRtl ? 'سطر' : 'lines' }}
@foreach($entry->lines as $line) @endforeach
{{ $isRtl ? 'الحساب' : 'Account' }} {{ $isRtl ? 'الوصف' : 'Description' }} {{ $isRtl ? 'مدين' : 'Debit' }} {{ $isRtl ? 'دائن' : 'Credit' }}

{{ $line->account->code ?? '—' }} — {{ $isRtl ? ($line->account->name_ar ?: $line->account->name) : ($line->account->name ?? '—') }}

{{ $line->account->type ?? '' }}

{{ $line->description ?? '—' }} {{ number_format((float)$line->debit, 2) }} {{ number_format((float)$line->credit, 2) }}
{{ $isRtl ? 'الإجمالي' : 'Total' }} {{ number_format((float)$entry->total_debit, 2) }} {{ number_format((float)$entry->total_credit, 2) }}
@if($entry->status === 'posted')

{{ $isRtl ? 'عكس القيد' : 'Reverse Entry' }}

{{ $entry->entry_number }} — {{ $entry->description }}

@csrf
@endif
@endsection