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

{{ $expense->title }}

{{ $expense->status_label }}
{{ __('common.edit') }} @if($expense->status === 'pending') @endif

{{ __('expense.project') }}

{{ $expense->project?->name ?? '-' }}

{{ __('expense.category') }}

{{ __('expense.category_' . $expense->category) }}

{{ __('expense.amount') }}

{{ format_currency((float)$expense->amount, $expense->currency?->code) }}

@if($expense->original_amount && $expense->original_amount != $expense->amount)

{{ __('expense.original_amount') ?? 'مبلغ اصلی' }}: {{ format_currency((float)$expense->original_amount, $expense->currency?->code) }}

@endif

{{ __('expense.date') }}

{{ $expense->expense_date ? calendar_date($expense->expense_date) : '-' }}

@if($expense->invoice_number)

{{ __('expense.invoice_number') }}

{{ $expense->invoice_number }}

@endif

{{ __('expense.requested_by') ?? 'درخواست‌کننده' }}

{{ $expense->requestedBy?->name ?? '-' }}

@if($expense->approvedBy)

{{ __('expense.approved_by') ?? 'تأییدکننده' }}

{{ $expense->approvedBy?->name }}

@endif @if($expense->approval_date)

{{ __('expense.approval_date') ?? 'تاریخ تأیید' }}

{{ calendar_date($expense->approval_date) }}

@endif @if($expense->pettyCash)

{{ __('expense.petty_cash') ?? 'تنخواه' }}

{{ $expense->pettyCash->title ?? '#' . $expense->petty_cash_id }}
@endif
@if($expense->description)

{{ __('expense.description') }}

{{ $expense->description }}

@endif
@if($expense->receipt_path)

{{ __('expense.receipt') }}

@if(str_ends_with(strtolower($expense->receipt_path), '.pdf'))
@else
Receipt
@endif

{{ basename($expense->receipt_path) }}

{{ __('letter.download') }}
@endif

{{ __('attachment.attachments') }} @if($expense->attachments->count() > 0) {{ $expense->attachments->count() }} @endif

@if($expense->attachments->count() > 0)
@foreach($expense->attachments as $attachment)
@if($attachment->is_image)
{{ $attachment->file_name }}
@elseif($attachment->is_pdf)
@else
@endif
{{ $attachment->file_name }}

{{ $attachment->formatted_size }} • {{ $attachment->created_at?->format('Y/m/d H:i') }}

@can('delete', $attachment) @endcan
@endforeach
@else

{{ __('attachment.no_attachments') }}

@endif
@push('scripts') @endpush @endsection