@extends('layouts.app') @section('title', 'Expense — '.$expense->description) @section('content')

{{ \Illuminate\Support\Str::limit($expense->description, 60) }}

{{ title_case_words($expense->category) }} · {{ $expense->expense_date?->format('d M Y') }}

Print @if ($expense->status === 'draft') Edit
@csrf
@endif @if (in_array($expense->status, ['draft', 'submitted'], true))
@csrf
@csrf
@endif
@include('components.kpi', ['label' => 'Amount', 'value' => money($expense->amount), 'variant' => 'info']) @include('components.kpi', ['label' => 'Status', 'value' => title_case_words($expense->status), 'variant' => $expense->status === 'approved' ? 'good' : ($expense->status === 'rejected' ? 'bad' : 'warn')]) @include('components.kpi', ['label' => 'Account', 'value' => $expense->account?->code ?: '—']) @include('components.kpi', ['label' => 'Settled by', 'value' => title_case_words($expense->payment_method ?? 'cash')])

Details

Description
{{ $expense->description }}
Category
{{ title_case_words($expense->category) }}
Vendor
{{ $expense->vendor ?: '—' }}
Amount
{{ money($expense->amount) }}
Date
{{ $expense->expense_date?->format('d M Y') }}
Reference
{{ $expense->reference ?: '—' }}
Settled by
{{ title_case_words($expense->payment_method ?? 'cash') }}
Branch
{{ $expense->branch?->name ?: 'Organisation-wide' }}
Recorded by
{{ $expense->recordedBy?->name ?: '—' }}
@if ($expense->receipt_path)
Receipt
{{ $expense->receipt_path }}
@endif
@if ($expense->status !== 'approved')
@csrf @method('DELETE')
@endif

Ledger effect

@if ($expense->status === 'approved')
AccountDebitCredit
{{ $expense->account?->code }} — {{ $expense->account?->name }} {{ money($expense->amount) }}
{{ $expense->payment_method === 'on_credit' ? 'Accounts payable' : ($expense->payment_method === 'momo' ? 'Mobile money float' : 'Cash at bank') }} {{ money($expense->amount) }}

Posted to the general ledger — see the journal and the profit & loss.

@else @include('components.empty-state', [ 'icon' => '📒', 'title' => 'Not yet posted', 'message' => 'Approving this expense will debit the ledger account and credit the settlement account, and it will then appear on the profit & loss report.', ]) @endif
@endsection