{% extends "base.html" %} {% load static %} {% block title %}{{ object.medication.name }} Inventory - Pharmacy{% endblock %} {% block content %}

Inventory Detail {{ object.medication.name }} - {{ object.location.name }}

Inventory Information

Edit
Medication Details
Generic Name: {{ object.medication.generic_name }}
Brand Name: {{ object.medication.brand_name|default:"Not specified" }}
Strength: {{ object.medication.strength }}
Dosage Form: {{ object.medication.get_dosage_form_display }}
Route: {{ object.medication.get_route_display }}
Manufacturer: {{ object.medication.manufacturer|default:"Not specified" }}
NDC Number: {{ object.medication.ndc_number|default:"Not specified" }}
Category: {{ object.medication.get_category_display }}
{% if object.medication.is_controlled %} Controlled - Schedule {{ object.medication.controlled_schedule }} {% endif %} {% if object.medication.is_high_alert %} High Alert {% endif %} {% if object.medication.requires_refrigeration %} Refrigeration Required {% endif %}
Current Stock Status
{{ object.current_stock }}
Current Stock
{{ object.minimum_stock }}
Minimum Stock
{{ object.reorder_level }}
Reorder Level
{{ object.maximum_stock }}
Maximum Stock

Location: {{ object.location.name }}
Bin/Shelf: {{ object.bin_location|default:"Not specified" }}
Unit Cost: ${{ object.unit_cost|floatformat:2 }}
Total Value: ${{ object.total_value|floatformat:2 }}
Last Updated: {{ object.last_updated|date:"M d, Y H:i" }}
Last Count: {{ object.last_count_date|date:"M d, Y"|default:"Never" }}
Expiration Date: {% if object.expiration_date %} {{ object.expiration_date|date:"M d, Y" }} {% if object.is_expired %}(Expired){% elif object.expires_soon %}(Expires Soon){% endif %} {% else %} Not specified {% endif %}
Lot Number: {{ object.lot_number|default:"Not specified" }}
{% if object.current_stock <= object.reorder_level or object.is_expired or object.expires_soon %}
Stock Alerts
{% if object.current_stock <= 0 %}
Out of Stock: This medication is currently out of stock.
{% elif object.current_stock <= object.reorder_level %}
Reorder Alert: Stock level is at or below reorder point ({{ object.reorder_level }}).
{% elif object.current_stock <= object.minimum_stock %}
Low Stock: Stock level is below minimum threshold ({{ object.minimum_stock }}).
{% endif %} {% if object.is_expired %}
Expired: This medication expired on {{ object.expiration_date|date:"M d, Y" }}.
{% elif object.expires_soon %}
Expires Soon: This medication expires on {{ object.expiration_date|date:"M d, Y" }}.
{% endif %}
{% endif %}
Recent Transactions
{% if object.transactions.exists %}
{% for transaction in object.transactions.all|slice:":10" %} {% endfor %}
Date Type Quantity Balance User Notes
{{ transaction.created_at|date:"M d, H:i" }} {{ transaction.get_transaction_type_display }} {% if transaction.transaction_type == 'IN' %}+{% elif transaction.transaction_type == 'OUT' %}-{% endif %}{{ transaction.quantity }} {{ transaction.balance_after }} {{ transaction.user.get_full_name|default:transaction.user.username }} {{ transaction.notes|truncatechars:30|default:"-" }}
{% if object.transactions.count > 10 %} {% endif %} {% else %}

No transactions recorded yet.

{% endif %}
{% if object.medication.storage_conditions or object.medication.special_handling %}
Storage Information
{% if object.medication.storage_conditions %}
Storage Conditions:

{{ object.medication.storage_conditions }}

{% endif %} {% if object.medication.special_handling %}
Special Handling:

{{ object.medication.special_handling }}

{% endif %} {% if object.medication.storage_temperature %}
Storage Temperature: {{ object.medication.storage_temperature }}
{% endif %}
{% endif %}

Quick Actions

Edit Details

Stock Statistics

{{ object.total_received|default:0 }}
Total Received
{{ object.total_dispensed|default:0 }}
Total Dispensed
{{ object.total_adjusted|default:0 }}
Total Adjusted
{{ object.turnover_rate|floatformat:1|default:0 }}
Turnover Rate

Reorder Information

{% if object.current_stock <= object.reorder_level %}
Reorder Needed
{% endif %}
Suggested Order Quantity: {{ object.suggested_order_quantity }}
Lead Time: {{ object.lead_time_days|default:"Not specified" }} days
Preferred Supplier: {{ object.preferred_supplier|default:"Not specified" }}
{% if object.current_stock <= object.reorder_level %}
{% endif %}

Expiration Tracking

{% if object.expiration_date %}
Expiration Date: {{ object.expiration_date|date:"M d, Y" }}
Days Until Expiration: {{ object.days_until_expiration }} days
{% if object.is_expired or object.expires_soon %}
{% endif %} {% else %}
No expiration date specified
{% endif %}
{% include 'pharmacy/partials/adjust_stock_modal.html' %} {% include 'pharmacy/partials/add_stock_modal.html' %} {% include 'pharmacy/partials/transfer_stock_modal.html' %} {% endblock %} {% block js %} {% endblock %}