@php $facilityName = $brandName ?? 'Veridian Micro Lab Pvt Ltd'; $facilityAddress = $branchAddress ?? ''; $facilityPhone = $branchPhone ?? config('diagnostic.brand.phone'); $lineBadge = $lineBadge ?? ($bill->transaction?->dcn ?: 'L1'); $patientName = $billPatientDisplay ?? ($patient?->name ?? '—'); $ageSex = $ageSex ?? '—'; $lines = $lines ?? []; $lastLineIndex = count($lines) > 0 ? count($lines) - 1 : 0; $formatRs = function ($amount) { $amount = (float) $amount; $decimals = floor($amount) == $amount ? 0 : 2; return 'Rs.' . number_format($amount, $decimals); }; $billPrintTotal = (float) ($billPrintTotal ?? $bill->total_amount); $billPrintPaid = (float) ($billPrintPaid ?? $bill->paid_amount); @endphp
{{ $facilityName }}
@foreach (preg_split('/\r\n|\r|\n/', (string) $facilityAddress) ?: [] as $addressLine) @if (trim($addressLine) !== '')
{{ trim($addressLine) }}
@endif @endforeach
Phone no.: {{ $facilityPhone }}
@if (!empty($branchLogoSrc)) @endif

Bill / Reg. No. {{ $regNo }}
{{ $lineBadge }} @if (!empty($billQrSvg) || !empty($billQrSrc))
@if (!empty($billQrSvg))
{!! $billQrSvg !!}
@else Bill QR @endif
Scan to download lab report
@endif
Name : {{ $patientName }}
Age / Sex : {{ $ageSex }}
Mobile number : {{ $patient?->mobile ?? '—' }}
Referred by : {{ $bill->referred_by ?: 'Self' }}
Date & time : {{ $bill->created_at?->format('d/m/Y, h:i A') ?? '—' }}
Received by : {{ $receivedBy }}
@forelse ($lines as $index => $line) @php $isLast = $index === $lastLineIndex; @endphp @empty @endforelse
S. NO. INVESTIGATIONS AMOUNT
{{ $index + 1 }}. {{ $line['title'] }} {{ $line['amount'] !== null ? $formatRs($line['amount']) : '—' }}
1. — {{ $formatRs($billPrintTotal) }}
Total amount {{ $formatRs($billPrintTotal) }}
Amount paid {{ $formatRs($billPrintPaid) }}
Amount Paid (in words): {{ $amountInWords ?? '' }}
@if (!empty($cashierSignatureSrc) || !empty($cashierSignatureUrl)) Cashier's signature @else
 
@endif
Cashier's signature
--- Thank You ---