@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

Supplier Ledger

Supplier: {{ $supplier->supplier_name }}{{ !empty($supplier->supplier_company) && $supplier->supplier_company !== 'NULL' ? ' - ' . $supplier->supplier_company : '' }}
Generated: {{ $generatedAt ?? '' }}
Total Invoice: {{ number_format((float)($supplier->total_invoice ?? 0), 2) }}   |   Total Payment: {{ number_format((float)($supplier->total_payment ?? 0), 2) }}   |   Due Balance: {{ number_format((float)($supplier->due_balance ?? 0), 2) }}
@foreach($ledgerRows as $row) @endforeach
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) }}