Account

@include('accounting.partials.nav')
{{ $tabs[$tab] ?? 'Accounts' }}
View account details.
@foreach($tabs as $key => $label) {{ $label }} @endforeach
{{ $account->name }}
Type: {{ $account->type }}
Balance
{{ number_format((float) $balance, 2) }}
@if(in_array($account->type, ['Bank', 'Wallet'], true))
{{ $account->type === 'Bank' ? 'Bank Name' : 'App Name' }}
{{ $account->institution_name ?: '-' }}
Account Name
{{ $account->account_name ?: '-' }}
Acc. No.
{{ $account->account_number ?: '-' }}
Branch
{{ $account->branch ?: '-' }}
@elseif($account->type === 'Cash')
Name
{{ $account->name }}
@elseif($account->type === 'Person')
Mobile
{{ $account->mobile ?: '-' }}
WhatsApp
{{ $account->whatsapp ?: '-' }}
Address
{{ $account->address ?: '-' }}
Notes
{{ $account->notes ?: '-' }}
@endif
Opening Balance
{{ number_format((float) ($account->opening_balance ?? 0), 2) }}
Status
{{ $account->is_active ? 'Active' : 'Inactive' }}
History
Latest ledger entries for this account.
@if($ledgerEntries)
@endif
@if(!$ledgerEntries)
Ledger table not available.
@else
@forelse($ledgerEntries as $row) @php($rowType = $row->txn_type ?? ($row->ledger_txn_type ?? '-')) @php($fromId = (int) ($row->from_account_id ?? 0)) @php($toId = (int) ($row->to_account_id ?? 0)) @php($currentId = (int) ($account->id ?? 0)) @php($relatedAccountName = '-') @if(($row->from_account_name ?? null) || ($row->to_account_name ?? null)) @if($currentId && $fromId && $currentId === $fromId) @php($relatedAccountName = $row->to_account_name ?? '-') @elseif($currentId && $toId && $currentId === $toId) @php($relatedAccountName = $row->from_account_name ?? '-') @else @php($relatedAccountName = trim((string)($row->from_account_name ?? '')) !== '' ? ($row->from_account_name ?? '-') : ($row->to_account_name ?? '-')) @endif @endif @php($deltaVal = (float) ($row->delta ?? 0)) @php($tz = config('app.timezone') ?: 'UTC') @php($createdAtOut = $row->created_at ? \Illuminate\Support\Carbon::parse($row->created_at)->timezone($tz)->format('Y-m-d H:i:s') : null) @php($entryDateOut = $row->entry_date ? \Illuminate\Support\Carbon::parse($row->entry_date)->format('Y-m-d') : null) @php($payload = [ 'ledger_id' => $row->id ?? null, 'txn_id' => $row->txn_id ?? null, 'created_at' => $createdAtOut, 'entry_date' => $entryDateOut, 'type' => $rowType, 'delta' => $deltaVal, 'related' => $relatedAccountName, 'from_account' => $row->from_account_name ?? null, 'to_account' => $row->to_account_name ?? null, 'ledger_note' => $row->note ?? null, 'txn_note' => $row->description ?? null, 'auto_note' => $row->auto_note ?? null, ]) @empty @endforelse
Date & Time Type Related Delta Txn
{{ $createdAtOut ?? ($row->entry_date ?? '-') }} {{ $rowType }} {{ $relatedAccountName }} {{ $deltaVal > 0 ? '+' : '' }}{{ number_format($deltaVal, 2) }} @if($row->txn_id) @else - @endif
No history yet.
Showing {{ $ledgerEntries->count() }} of {{ $ledgerEntries->total() }}
{{ $ledgerEntries->links() }}
@endif