@extends('layouts.master') @section('title', $title) @section('content')
| No sales order | {{ $order_stats['no_order'] }} |
| Draft (not confirmed) | {{ $order_stats['draft'] }} |
| Cancelled | {{ $order_stats['cancelled'] }} |
| Invoice pending | {{ $order_stats['invoice_pending'] }} |
| Invoice partial (debit) | {{ $order_stats['invoice_partial'] }} |
| Invoice paid | {{ $order_stats['invoice_paid'] }} |
| Invoice void | {{ $order_stats['invoice_void'] }} |
| {{ $material }} | {{ $count }} |
| No prescriptions in this period | |
| Date | Patient | Lens material | Order status | Amount |
|---|---|---|---|---|
| {{ \Carbon\Carbon::parse($prescription->date)->format('d M, Y') }} | {{ $prescription->Patient?->name }} (ID: {{ $prescription->Patient?->patient_id }}) | {{ $prescription->mater?->name }} | @php $order = $sales_orders_by_prescription->get($prescription->id); $amount = $order ? $order->items->sum(fn ($i) => $i->quantity * $i->unit_price) : 0; @endphp@if (!$order) No order @elseif ($order->pharPos) @php $s = $order->pharPos->status; @endphp @if ($s == 'Pending') Invoice pending @elseif ($s == 'Partial') Debit (partial) @elseif ($s == 'Paid') Paid @elseif ($s == 'Void') Void @else {{ $s }} @endif @elseif ($order->status == 'pending') Draft @elseif ($order->status == 'cancelled') Cancelled @endif | $ {{ number_format($amount, 2) }} |
| No prescriptions found in this period | ||||