@php $s = $opticalStats; @endphp

Vision Optical Dashboard

{{ $s['todayFormatted'] ?? date('d M Y, l') }}
@if($showFullDashboard ?? false) @php $today = $s['today']; $monthStart = $s['monthStart']; $wideFrom = '2020-01-01'; $isOpticalAdmin = isOpticalAdminUserType(); $isOpticalStaff = isOpticalStaffUserType(); $statCol = $isOpticalAdmin ? 'col-xl-3 col-md-6 mb-3' : 'col-xl-4 col-md-6 mb-3'; $statColWide = $isOpticalAdmin ? 'col-xl-3 col-md-6 mb-3' : 'col-xl-6 col-md-6 mb-3'; $staffStatCol = 'col-xl col-lg col-md-4 col-sm-6 mb-3'; $opticalDashFrom = $s['opticalDashFromDate'] ?? opticalDashboardFromDate(); $opticalDashFromLabel = date('d M Y', strtotime($opticalDashFrom)); @endphp @if($isOpticalStaff) {{-- Optical staff: summary cards only --}}
Today's Orders
{{ number_format($s['todayOrderCount']) }}
₹{{ number_format($s['todayOrderAmount'], 0) }} bill amount · Click to view
Today's Delivery
{{ number_format($s['todayDeliveryCount']) }}
₹{{ number_format($s['todayDeliveryAmount'], 0) }} scheduled today · Click to view
Today's Collection
₹{{ number_format($s['todayCollection'], 0) }}
Advance + receipts · Click to view
Cash Payment
₹{{ number_format($s['todayCashPayment'], 0) }}
{{ number_format($s['todayCashPaymentCount']) }} payment(s) today · Click to view
Online Payment
₹{{ number_format($s['todayOnlinePayment'], 0) }}
{{ number_format($s['todayOnlinePaymentCount']) }} card/mobile payment(s) · Click to view
Pending Make Order
{{ number_format($s['todayPendingMakeOrderCount']) }}
Waiting from {{ $opticalDashFromLabel }} · Click to view
Make Order Done
{{ number_format($s['todayMakeOrderDoneCount']) }}
Orders made from {{ $opticalDashFromLabel }} · Click to view
Pending Work Completed
{{ number_format($s['todayPendingWorkCompletedCount']) }}
Work pending from {{ $opticalDashFromLabel }} · Click to view
Work Completed
{{ number_format($s['workCompletedFromDate']) }}
From {{ $opticalDashFromLabel }} onwards · Click to view
@else {{-- Primary stats --}}
Today's Sales
{{ number_format($s['todaySaleCount']) }}
₹{{ number_format($s['todaySaleAmount'], 2) }} bill amount · Click to view
Today's Collection
₹{{ number_format($s['todayCollection'], 0) }}
Advance ₹{{ number_format($s['todayAdvance'], 0) }} + Receipt ₹{{ number_format($s['todayReceiptAmount'], 0) }} · Click to view
Pending Make Orders
{{ number_format($s['pendingMakeOrderCount']) }}
Orders waiting to be made · Click to view
@if($isOpticalAdmin)
Outstanding Balance
₹{{ number_format($s['outstandingAmount'], 0) }}
{{ number_format($s['outstandingCount']) }} bills from Jan 2026 · Click to view
@endif @if(!$isOpticalAdmin)
Work Completed
{{ number_format($s['pendingPaymentCount']) }}
{{ number_format($s['workCompletedToday']) }} completed today · Pending payment · Click to view
Today's Receipts
{{ number_format($s['todayReceiptCount']) }}
{{ number_format($s['pendingPaymentCount']) }} ready for payment · Click to view
@endif
@if($isOpticalAdmin) {{-- Secondary stats --}}
This Month Sales
{{ number_format($s['monthSaleCount']) }}
₹{{ number_format($s['monthSaleAmount'], 0) }} total amount · Click to view
Total Sale Bills
{{ number_format($s['totalOpticalBills']) }}
All time optical records · Click to view
Work Completed
{{ number_format($s['pendingPaymentCount']) }}
{{ number_format($s['workCompletedToday']) }} completed today · Pending payment · Click to view
Today's Receipts
{{ number_format($s['todayReceiptCount']) }}
{{ number_format($s['pendingPaymentCount']) }} ready for payment · Click to view
@endif @if($isOpticalAdmin) {{-- Sales charts --}}
Month Wise Sale — {{ $s['monthlyChart']['year'] }} Sale amount & bill count per month
Quarterly Sale — {{ $s['quarterlyChart']['year'] }} Jan-Mar · Apr-Jun · Jul-Sep · Oct-Dec
@endif {{-- Data tables --}}
Today's Sale Bills {{ $s['todaySaleCount'] }} View All
@if($s['todaySales']->isEmpty())
No sale bills today
@else
@foreach($s['todaySales'] as $row) @endforeach
Bill NoPatientAmountBalanceStatus
{{ $row->BillNo }} {{ Str::limit($row->PatientName, 22) }} ₹{{ number_format($row->SubTotal, 0) }} ₹{{ number_format($row->NetAmount ?? 0, 0) }} @if(in_array($row->WorkComplete, [1, '1', 'on'], true)) Done @else In Progress @endif
@endif
Pending Make Orders {{ $s['pendingMakeOrderCount'] }} View All
@if($s['pendingMakeOrders']->isEmpty())
No pending make orders
@else
@foreach($s['pendingMakeOrders'] as $row) @endforeach
Bill NoPatientDeliveryAmount
{{ $row->BillNo }} {{ Str::limit($row->PatientName, 22) }} {{ $row->DeliveryDate ? date('d/m/Y', strtotime($row->DeliveryDate)) : '—' }} ₹{{ number_format($row->SubTotal, 0) }}
@endif
Pending Payment {{ $s['pendingPaymentCount'] }} View All
@if($s['pendingPayments']->isEmpty())
All payments collected
@else
@foreach($s['pendingPayments'] as $row) @endforeach
Bill NoPatientBalance
{{ $row->BillNo }} {{ Str::limit($row->PatientName, 18) }} ₹{{ number_format($row->NetAmount, 0) }}
@endif
Today's Receipts {{ $s['todayReceiptCount'] }} View All
@if($s['todayReceipts']->isEmpty())
No receipts today
@else
@foreach($s['todayReceipts'] as $row) @endforeach
Bill NoPatientPaidMode
{{ $row->BillNo }} {{ Str::limit($row->PatientName, 16) }} ₹{{ number_format($row->PaidAmount, 0) }} {{ $row->PayMode }}
@endif
@if($isOpticalAdmin)
Outstanding Bills {{ $s['outstandingCount'] }} View All
@if($s['outstandingBills']->isEmpty())
No outstanding bills
@else
@foreach($s['outstandingBills'] as $row) @endforeach
Bill NoPatientBalance
{{ $row->BillNo }} {{ Str::limit($row->PatientName, 18) }} ₹{{ number_format($row->NetAmount, 0) }}
@endif
@endif
@endif @endif
@if($showFullDashboard ?? false) @endif