@extends('customerPanel.customer_navbar') @section('content') @php $allOrdersPdfUrl = route('customers.report.all', ['customer' => $customer->id]); @endphp
Customer Panel

{{ $customer->user->name }}

{{ $customer->user->login_id }} • {{ $customer->phone ?? '-' }}
Download All Reports (PDF)
{{-- Search --}}
{{-- ORDERS TAB --}}

Order History

Click an order to expand and view tests
@forelse($orders as $order) @php $inv = $order->invoice; $status = $inv?->status ?? 'unpaid'; $badge = $status === 'paid' ? 'b-paid' : ($status === 'partial' ? 'b-partial' : 'b-unpaid'); $testNames = $order->items->pluck('test_name_snapshot')->filter()->take(6)->implode(', '); $moreCount = max(0, $order->items->count() - 6); if ($moreCount > 0) $testNames .= " +{$moreCount} more"; $detailsId = 'order-details-'.$order->id; $q = strtolower( 'order '.$order->id.' '. ($order->branch?->branch_name ?? 'main').' '. $status.' '. ($testNames ?? '').' '. ($inv?->total_amount ?? 0).' '. ($inv?->paid_amount ?? 0) ); @endphp
@forelse($order->items as $it) @php $unit = $it->unit_snapshot ?? $it->labTest?->unit ?? ''; $range = $it->reference_range_snapshot ?? $it->labTest?->reference_range ?? ''; $rstatus = $it->result_status ?? 'pending'; $isPending = in_array($rstatus, ['pending','processing'], true); @endphp @empty @endforelse
Test Status Result Unit Range
{{ $it->test_name_snapshot }}
{{ $it->test_code_snapshot }}
@if($isPending) Pending @else Ready @endif {{ $it->result_text ?: '—' }} {{ $unit ?: '—' }} {{ $range ?: '—' }}
No tests assigned yet.
@empty
No orders found.
@endforelse
{{-- TESTS TAB --}}
@endsection