Showing {{ number_format($resultsTotal) }} results
filter_list Sort by Price
No listings to show.
@else
@foreach($stocks as $stock)
@php
$isMine = ($myPharmacyId ?? auth()->user()->pharmacy_id) === $stock->pharmacy_id;
$isExpiring = $stock->expiry_date ? $stock->expiry_date->lte(now()->addMonths(3)) : false;
$totalText = $stock->listing_type === 'sell' && ! is_null($stock->unit_price)
? 'T: '.number_format((float) $stock->unit_price * (float) $stock->quantity, 2).' DH'
: 'Swap';
@endphp
{{ $totalText }}
@endforeach
@if($isMine)
{{ $stock->pharmacy?->name }} (You)
@else
{{ $stock->pharmacy?->name }}
@endif
{{ $stock->listing_type === 'swap' ? 'Swap' : 'Sell' }}
{{ $stock->medicine?->name }}
Available Qty
{{ number_format($stock->quantity) }} {{ $stock->unit }}
Expiry Date
{{ $stock->expiry_date?->format('m / Y') }}
{{ $stocks->links() }}
@endif