@extends('layouts.app') @section('content')

{{ app()->getLocale() == 'ar' ? 'تفاصيل المصروف' : 'Expense Details' }}

{{ app()->getLocale() == 'ar' ? 'تعديل' : 'Edit' }} {{ app()->getLocale() == 'ar' ? 'عودة' : 'Back' }}
{{ number_format($expense->amount, 2) }} SAR
{{ $expense->status == 'confirmed' ? (app()->getLocale() == 'ar' ? 'مؤكد' : 'Confirmed') : (app()->getLocale() == 'ar' ? 'ملغي' : 'Cancelled') }}
{{ $expense->expense_date->format('Y-m-d') }}
{{ $expense->category->name }}
{{ $expense->payment_method }}
{{ $expense->branch?->name ?? (app()->getLocale() == 'ar' ? 'الرئيسي' : 'Main') }}
@if($expense->car)
🚗 {{ $expense->car->brand?->name }} ({{ $expense->car->plate_number }})
@elseif($expense->rental)
📄 {{ app()->getLocale() == 'ar' ? 'عقد' : 'Contract' }} #{{ $expense->rental->contract_number }}
{{ $expense->rental->customer->name }}
@else
{{ app()->getLocale() == 'ar' ? 'مصروف عام' : 'General Expense' }}
@endif
@if($expense->description)
{{ $expense->description }}
@endif @if($expense->status == 'cancelled')
{{ $expense->cancellation_reason }}
@endif @if($expense->attachment)
@php $extension = pathinfo($expense->attachment, PATHINFO_EXTENSION); $isImage = in_array(strtolower($extension), ['jpg', 'jpeg', 'png', 'gif']); @endphp @if($isImage) @else
@endif {{ app()->getLocale() == 'ar' ? 'تحميل المرفق' : 'Download Attachment' }}
@endif
{{ app()->getLocale() == 'ar' ? 'بواسطة:' : 'Created By:' }} {{ $expense->creator->name }} | {{ app()->getLocale() == 'ar' ? 'تاريخ الإنشاء:' : 'Created At:' }} {{ $expense->created_at->format('Y-m-d H:i') }}
@endsection