Process Cashbook Entry

Back to Processing
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
@php $entry = $entry ?? null; @endphp
@csrf @if($entry) @method('PUT') @endif

Entry Details

@php $selectedCashbookId = old('cashbook_id', $entry->cashbook_id ?? ''); $selectedCashbook = collect($cashbooks ?? [])->firstWhere('id', $selectedCashbookId); $selectedCashbookLabel = $selectedCashbook ? $selectedCashbook->name . ' - ' . $selectedCashbook->account_number : ''; @endphp @foreach($cashbooks ?? [] as $cashbook) @endforeach
@php $selectedMatterId = old('matter_id', $entry->matter_id ?? ''); $selectedMatter = collect($matters ?? [])->firstWhere('id', $selectedMatterId); $selectedMatterLabel = $selectedMatter ? $selectedMatter->matter_number : ''; @endphp
Reference number or code

Cashbook Entries

@forelse($cashbookEntries ?? [] as $entryRow) @empty @endforelse
Date Cashbook Type Amount Client Matter Trust Account Reference Description Actions
{{ $entryRow->transaction_date ? $entryRow->transaction_date->format('d/m/Y') : '' }} {{ $entryRow->cashbook?->name ?? 'N/A' }} {{ ucfirst($entryRow->transaction_type ?? '') }} {{ number_format($entryRow->amount, 2) }} {{ $entryRow->client?->full_name ?? trim(($entryRow->client?->first_name ?? '') . ' ' . ($entryRow->client?->last_name ?? '')) ?: 'N/A' }} {{ $entryRow->matter?->matter_number ?? $entryRow->matter?->matter_title ?? 'N/A' }} {{ $entryRow->trustAccount?->account_number ?? 'N/A' }} {{ $entryRow->reference ?? '-' }} {{ \Illuminate\Support\Str::limit($entryRow->description, 30) }} Edit
No cashbook entries found. Create your first entry using the form.
@if(isset($cashbookEntries) && $cashbookEntries->count() > 0) @php $totalReceipts = $cashbookEntries->where('transaction_type', 'receipt')->sum('amount'); $totalPayments = $cashbookEntries->where('transaction_type', 'payment')->sum('amount'); $totalTransfers = $cashbookEntries->where('transaction_type', 'transfer')->sum('amount'); @endphp
Total Entries: {{ $cashbookEntries->count() }}
Total Receipts: {{ number_format($totalReceipts, 2) }}
Total Payments: {{ number_format($totalPayments, 2) }}
Total Transfers: {{ number_format($totalTransfers, 2) }}
@endif