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

39 lines
2.4 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('expense_add') }}" class="btn btn-primary">+ Новая расходная</a>{% endblock %}
{% block content %}
<div class="sort-bar">
Сортировка:
<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><strong>{{ o.number }}</strong></td>
<td>{{ o.order_date }}</td>
<td><span class="badge">{{ o.type_name }}</span></td>
<td>{{ o.partner_name }}</td>
<td>{{ o.material_name }}</td>
<td>{{ o.quantity }} {{ o.unit }}</td>
<td>{{ "%.2f"|format(o.goods) }}</td>
<td>{% if o.discount > 0 %}{{ o.discount }}%{% 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('expense_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 %}