@extends('layouts.master') @section('page_title', 'Trial Balance Report') @section('content')

Trial Balance Report

Print PDF
Trial Balance as of {{ \Carbon\Carbon::parse($asOfDate ?? date('Y-m-d'))->format('F j, Y') }}
@php $totalDebits = 0; $totalCredits = 0; @endphp @forelse($accounts ?? [] as $account) @php $totalDebits += $account->debit_balance ?? 0; $totalCredits += $account->credit_balance ?? 0; @endphp @empty @endforelse @if(isset($accounts) && $accounts->count() > 0) @endif
Account Code Account Name Account Type Debit Balance Credit Balance
{{ $account->code }} {{ $account->name }} {{ $account->accountType->name ?? 'N/A' }} @if(($account->debit_balance ?? 0) > 0) {{ number_format($account->debit_balance, 2) }} @else - @endif @if(($account->credit_balance ?? 0) > 0) {{ number_format($account->credit_balance, 2) }} @else - @endif
No accounts found
TOTALS {{ number_format($totalDebits, 2) }} {{ number_format($totalCredits, 2) }}
DIFFERENCE {{ number_format($totalDebits - $totalCredits, 2) }} @if(abs($totalDebits - $totalCredits) < 0.01) @else @endif
@if(isset($accounts) && $accounts->count() > 0)
@if(abs($totalDebits - $totalCredits) < 0.01) Trial Balance is balanced!
Total debits equal total credits. @else Trial Balance is out of balance!
Difference: {{ number_format(abs($totalDebits - $totalCredits), 2) }} @endif
Summary:
Total Accounts: {{ $accounts->count() }}
Total Debits: {{ number_format($totalDebits, 2) }}
Total Credits: {{ number_format($totalCredits, 2) }}
@endif
@endsection