@extends('layouts.master') @section('title', $title) @section('content')
Total prescriptions

{{ $total_prescriptions }}

Draft sales orders

{{ $order_stats['draft'] }}

Paid invoices

{{ $order_stats['invoice_paid'] }}

Revenue (invoiced orders)

$ {{ number_format($total_revenue, 2) }}

Sales order / invoice status
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'] }}
Lens material breakdown
@forelse ($lens_material_breakdown as $material => $count) @empty @endforelse
{{ $material }}{{ $count }}
No prescriptions in this period
Prescriptions ({{ \Carbon\Carbon::parse($start_date)->format('d M, Y') }} - {{ \Carbon\Carbon::parse($end_date)->format('d M, Y') }})
@forelse ($prescriptions as $prescription) @php $order = $sales_orders_by_prescription->get($prescription->id); $amount = $order ? $order->items->sum(fn ($i) => $i->quantity * $i->unit_price) : 0; @endphp @empty @endforelse
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 }} @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
@endsection