@php
    echo "\xEF\xBB\xBF";
    $formatRupiah = fn ($value) => (float) $value;
    $s = $summary ?? [];
@endphp
<html>
<head>
    <meta charset="UTF-8">
    <title>Neraca</title>
</head>
<body>
    <table border="1">
        <tr>
            <th colspan="2">NERACA</th>
        </tr>
        <tr>
            <th colspan="2">Posisi per {{ \Carbon\Carbon::parse($asOfDate)->format('d M Y') }}</th>
        </tr>

        <tr><th colspan="2">ASET LANCAR</th></tr>
        <tr><td>Kas Kecil</td><td>{{ $formatRupiah($s['kas_kecil'] ?? 0) }}</td></tr>
        <tr><td>Kas Tunai</td><td>{{ $formatRupiah($s['kas_tunai'] ?? 0) }}</td></tr>
        <tr><td>Kas Bank</td><td>{{ $formatRupiah($s['kas_bank'] ?? 0) }}</td></tr>
        <tr><td>Piutang Usaha</td><td>{{ $formatRupiah($s['piutang_usaha'] ?? 0) }}</td></tr>
        <tr><td>Persediaan</td><td>{{ $formatRupiah($s['persediaan'] ?? 0) }}</td></tr>
        <tr><td>Aset Lancar Lainnya</td><td>{{ $formatRupiah($s['aset_lancar_lainnya'] ?? 0) }}</td></tr>
        <tr><td><strong>Total Aset Lancar</strong></td><td><strong>{{ $formatRupiah($s['total_aset_lancar'] ?? 0) }}</strong></td></tr>

        <tr><th colspan="2">ASET TETAP</th></tr>
        <tr><td>Aset Tetap Bruto</td><td>{{ $formatRupiah($s['aset_tetap_bruto'] ?? 0) }}</td></tr>
        <tr><td>Akumulasi Penyusutan</td><td>{{ $formatRupiah($s['akumulasi_penyusutan'] ?? 0) }}</td></tr>
        <tr><td><strong>Aset Tetap Bersih</strong></td><td><strong>{{ $formatRupiah($s['aset_tetap_bersih'] ?? 0) }}</strong></td></tr>
        <tr><td><strong>Total Aset</strong></td><td><strong>{{ $formatRupiah($s['total_aset'] ?? 0) }}</strong></td></tr>

        <tr><th colspan="2">KEWAJIBAN</th></tr>
        <tr><td>Hutang Usaha</td><td>{{ $formatRupiah($s['hutang_usaha'] ?? 0) }}</td></tr>
        <tr><td>Utang Gaji</td><td>{{ $formatRupiah($s['utang_gaji'] ?? 0) }}</td></tr>
        <tr><td>Utang Lain-lain</td><td>{{ $formatRupiah($s['utang_lain_lain'] ?? 0) }}</td></tr>
        <tr><td><strong>Total Kewajiban</strong></td><td><strong>{{ $formatRupiah($s['total_kewajiban'] ?? 0) }}</strong></td></tr>

        <tr><th colspan="2">EKUITAS</th></tr>
        <tr><td>Modal Pemilik</td><td>{{ $formatRupiah($s['modal_pemilik'] ?? 0) }}</td></tr>
        <tr><td>Prive</td><td>{{ $formatRupiah($s['prive'] ?? 0) }}</td></tr>
        <tr><td>Laba Ditahan</td><td>{{ $formatRupiah($s['laba_ditahan'] ?? 0) }}</td></tr>
        <tr><td><strong>Total Ekuitas</strong></td><td><strong>{{ $formatRupiah($s['total_ekuitas'] ?? 0) }}</strong></td></tr>

        <tr><td><strong>Total Kewajiban + Ekuitas</strong></td><td><strong>{{ $formatRupiah($s['total_pasiva'] ?? 0) }}</strong></td></tr>
        <tr><td><strong>Selisih</strong></td><td><strong>{{ $formatRupiah($s['selisih'] ?? 0) }}</strong></td></tr>
    </table>
</body>
</html>