@extends('layouts.admin') @section('title', 'General Ledger') @section('content')

General Ledger

View detailed transactions for any account.

@if($selectedAccount)

Ledger for: {{ $selectedAccount->account_name }}

Current Balance
Rs. {{ number_format($selectedAccount->balance, 2) }}
@php $runningBalance = 0; @endphp @forelse($transactions as $transaction) @php if ($transaction->type == 'debit') $runningBalance += $transaction->amount; else $runningBalance -= $transaction->amount; @endphp @empty @endforelse
Date Description Reference Debit Credit Running Balance
{{ $transaction->journalEntry->entry_date->format('M d, Y') }} {{ $transaction->journalEntry->description }} {{ $transaction->journalEntry->reference }} {{ $transaction->type == 'debit' ? 'Rs. ' . number_format($transaction->amount, 2) : '-' }} {{ $transaction->type == 'credit' ? 'Rs. ' . number_format($transaction->amount, 2) : '-' }} Rs. {{ number_format($runningBalance, 2) }}
No transactions found for this account.
@else

Please select an account to view its ledger.

@endif
@endsection