@extends('layouts.app') @php $locale = app()->getLocale(); $isRtl = $locale === 'ar'; $currency = \App\Models\Setting::currencyLabel($locale); @endphp @section('title', $isRtl ? 'دفتر اليومية' : 'Journal') @section('content')

{{ $isRtl ? 'دفتر اليومية' : 'Journal' }}

{{ $isRtl ? 'القيود المحاسبية' : 'Accounting journal entries' }}

{{ $isRtl ? 'إجمالي القيود' : 'Total Entries' }}

{{ $stats['total_entries'] ?? 0 }}

{{ $isRtl ? 'مسودات' : 'Draft' }}

{{ $stats['draft'] ?? 0 }}

{{ $isRtl ? 'مرحّلة' : 'Posted' }}

{{ $stats['posted'] ?? 0 }}

{{ $isRtl ? 'إعادة ضبط' : 'Reset' }}
@forelse($entries as $entry) @if($entry->status === 'posted')

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

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

@csrf
@endif @empty @endforelse
{{ $isRtl ? 'رقم القيد' : 'Entry No.' }} {{ $isRtl ? 'التاريخ' : 'Date' }} {{ $isRtl ? 'الوصف' : 'Description' }} {{ $isRtl ? 'الإجمالي' : 'Total' }} {{ $isRtl ? 'الحالة' : 'Status' }} {{ $isRtl ? 'إجراءات' : 'Actions' }}
{{ $entry->entry_number }}

{{ $entry->type }}

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

{{ $entry->description }}

{{ $isRtl ? 'بواسطة:' : 'By:' }} {{ $entry->createdBy->name ?? '—' }}

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

{{ $currency }}

@php $statusColors = [ 'draft' => 'bg-amber-100 text-amber-700', 'posted' => 'bg-emerald-100 text-emerald-700', 'reversed' => 'bg-rose-100 text-rose-700', ]; $statusLabels = [ 'draft' => $isRtl ? 'مسودة' : 'Draft', 'posted' => $isRtl ? 'مرحل' : 'Posted', 'reversed' => $isRtl ? 'معكوس' : 'Reversed', ]; @endphp {{ $statusLabels[$entry->status] ?? $entry->status }}
@if($entry->status === 'draft')
@csrf
@endif @if($entry->status === 'posted') @endif

{{ $isRtl ? 'لا توجد قيود' : 'No entries found' }}

@if($entries->hasPages())
{{ $entries->withQueryString()->links() }}
@endif
@endsection