Customer Panel
{{ $customer->user->name }}
{{ $customer->user->login_id }} • {{ $customer->phone ?? '-' }}
{{-- Search --}}
0 matches
{{-- 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
▸
Order #{{ $order->id }}
{{ strtoupper($status) }}
Created: {{ $order->created_at?->format('Y-m-d H:i') }}
Tests: {{ $testNames ?: 'No tests assigned yet' }}
Lab: {{ $order->branch?->branch_name ?? 'Main/Admin' }}
Total: {{ number_format($inv?->total_amount ?? 0, 2) }}
Paid: {{ number_format($inv?->paid_amount ?? 0, 2) }}
Remaining: {{ number_format(max(0, ($inv?->total_amount ?? 0) - ($inv?->paid_amount ?? 0)), 2) }}
PDF
| Test |
Status |
Result |
Unit |
Range |
@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
|
{{ $it->test_name_snapshot }}
{{ $it->test_code_snapshot }}
|
@if($isPending)
Pending
@else
Ready
@endif
|
{{ $it->result_text ?: '—' }} |
{{ $unit ?: '—' }} |
{{ $range ?: '—' }} |
@empty
| No tests assigned yet. |
@endforelse
@empty
No orders found.
@endforelse
{{-- TESTS TAB --}}
Test History
All tests across all orders
| Test |
Status |
Assigned |
Ready |
Result |
Unit |
Range |
@forelse($items as $it)
@php
$unit = $it->unit_snapshot ?? $it->labTest?->unit ?? '';
$range = $it->reference_range_snapshot ?? $it->labTest?->reference_range ?? '';
$result = $it->result_text ?? '';
$status = $it->result_status ?? 'pending';
$isPending = in_array($status, ['pending','processing'], true);
$q = strtolower(
($it->test_name_snapshot ?? '').' '.
($result ?? '').' '.
($unit ?? '').' '.
($range ?? '').' '.
optional($it->created_at)->format('Y-m-d').' '.
optional($it->result_posted_at)->format('Y-m-d').' '.
'order '.$it->test_order_id
);
@endphp
|
{{ $it->test_name_snapshot ?? ($it->labTest?->test_name ?? '-') }}
{{ $it->test_code_snapshot ?? ($it->labTest?->test_code ?? '') }}
Order #{{ $it->test_order_id }}
|
@if($isPending)
Pending
@else
Ready
@endif
|
{{ $it->created_at ? $it->created_at->format('d-m-Y') : '—' }}
{{ $it->created_at ? $it->created_at->format('h:i A') : '' }}
|
@if($it->result_posted_at)
{{ $it->result_posted_at->format('d-m-Y') }}
{{ $it->result_posted_at->format('h:i A') }}
@else
Not ready
@endif
|
{{ $result !== '' ? $result : '—' }} |
{{ $unit ?: '—' }} |
{{ $range ?: '—' }} |
@empty
| No tests found. |
@endforelse