@php $candidate = trim((string) (($pdfFontFile ?? null) ?? ($appFontFile ?? ''))); $candidate = basename($candidate); $primaryPath = $candidate !== '' ? public_path('fonts/' . $candidate) : ''; $primaryPath = ($primaryPath !== '' && is_file($primaryPath)) ? $primaryPath : ''; // Always provide a Sinhala-capable fallback font. $notoCandidates = [ public_path('fonts/NotoSansSinhala.ttf'), public_path('fonts/NotoSerifSinhala.ttf'), public_path('fonts/Noto Sans Sinhala.ttf'), ]; $notoPath = ''; foreach ($notoCandidates as $p) { if (is_file($p)) { $notoPath = $p; break; } } $toFileUri = function (string $absPath): string { $p = str_replace('\\', '/', $absPath); // Encode spaces for CSS url() parsing / Dompdf $p = str_replace(' ', '%20', $p); return 'file:///' . $p; }; $primaryUri = $primaryPath !== '' ? $toFileUri($primaryPath) : ''; $notoUri = $notoPath !== '' ? $toFileUri($notoPath) : ''; @endphp
| Date | Type | Ref | Debit | Credit | Balance |
|---|---|---|---|---|---|
| {{ $row['date'] ?? '' }} | {{ $row['type'] ?? '' }} | {{ $row['ref'] ?? '' }} | {{ number_format((float)($row['debit'] ?? 0), 2) }} | {{ number_format((float)($row['credit'] ?? 0), 2) }} | {{ number_format((float)($row['balance'] ?? 0), 2) }} |