@extends('layouts.master') @section('title', $title) @section('content')
Sales Order — Spectacle Prescription #{{ $prescription->id }}

Patient: {{ $prescription->Patient?->name }} (ID: {{ $prescription->Patient?->patient_id }})

Lens material: {{ $prescription->mater?->name }}

Order status: @if ($order->status == 'pending') Draft @elseif ($order->status == 'confirmed') Confirmed @else Cancelled @endif

@if ($order->pharPos)

Invoice status: @if ($order->pharPos->status == 'Pending') Pending payment @elseif ($order->pharPos->status == 'Partial') Partially paid (Debit) @elseif ($order->pharPos->status == 'Paid') Paid @elseif ($order->pharPos->status == 'Void') Void @else {{ $order->pharPos->status }} @endif

A Pharmacy invoice (#{{ $order->pharPos->pos_id }}) was created for this order. Collect payment for it in Pharmacy — this page reflects its current status automatically.
@endif
Order Items
@if ($order->status == 'pending') @endif @php $total = 0; @endphp @forelse ($order->items as $i => $item) @php $subtotal = $item->quantity * $item->unit_price; $total += $subtotal; @endphp @if ($order->status == 'pending') @endif @empty @endforelse
# Product Qty Unit price Subtotal{{ __('messages.action') }}
{{ $i + 1 }} {{ $item->product?->name }} @if ($item->is_free) Free — stock only @endif {{ $item->quantity }} {{ number_format($item->unit_price, 2) }} {{ number_format($subtotal, 2) }}
No items added yet
Total {{ number_format($total, 2) }}
@if ($order->status == 'pending')
@if ($products->isEmpty())
No optical products found in inventory yet. Ask an inventory admin to add frame/lens/contact-lens products under the "Optical" category before adding items here.
@else
@csrf
@endif
@endif
@endsection @section('page_js') @endsection