@can('erp.manage-expenses') @if (in_array($expense->status, ['draft', 'pending_approval', 'rejected'], true)) Edit @endif @endcan @can('erp.approve-expenses') @if ($expense->status === 'pending_approval')
@csrf @method('PATCH')
@elseif ($expense->status === 'approved')
@csrf @method('PATCH')
@endif @endcan @can('erp.manage-expenses') @if (in_array($expense->status, ['draft', 'rejected'], true))
@csrf @method('DELETE')
@endif @endcan
@if ($expense->status === 'rejected' && $expense->rejection_reason)

Rejected{{ $expense->approvedBy ? ' by '.$expense->approvedBy->name : '' }}{{ $expense->approved_at ? ' on '.$expense->approved_at->format('d M Y H:i') : '' }}

{{ $expense->rejection_reason }}

@endif

Expense details

Raised {{ $expense->created_at->format('d M Y H:i') }}

Category
{{ $expense->category?->name ?? '—' }}
Department
{{ $expense->department?->name ?? 'Hospital-wide' }}
Expense date
{{ $expense->expense_date->format('d M Y') }}
Payment method
Payee
{{ $expense->payee ?? '—' }}
Reference number
{{ $expense->reference_number ?? '—' }}
@if ($expense->notes)
Notes
{{ $expense->notes }}
@endif

Amounts

All figures in Kenya shillings.

Net amount
{{ money($expense->amount) }}
Tax / VAT
{{ money($expense->tax_amount) }}
Total
{{ money($expense->total_amount) }}

Ledger posting

Purchases & supply chain journal.

@if ($postingEntry)
{{ $postingEntry->entry_no }}

Posted {{ $postingEntry->posted_at?->format('d M Y H:i') ?? $postingEntry->entry_date->format('d M Y') }}

{{ money($postingEntry->total_debit) }}
@elseif ($expense->status === 'paid')

This expense is marked paid but no ledger entry was found. Review the journal entries for this source record.

@else

No ledger entry yet — the expense is posted to the general ledger automatically when it is marked paid.

@endif

Approval trail

Who raised, approved and paid this expense.

Status
Requested by
{{ $expense->requestedBy?->name ?? '—' }}
@if ($expense->approved_at)
Decided by
{{ $expense->approvedBy?->name ?? '—' }}
{{ $expense->approved_at->format('d M Y H:i') }}
@endif @if ($expense->paid_at)
Paid at
{{ $expense->paid_at->format('d M Y H:i') }}
@endif
@csrf @method('PATCH')

Reject {{ $expense->expense_no }}

The requester will see the reason and can correct and resubmit the expense.