{% extends "base.html" %} {% load static %} {% block title %}Stock Details - {{ object.item.name }}{% endblock %} {% block content %}

Stock Details - {{ object.inventory_item.item_name }}

Stock Information

{% if object.current_quantity <= object.minimum_quantity %} Critical Stock {% elif object.current_quantity <= object.reorder_level %} Low Stock {% else %} In Stock {% endif %}
Item: {{ object.inventory_item.item_name }}
SKU: {{ object.inventory_item.item_code }}
Category: {{ object.inventory_item.get_category_display }}
Location: {{ object.location.name }}
Current Quantity: {{ object.quantity_available }} {{ object.inventory_item.unit_of_measure }}
Minimum Quantity: {{ object.inventory_item.min_stock_level }} {{ object.inventory_item.unit_of_measure }}
Reorder Level: {{ object.inventory_item.reorder_point }} {{ object.inventory_item.unit_of_measure }}
Maximum Quantity: {{ object.inventory_item.max_stock_level|default:"Not set" }} {{ object.item.unit_of_measure }}
Unit Cost: ê{{ object.unit_cost|floatformat:'2g' }}
Total Value: ê{{ object.total_cost|floatformat:'2g' }}
Stock Level {{ object.quantity_available }} / {{ object.inventory_item.min_stock_level }} {{ object.inventory_item.unit_of_measure }}
{% if object.inventory_item.max_stock_level %} {% widthratio object.quantity_available object.inventory_item.max_stock_level 100 as percentage %} {% else %} {% widthratio object.quantity_available object.inventory_item.min_stock_level 100 as percentage %} {% endif %}
Min: {{ object.inventory_item.min_stock_level }} Reorder: {{ object.inventory_item.reorder_point }} {% if object.maximum_quantity %} Max: {{ object.inventory_item.max_stock_level }} {% endif %}
{% if object.notes %}
Notes:
{{ object.notes }}
{% endif %}

Recent Transactions

{% if recent_transactions %}
{% for transaction in recent_transactions %} {% endfor %}
Date Type Quantity Balance Reference User
{{ transaction.date|date:"M d, Y" }}
{{ transaction.date|time:"g:i A" }}
{{ transaction.get_transaction_type_display }} {% if transaction.transaction_type == 'in' %}+{% elif transaction.transaction_type == 'out' %}-{% endif %}{{ transaction.quantity }} {{ transaction.balance_after }} {% if transaction.reference %} {{ transaction.reference }} {% else %} - {% endif %} {{ transaction.user.get_full_name|default:"System" }}
{% else %}
No Transactions

No transaction history available for this stock item.

{% endif %}
{% if expiring_batches %}

Expiring Batches

{% for batch in expiring_batches %} {% endfor %}
Batch Number Quantity Expiry Date Days Left Status
{{ batch.batch_number }} {{ batch.quantity }} {{ object.item.unit_of_measure }} {{ batch.expiry_date|date:"M d, Y" }} {{ batch.days_until_expiry }} days {% if batch.days_until_expiry <= 0 %} Expired {% elif batch.days_until_expiry <= 7 %} Critical {% elif batch.days_until_expiry <= 30 %} Warning {% else %} Good {% endif %}
{% endif %}
Quick Actions
Statistics (30 days)
{{ stock_stats.total_in|default:0 }}
Stock In
{{ stock_stats.total_out|default:0 }}
Stock Out

Turnover Rate {{ stock_stats.turnover_rate|default:0 }}%
Average Daily Usage: {{ stock_stats.avg_daily_usage|default:0 }} {{ object.item.unit_of_measure }}
Days of Stock: {{ stock_stats.days_of_stock|default:0 }} days
{% if object.item.suppliers.exists %}
Suppliers
{% for supplier in object.item.suppliers.all %}
{{ supplier.contact_person }}
{{ supplier.phone }}
{% endfor %}
{% endif %} {% if alerts %}
Alerts
{% for alert in alerts %} {% endfor %}
{% endif %}
Location Details
Location: {{ object.location.name }}
Zone: {{ object.location.zone|default:"Not specified" }}
Aisle: {{ object.location.aisle|default:"Not specified" }}
Shelf: {{ object.location.shelf|default:"Not specified" }}
Temperature: {{ object.location.temperature_range|default:"Room temperature" }}
{% endblock %}