@php $categoryLabel = \App\Models\ExpenseDetail::categoryOptions()[$expense->category] ?? ucfirst($expense->category); $isPosted = $expense->isPosted(); @endphp

View Expense #{{ $expense->id }}

@if (!$isPosted) @can('expense-detail-edit') Edit @endcan @can('expense-detail-post')
@csrf
@endcan @can('expense-detail-delete')
@csrf @method('DELETE')
@endcan @endif
{{-- Posted badge --}} @if ($isPosted)
Posted by {{ $expense->postedByUser?->name ?? 'N/A' }} on {{ $expense->posted_at?->format('d M Y H:i') }} @if ($expense->journalEntry) — JE #{{ $expense->journalEntry->entry_number ?? $expense->journal_entry_id }} @endif
@else
Draft
@endif
{{-- Row 1: Category, Date, Amount --}}
{{-- Fuel-specific --}} @if ($expense->category === 'fuel')
@endif {{-- Salaries-specific --}} @if ($expense->category === 'salaries')
@endif {{-- Row: Debit, Credit --}}
{{-- Description & Notes --}}
{{-- Timestamps --}}
{{-- Password Modal for Post --}} @if (!$isPosted) @endif