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

Account Details: {{ $account->name }}

Edit Back
Account Code
{{ $account->code }}
Account Name
{{ $account->name }}
Current Balance
Rs. {{ number_format($account->current_balance, 2) }}

Account Information

Type: @php $typeLabels = ['asset' => 'Asset', 'liability' => 'Liability', 'equity' => 'Equity', 'income' => 'Income', 'expense' => 'Expense']; $badgeColors = ['asset' => '#28a745', 'liability' => '#dc3545', 'equity' => '#6f42c1', 'income' => '#17a2b8', 'expense' => '#fd7e14']; @endphp {{ $typeLabels[$account->type] ?? ucfirst($account->type) }}
Sub Type: {{ $account->sub_type ? ucwords(str_replace('_', ' ', $account->sub_type)) : '-' }}
Parent Account: @if($account->parent) {{ $account->parent->code }} - {{ $account->parent->name }} @else Root Account @endif
Opening Balance: Rs. {{ number_format($account->opening_balance, 2) }} ({{ ucfirst($account->opening_type) }})
Status: @if($account->is_active) Active @else Inactive @endif @if($account->is_system) System @endif
Description: {{ $account->description ?: '-' }}
Created: {{ $account->created_at->format('d M Y, h:i A') }}
Last Updated: {{ $account->updated_at->format('d M Y, h:i A') }}
@if($account->children->count() > 0)

Sub Accounts ({{ $account->children->count() }})

@foreach($account->children as $child) @endforeach
Code Name Balance
{{ $child->code }} {{ $child->name }} Rs. {{ number_format($child->current_balance, 2) }}
@endif

Recent Transactions (Last 20)

@if($account->transactions->count() > 0)
@php $runningBalance = $account->opening_balance; @endphp @foreach($account->transactions->take(20) as $transaction) @php if ($transaction->type == 'debit') { $runningBalance += $transaction->amount; } else { $runningBalance -= $transaction->amount; } @endphp @endforeach
Date Reference Description Debit Credit Balance
{{ \Carbon\Carbon::parse($transaction->date)->format('d M Y') }} {{ $transaction->reference }} {{ $transaction->description ?: '-' }} @if($transaction->type == 'debit') Rs. {{ number_format($transaction->amount, 2) }} @else - @endif @if($transaction->type == 'credit') Rs. {{ number_format($transaction->amount, 2) }} @else - @endif Rs. {{ number_format(abs($runningBalance), 2) }}
@if($account->transactions->count() > 20)
View Full Ledger
@endif @else

No transactions found for this account.

@endif
@endsection