@extends('layouts.pdf.base') @section('pdf-title', 'Balance Sheet') @section('pdf-subtitle') As at: {{ $asOf ?? $to ?? 'End' }} @endsection @section('pdf-content') @php $renderPdfRows = function (array $rows, string $section) { foreach ($rows as $row) { $indent = str_repeat('— ', (int) ($row['level'] ?? 0)); echo ''; echo ''.e($section).''; echo ''.e($indent.$row['code'].' — '.$row['account']).''; echo ''.number_format($row['balance'], 2).''; echo ''; } }; @endphp @if(!empty($assetRows)) @foreach($assetRows as $row) @endforeach @endif @if(!empty($liabilityRows)) @foreach($liabilityRows as $row) @endforeach @endif @if(!empty($equityRows)) @foreach($equityRows as $row) @endforeach @endif @if(!empty($equityPlRow)) @endif
Section Account Balance
Assets {{ str_repeat('— ', (int) ($row['level'] ?? 0)) }}{{ $row['code'] }} — {{ $row['account'] }} {{ number_format($row['balance'], 2) }}
Total Assets {{ number_format($totalAssets, 2) }}
Liabilities {{ str_repeat('— ', (int) ($row['level'] ?? 0)) }}{{ $row['code'] }} — {{ $row['account'] }} {{ number_format($row['balance'], 2) }}
Total Liabilities {{ number_format($totalLiabilities, 2) }}
Equity {{ str_repeat('— ', (int) ($row['level'] ?? 0)) }}{{ $row['code'] }} — {{ $row['account'] }} {{ number_format($row['balance'], 2) }}
Equity {{ $equityPlRow['account'] }} {{ number_format($equityPlRow['balance'], 2) }}
Total Equity {{ number_format($totalEquity, 2) }}
@endsection