@php $candidate = trim((string) ($pdfFontFile ?? '')); $candidate = basename($candidate); $primaryPath = $candidate !== '' ? public_path('fonts/' . $candidate) : ''; $primaryExists = $primaryPath !== '' && is_file($primaryPath); $primaryUrl = $primaryExists ? asset('fonts/' . rawurlencode($candidate)) : ''; $notoCandidates = ['NotoSansSinhala.ttf', 'NotoSerifSinhala.ttf', 'Noto Sans Sinhala.ttf']; $notoUrl = ''; foreach ($notoCandidates as $f) { if (is_file(public_path('fonts/' . $f))) { $notoUrl = asset('fonts/' . rawurlencode($f)); break; } } @endphp @if($primaryUrl !== '') @endif @if($notoUrl !== '') @endif @if(request()->query('autoprint') != '1')
@endif

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) }}