{% extends 'inventory/base_inventory_minimal.html' %}
{% load inventory_filters %}
{% block inventory_title %}Перемещение товаров{% endblock %}
{% block breadcrumb_current %}Перемещения{% endblock %}
{% block inventory_content %}
<div class="card">
    <div class="card-header">
        <h4 class="mb-0">Перемещение товаров между складами
            <a href="{% url 'inventory:transfer-create' %}" class="btn btn-primary btn-sm float-end">
                <i class="bi bi-plus-circle"></i> Новое
            </a>
        </h4>
    </div>
    <div class="card-body">
        {% if transfers %}
        <div class="table-responsive">
            <table class="table table-hover table-sm">
                <thead>
                    <tr>
                        <th>Номер документа</th>
                        <th>Из</th>
                        <th>В</th>
                        <th>Товаров</th>
                        <th>Дата создания</th>
                        <th class="text-end">Действия</th>
                    </tr>
                </thead>
                <tbody>
                    {% for t in transfers %}
                    <tr>
                        <td>
                            <a href="{% url 'inventory:transfer-detail' t.pk %}">{{ t.document_number }}</a>
                        </td>
                        <td>{{ t.from_warehouse.name }}</td>
                        <td>{{ t.to_warehouse.name }}</td>
                        <td>{{ t.items.count }}</td>
                        <td>{{ t.created_at|date:"d.m.Y H:i" }}</td>
                        <td class="text-end">
                            <a href="{% url 'inventory:transfer-detail' t.pk %}" class="btn btn-sm btn-outline-info" title="Просмотр">
                                <i class="bi bi-eye"></i>
                            </a>
                            <!--
                            <a href="{% url 'inventory:transfer-delete' t.pk %}" class="btn btn-sm btn-outline-danger" title="Удалить">
                                <i class="bi bi-trash"></i>
                            </a>
                            -->
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
        {% else %}
        <div class="alert alert-info">Перемещений не найдено.</div>
        {% endif %}
    </div>
</div>
{% endblock %}
