@extends('layouts.app') @section('title', 'Bank Book') @section('page', 'bank-book') @section('bankNav', 'entries') @php $typeVariant = fn ($t) => $t === 'In' ? 'success' : 'danger'; $statusVariant = fn ($s) => $s === 'Active' ? 'success' : 'danger'; $presetCategories = [ 'Opening Balance', 'Deposit', 'Withdrawal', 'Cheque', 'Transfer', 'Interest', 'Sales', ]; $categoryOptions = collect($presetCategories) ->merge($expenseCategories ?? []) ->merge($categories ?? []) ->unique() ->sort() ->values(); $defaultAccountId = $selectedAccountId ?: ($bankAccounts->first()?->id); @endphp @section('content') @include('partials.account-bank-nav') @if (session('success')) {{ session('success') }} @endif @if ($errors->any()) {{ $errors->first() }} @endif @if ($selectedAccountId) @endif

Opening Balance

{{ money($openingBalance) }}

Balance before {{ $dateFrom }}

Total In

{{ money($totalIn) }}

Bank deposits

Total Out

{{ money($totalOut) }}

Bank withdrawals

Closing Balance

{{ money($currentBalance) }}

As of {{ $dateTo }}

@forelse ($entries as $row) {{ $row->entry_date->format('Y-m-d') }} {{ $row->bankAccount?->name ?? ($selectedAccountName ?? '—') }} {{ $row->category }} {{ preg_match('/^(Bill No\s+\d+)/i', (string) $row->notes, $m) ? $m[1] : ($row->notes ?: '—') }} {{ $row->type === 'In' ? money((float) $row->amount) : '—' }} {{ $row->type === 'Out' ? money((float) $row->amount) : '—' }} {{ money((float) $row->running_balance) }} {{ $row->status }}
@empty @if ($bankAccounts->isEmpty()) Add a bank and bank account first, then record entries. @else No bank book entries yet. Add your first entry. @endif @endforelse
@endsection @push('styles') @endpush @push('scripts') @endpush