{% extends "base.html" %} {% from "components/ui.html" import page_header %} {% block content %} {% set breadcrumbs = [ {'text': 'Inventory', 'url': url_for('inventory.list_stock_items')}, {'text': 'Warehouses', 'url': url_for('inventory.list_warehouses')}, {'text': warehouse.name} ] %} {{ page_header( icon_class='fas fa-warehouse', title_text=warehouse.name, subtitle_text=warehouse.code, breadcrumbs=breadcrumbs, actions_html='Edit' if (current_user.is_admin or has_permission('manage_warehouses')) else None ) }}

{{ _('Warehouse Details') }}

{{ warehouse.code }}

{% if warehouse.is_active %} {{ _('Active') }} {% else %} {{ _('Inactive') }} {% endif %}

{% if warehouse.address %}

{{ warehouse.address }}

{% endif %} {% if warehouse.contact_person %}

{{ warehouse.contact_person }}

{% endif %} {% if warehouse.contact_email %}

{{ warehouse.contact_email }}

{% endif %} {% if warehouse.contact_phone %}

{{ warehouse.contact_phone }}

{% endif %} {% if warehouse.notes %}

{{ warehouse.notes }}

{% endif %}
{% if stock_levels %}

{{ _('Stock Levels') }}

{% for stock in stock_levels %} {% endfor %}
{{ _('Item') }} {{ _('SKU') }} {{ _('On Hand') }} {{ _('Reserved') }} {{ _('Available') }} {{ _('Location') }}
{{ stock.stock_item.name }} {{ stock.stock_item.sku }} {{ stock.quantity_on_hand }} {{ stock.quantity_reserved }} {{ stock.quantity_available }} {% if stock.stock_item.reorder_point and stock.quantity_on_hand < stock.stock_item.reorder_point %} {% endif %} {{ stock.location or '—' }}
{% else %}

{{ _('No stock items in this warehouse.') }}

{% endif %} {% if recent_movements %}

{{ _('Recent Stock Movements') }}

{% for movement in recent_movements %} {% endfor %}
{{ _('Date') }} {{ _('Item') }} {{ _('Type') }} {{ _('Quantity') }} {{ _('Reason') }}
{{ movement.moved_at.strftime('%Y-%m-%d %H:%M') if movement.moved_at else '—' }} {{ movement.stock_item.name }} {{ movement.movement_type }} {{ '+' if movement.quantity > 0 else '' }}{{ movement.quantity }} {{ movement.reason or '—' }}
{% endif %}

{{ _('Summary') }}

{{ stock_levels|length }}

{{ stock_levels|sum(attribute='quantity_on_hand')|default(0) }}

{% endblock %}