@extends('layouts.main') @push('styles') @endpush @section('content')

{{ __('pharmacy.pharmacy_stock_sheet') }}

@include('flash::message')
@php $total_cost_value = 0; @endphp
@if(track_items_using_batches())@endif @if(track_items_using_batches())@endif @php $cost_value = 0; $sale_value = 0; @endphp @foreach($drugs as $drug) @php $drug_pharmacy_stock = 0; $item_cost_value = 0; @endphp @if(track_items_using_batches()) @endif @php $total_cost_value += $item_cost_value; $sale_value += ($drug->non_insured_price * $drug_pharmacy_stock); @endphp @endforeach @if(track_items_using_batches())@endif
{{ __('pharmacy.item_name') }}{{ __('stores.batch_details') }}{{ __('pharmacy.pharmacy_stock') }} {{ __('pharmacy.cost_value') }} {{ __('pharmacy.selling_price') }} {{ __('pharmacy.sale_value') }}
{{ __('pharmacy.item_name') }}{{ __('stores.batch_details') }}{{ __('pharmacy.pharmacy_stock') }} {{ __('pharmacy.cost_value') }} {{ __('pharmacy.selling_price') }} {{ __('pharmacy.sale_value') }}
@if($drug->insurance_coverage == 1) {{ $drug->name }} @else {{ $drug->name }} @endif @php $batch_records = \Streamline\Models\ItemBatchWatcher::where(['item_type' => 1, 'item_id' => $drug->id])->where('pharmacy_stock', '!=', 0)->get(); @endphp @if(count($batch_records) > 0) @foreach($batch_records as $record)
{{ __('stores.batch') }}: {{ $record->batch_number }}
{{ __('stores.quantity') }}: {{ $record->pharmacy_stock }}
@php $drug_pharmacy_stock += $record->pharmacy_stock; @endphp {{ __('stores.expiry_date') }}: {{ $record->expiry_date }}
{{ __('stores.unit_cost') }}: {{ $record->cost_price }}
@php $item_cost_value += $record->cost_price * $record->pharmacy_stock; @endphp @endforeach @endif
{{ $drug_pharmacy_stock }}
{{ ugandan_shillings($item_cost_value) }} {{ ugandan_shillings($drug->non_insured_price) }} {{ ugandan_shillings($drug->non_insured_price * $drug_pharmacy_stock) }}
{{ __('stores.batch_details') }} {{ ugandan_shillings($total_cost_value) }} {{ ugandan_shillings($sale_value) }}
@endsection @push('scripts') @endpush