@extends('layouts.app') @section('title', 'Trial Balance') @section('content')

Trial Balance

{{-- Date Filter --}}
All Time
{{-- Summary Card --}}
Total Debits
৳ {{ number_format($summary['total_debit'], 2) }}
Total Credits
৳ {{ number_format($summary['total_credit'], 2) }}
Difference
@if ($summary['is_balanced']) Balanced @else ৳ {{ number_format($summary['difference'], 2) }} @endif
{{-- Account Breakdown --}}
Account-wise Breakdown
@forelse ($accounts as $acct) @php $d = (float) $acct['total_debit']; $c = (float) $acct['total_credit']; $isDebitNormal = in_array($acct['account_type'], ['asset', 'expense']); $balance = $isDebitNormal ? ($d - $c) : ($c - $d); @endphp @empty @endforelse
Code Account Name Type Total Debit Total Credit Balance
{{ $acct['account_code'] }} {{ $acct['account_name'] }} {{ ucfirst($acct['account_type']) }} ৳ {{ number_format($d, 2) }} ৳ {{ number_format($c, 2) }} ৳ {{ number_format(abs($balance), 2) }} {{ $balance < 0 ? 'Cr' : 'Dr' }}
No transactions found.
@endsection