@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
| Product | Local Name | Barcode | @if(($stockScope ?? 'current_stock') === 'purchased_from_supplier')Purchased Qty | Purchased Value | @elseBundle Qty | Current Qty | @endif
|---|---|---|---|---|---|---|
| {{ $r->product_name ?? '' }} | {{ $r->product_local_name ?? '' }} | {{ $r->product_barcode ?? '' }} | @if(($stockScope ?? 'current_stock') === 'purchased_from_supplier'){{ number_format((float)($r->purchased_qty ?? 0), 2) }} | {{ number_format((float)($r->purchased_value ?? 0), 2) }} | @else{{ $r->bundle_qty === null ? '-' : number_format((float)($r->bundle_qty ?? 0), 2) }} | {{ number_format((float)($r->current_qty ?? 0), 2) }} | @endif