@extends('layouts.app') @section('title', 'Pharmacy Stock') @section('content')

Stock Levels

+ Receive Stock
@forelse($drugs as $d) @php $totalStock = $d->batches->sum('quantity_remaining'); $nearExpiry = $d->batches->where('expiry_date','<=',now()->addMonths(3))->count(); @endphp @empty@endforelse
DrugCategoryBatchesTotal StockNear ExpiryPrice
{{ $d->name }}{{ $d->category }}{{ $d->batches->count() }}{{ $totalStock }}@if($nearExpiry){{ $nearExpiry }}@else |@endif{{ number_format($d->selling_price) }}
No drugs.
{{ $drugs->links() }}
@endsection