project_python_v6/templates/orders.html
2026-04-21 09:26:47 +05:00

60 lines
2.8 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% block title %}Заявки — Стройка{% endblock %}
{% block page_title %}Заявки на поставку{% endblock %}
{% block topbar_actions %}
<a href="{{ url_for('order_add') }}" class="btn btn-primary">+ Новая заявка</a>
{% endblock %}
{% block content %}
<!-- Сортировка -->
<div class="sort-bar">
<span>Сортировка:</span>
<a href="?sort=date_desc" class="btn btn-sm {% if sort == 'date_desc' %}btn-primary{% else %}btn-secondary{% endif %}">📅 Дата ↓</a>
<a href="?sort=date_asc" class="btn btn-sm {% if sort == 'date_asc' %}btn-primary{% else %}btn-secondary{% endif %}">📅 Дата ↑</a>
<a href="?sort=price_desc" class="btn btn-sm {% if sort == 'price_desc' %}btn-primary{% else %}btn-secondary{% endif %}">💰 Цена ↓</a>
<a href="?sort=price_asc" class="btn btn-sm {% if sort == 'price_asc' %}btn-primary{% else %}btn-secondary{% endif %}">💰 Цена ↑</a>
</div>
<div class="table-wrapper">
<table class="data-table">
<thead>
<tr>
<th>№</th>
<th>Дата</th>
<th>Партнёр</th>
<th>Материал</th>
<th>Кол-во</th>
<th>Стоимость товара, ₽</th>
<th>Транспорт, ₽</th>
<th>Скидка, %</th>
<th>Скидка, ₽</th>
<th class="highlight-col">ИТОГО, ₽</th>
<th>Действия</th>
</tr>
</thead>
<tbody>
{% for o in orders %}
<tr>
<td style="color:var(--text-light)">{{ o.id }}</td>
<td>{{ o.order_date }}</td>
<td><strong>{{ o.partner_name }}</strong></td>
<td>{{ o.material_name }}</td>
<td>{{ o.quantity }} {{ o.unit }}</td>
<td>{{ "%.2f"|format(o.goods) }}</td>
<td>{{ "%.2f"|format(o.transport) }}</td>
<td>{% if o.discount > 0 %}<span class="badge">{{ o.discount }}%</span>{% else %}—{% endif %}</td>
<td>{% if o.discount_sum > 0 %}−{{ "%.2f"|format(o.discount_sum) }}{% else %}—{% endif %}</td>
<td class="highlight-col"><strong>{{ "%.2f"|format(o.total) }}</strong></td>
<td><a href="{{ url_for('order_edit', oid=o.id) }}" class="btn btn-sm btn-edit">✏️ Изменить</a></td>
</tr>
{% else %}
<tr><td colspan="11" style="text-align:center;padding:2rem;color:#aaa">Заявок пока нет</td></tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="table-meta">Всего заявок: <strong>{{ orders|length }}</strong></div>
{% endblock %}