{{-- ===== HEADER (mPDF htmlheader) ===== --}}
@if (!empty($logo_base64)) Logo @endif

{{ $company_name ?? 'PT. PERUSAHAAN' }}

LAPORAN PEMEGANG SAHAM

Periode : @if (!empty($tanggal_columns)) {{ \Carbon\Carbon::parse($tanggal_columns[0])->translatedFormat('d F Y') }} — {{ \Carbon\Carbon::parse(end($tanggal_columns))->translatedFormat('d F Y') }} @else {{ \Carbon\Carbon::parse($tanggal_selected)->translatedFormat('d F Y') }} @endif

CONFIDENTIAL


{{-- ===== FOOTER (mPDF htmlfooter) ===== --}}

LAPORAN DATA PEMEGANG SAHAM MSJA

{{-- ===== RINGKASAN UMUM ===== --}}

Tanggal Laporan : {{ \Carbon\Carbon::parse($tanggal_selected)->translatedFormat('d F Y') }}

Total Jumlah Kepemilikan Saham : {{ number_format($total_saham_keseluruhan ?? 0, 0, ',', '.') }}

Jumlah Kategori : {{ count($report ?? []) }}

Periode Data : {{ \Carbon\Carbon::parse($tanggal_columns[0])->translatedFormat('d F Y') }} - {{ \Carbon\Carbon::parse(end($tanggal_columns))->translatedFormat('d F Y') }}

@php $grandTotals = []; $no = 1; $topN = 10; // Jumlah investor teratas yang ditampilkan per kategori $allSections = collect($report ?? []); $listGroupSections = $allSections->filter(fn($s) => $s['kategori']->jenis === 'list_group')->values(); $sumRangeSections = $allSections->filter(fn($s) => $s['kategori']->jenis === 'sum_range')->values(); $hasDetail = false; // track if lampiran needed $categoryIndex = 0; // track page breaks // Calculate exact percentage width for date columns $dateCount = count($tanggal_columns ?? []); // Sisa 50% ruang tabel dibagi jumlah tanggal yang ada $dateWidth = $dateCount > 0 ? (50 / $dateCount) : 10; @endphp @if (!empty($report)) {{-- ============ LIST GROUP ============ --}} @if ($listGroupSections->count() > 0) @foreach ($listGroupSections as $section) @php $investors = $section['investors'] ?? []; $topInvestors = array_slice($investors, 0, $topN); $remainingInvestors = array_slice($investors, $topN); $remainingCount = count($remainingInvestors); if ($remainingCount > 0) $hasDetail = true; $no = 1; @endphp @if ($categoryIndex > 0)
@endif @php $categoryIndex++; @endphp
{{ $section['kategori']->nama_kategori }} LIST GROUP

Total Investor : {{ $section['total_investor'] }}  |  Total Saham : {{ number_format($section['total_saham'], 0, ',', '.') }} @if ($remainingCount > 0)  |  Menampilkan Top {{ $topN }}, detail lengkap di Lampiran @endif

@if (!empty($topInvestors)) @foreach ($tanggal_columns as $date) @endforeach @foreach ($topInvestors as $investor) @foreach ($tanggal_columns as $date) @endforeach @endforeach {{-- Baris "Lainnya" jika ada sisa --}} @if ($remainingCount > 0) @foreach ($tanggal_columns as $date) @php $othersTotal = 0; foreach ($remainingInvestors as $ri) { $othersTotal += ($ri['dates'][$date]['value'] ?? 0); } @endphp @endforeach @endif @foreach ($tanggal_columns as $date) @php $colTotal = $section['totals'][$date] ?? 0; if (!isset($grandTotals[$date])) $grandTotals[$date] = 0; $grandTotals[$date] += $colTotal; @endphp @endforeach
No Nomor SID Nama Investor Kode Pemegang Rekening{{ \Carbon\Carbon::parse($date)->format('d/m/Y') }}
{{ $no++ }} {{ $investor['nomor_sid'] }} {{ $investor['nama_investor'] }} {{ $investor['kode_pemegang_rekening'] ?? '' }} @if ($investor['dates'][$date]['value'] !== null) {{ number_format($investor['dates'][$date]['value'], 0, ',', '.') }} @if ($investor['dates'][$date]['change'] === 'up') ▲ @elseif ($investor['dates'][$date]['change'] === 'down') ▼ @endif @else — @endif
… + {{ $remainingCount }} investor lainnya (lihat Lampiran) {{ number_format($othersTotal, 0, ',', '.') }}
TOTAL{{ number_format($colTotal, 0, ',', '.') }}
@else

Tidak ada data investor untuk kategori ini.

@endif
@endforeach @endif {{-- ============ SUM RANGE ============ --}} @if ($sumRangeSections->count() > 0) @foreach ($sumRangeSections as $section) @php $investors = $section['investors'] ?? []; $topInvestors = array_slice($investors, 0, $topN); $remainingInvestors = array_slice($investors, $topN); $remainingCount = count($remainingInvestors); if ($remainingCount > 0) $hasDetail = true; $no = 1; @endphp @if ($categoryIndex > 0)
@endif @php $categoryIndex++; @endphp
{{ $section['kategori']->nama_kategori }} SUM RANGE

Total Investor : {{ $section['total_investor'] }}  |  Total Saham : {{ number_format($section['total_saham'], 0, ',', '.') }} @if ($remainingCount > 0)  |  Menampilkan Top {{ $topN }}, detail lengkap di Lampiran @endif

@if (!empty($topInvestors)) @foreach ($tanggal_columns as $date) @endforeach @foreach ($topInvestors as $investor) @foreach ($tanggal_columns as $date) @endforeach @endforeach {{-- Baris "Lainnya" jika ada sisa --}} @if ($remainingCount > 0) @foreach ($tanggal_columns as $date) @php $othersTotal = 0; foreach ($remainingInvestors as $ri) { $othersTotal += ($ri['dates'][$date]['value'] ?? 0); } @endphp @endforeach @endif @foreach ($tanggal_columns as $date) @php $colTotal = $section['totals'][$date] ?? 0; if (!isset($grandTotals[$date])) $grandTotals[$date] = 0; $grandTotals[$date] += $colTotal; @endphp @endforeach
No Nomor SID Nama Investor Kode Pemegang Rekening{{ \Carbon\Carbon::parse($date)->format('d/m/Y') }}
{{ $no++ }} {{ $investor['nomor_sid'] }} {{ $investor['nama_investor'] }} {{ $investor['kode_pemegang_rekening'] ?? '' }} @if ($investor['dates'][$date]['value'] !== null) {{ number_format($investor['dates'][$date]['value'], 0, ',', '.') }} @if ($investor['dates'][$date]['change'] === 'up') ▲ @elseif ($investor['dates'][$date]['change'] === 'down') ▼ @endif @else — @endif
… + {{ $remainingCount }} investor lainnya (lihat Lampiran) {{ number_format($othersTotal, 0, ',', '.') }}
TOTAL{{ number_format($colTotal, 0, ',', '.') }}
@else

Tidak ada data investor untuk kategori ini.

@endif
@endforeach @endif {{-- ============ LAIN-LAIN ============ --}} @if (!empty($lain_lain) && $lain_lain['total_investor'] > 0) @if ($categoryIndex > 0)
@endif @php $categoryIndex++; @endphp
LAIN - LAIN LAINNYA

Total Investor : {{ $lain_lain['total_investor'] }}  |  Total Saham : {{ number_format($lain_lain['total_saham'], 0, ',', '.') }}

{{-- 50% untuk keterangan agar sejajar dengan kolom Info di tabel lain --}} @foreach ($tanggal_columns as $date) @endforeach @foreach ($tanggal_columns as $date) @php $lainTotal = $lain_lain['totals'][$date] ?? 0; if (!isset($grandTotals[$date])) $grandTotals[$date] = 0; $grandTotals[$date] += $lainTotal; @endphp @endforeach
Keterangan{{ \Carbon\Carbon::parse($date)->format('d/m/Y') }}
TOTAL{{ number_format($lainTotal, 0, ',', '.') }}
@endif {{-- ============ GRAND TOTAL ============ --}} @foreach ($tanggal_columns as $date) @endforeach {{-- Baris per kategori List Group --}} @foreach ($listGroupSections as $section) @foreach ($tanggal_columns as $date) @endforeach @endforeach {{-- Baris per kategori Sum Range --}} @foreach ($sumRangeSections as $section) @foreach ($tanggal_columns as $date) @endforeach @endforeach {{-- Baris Lain-Lain --}} @if (!empty($lain_lain) && $lain_lain['total_investor'] > 0) @foreach ($tanggal_columns as $date) @endforeach @endif @foreach ($tanggal_columns as $date) @endforeach
Keterangan{{ \Carbon\Carbon::parse($date)->format('d/m/Y') }}
{{ $section['kategori']->nama_kategori }}{{ number_format($section['totals'][$date] ?? 0, 0, ',', '.') }}
{{ $section['kategori']->nama_kategori }}{{ number_format($section['totals'][$date] ?? 0, 0, ',', '.') }}
LAIN - LAIN{{ number_format($lain_lain['totals'][$date] ?? 0, 0, ',', '.') }}
GRAND TOTAL{{ number_format($grandTotals[$date] ?? 0, 0, ',', '.') }}
{{-- ================================================================== --}} {{-- BAGIAN 2 : LAMPIRAN DETAIL (SELURUH INVESTOR) --}} {{-- ================================================================== --}} @if ($hasDetail)

LAMPIRAN — DETAIL LENGKAP INVESTOR

Daftar seluruh investor per kategori — Periode {{ \Carbon\Carbon::parse($tanggal_columns[0])->format('d/m/Y') }} s.d. {{ \Carbon\Carbon::parse(end($tanggal_columns))->format('d/m/Y') }}


@php $detailNo = 1; $detailCategoryIndex = 0; @endphp {{-- Detail: List Group --}} @foreach ($listGroupSections as $section) @if ($detailCategoryIndex > 0)
@endif @php $detailCategoryIndex++; @endphp @if (count($section['investors'] ?? []) > 0)
{{ $section['kategori']->nama_kategori }} LIST GROUP

{{ $section['total_investor'] }} Investor  |  Total Saham : {{ number_format($section['total_saham'], 0, ',', '.') }}

@foreach ($tanggal_columns as $date) @endforeach @php $detailNo = 1; @endphp @foreach ($section['investors'] as $investor) @foreach ($tanggal_columns as $date) @endforeach @endforeach @foreach ($tanggal_columns as $date) @endforeach
No Nomor SID Nama Investor Kode Pemegang Rekening{{ \Carbon\Carbon::parse($date)->format('d/m/Y') }}
{{ $detailNo++ }} {{ $investor['nomor_sid'] }} {{ $investor['nama_investor'] }} {{ $investor['kode_pemegang_rekening'] ?? '' }} @if ($investor['dates'][$date]['value'] !== null) {{ number_format($investor['dates'][$date]['value'], 0, ',', '.') }} @if ($investor['dates'][$date]['change'] === 'up') ▲ @elseif ($investor['dates'][$date]['change'] === 'down') ▼ @endif @else — @endif
TOTAL{{ number_format($section['totals'][$date] ?? 0, 0, ',', '.') }}
@endif @endforeach {{-- Detail: Sum Range --}} @foreach ($sumRangeSections as $section) @if ($detailCategoryIndex > 0)
@endif @php $detailCategoryIndex++; @endphp @if (count($section['investors'] ?? []) > 0)
{{ $section['kategori']->nama_kategori }} SUM RANGE

{{ $section['total_investor'] }} Investor  |  Total Saham : {{ number_format($section['total_saham'], 0, ',', '.') }}

@foreach ($tanggal_columns as $date) @endforeach @php $detailNo = 1; @endphp @foreach ($section['investors'] as $investor) @foreach ($tanggal_columns as $date) @endforeach @endforeach @foreach ($tanggal_columns as $date) @endforeach
No Nomor SID Nama Investor Kode Pemegang Rekening{{ \Carbon\Carbon::parse($date)->format('d/m/Y') }}
{{ $detailNo++ }} {{ $investor['nomor_sid'] }} {{ $investor['nama_investor'] }} {{ $investor['kode_pemegang_rekening'] ?? '' }} @if ($investor['dates'][$date]['value'] !== null) {{ number_format($investor['dates'][$date]['value'], 0, ',', '.') }} @if ($investor['dates'][$date]['change'] === 'up') ▲ @elseif ($investor['dates'][$date]['change'] === 'down') ▼ @endif @else — @endif
TOTAL{{ number_format($section['totals'][$date] ?? 0, 0, ',', '.') }}
@endif @endforeach @endif @else

Tidak ada data untuk ditampilkan.

Silakan pilih tanggal dan filter untuk menghasilkan laporan.

@endif