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

Transactions

Manage your financial transactions

@if (session('success'))

{{ session('success') }}

@endif @if (session('error'))

{{ session('error') }}

@endif

Total Income

${{ number_format($summary['total_income_usd'] ?? 0, 2) }}

@if (($summary['total_income_khr'] ?? 0) > 0)

៛{{ number_format($summary['total_income_khr'] ?? 0, 2) }}

@endif

Total Expenses

${{ number_format($summary['total_expenses_usd'] ?? 0, 2) }}

@if (($summary['total_expenses_khr'] ?? 0) > 0)

៛{{ number_format($summary['total_expenses_khr'] ?? 0, 2) }}

@endif

Net Balance

${{ number_format($summary['net_balance_usd'] ?? 0, 2) }}

@if (($summary['total_income_khr'] ?? 0) > 0 || ($summary['total_expenses_khr'] ?? 0) > 0)

៛{{ number_format($summary['net_balance_khr'] ?? 0, 2) }}

@endif

Total Transactions

{{ $summary['total_count'] ?? 0 }}

Filters

{{--
--}}

Recent Transactions

{{ $transactions->firstItem() ?? 0 }}–{{ $transactions->lastItem() ?? 0 }} of {{ $transactions->total() ?? 0 }}
@if ($transactions->count() > 0)
@foreach ($transactions as $transaction)
{{ $transaction->description ?: 'No description' }}
{{ $transaction->transaction_date->format('M d, Y') }}
@if ($transaction->amount_usd)
${{ number_format($transaction->amount_usd, 2) }}
@endif @if ($transaction->amount_khr)
៛{{ number_format($transaction->amount_khr, 2) }}
@endif
@if ($transaction->type == 'income') Income @elseif($transaction->type == 'expense') Expense @else Transfer @endif @if ($transaction->is_cleared) Cleared @endif
{{ $transaction->account->name ?? 'N/A' }} • {{ $transaction->category->name ?? 'Uncategorized' }}
@endforeach
{{ $transactions->appends(request()->query())->links() }}
@else

No transactions found

Get started by adding your first transaction.

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