65 lines
3.2 KiB
HTML
65 lines
3.2 KiB
HTML
{% extends "base.html" %}
|
||
|
||
{% block content %}
|
||
<h1>📋 Приходные накладные</h1>
|
||
|
||
<!-- Сортировка -->
|
||
<div style="margin-bottom: 1rem; padding: 0.5rem; background: #FDF5E6; border-radius: 5px;">
|
||
<span>Сортировать по: </span>
|
||
<a href="/incoming-orders?sort=date&order={% if sort_by=='date' and order=='desc' %}asc{% else %}desc{% endif %}" style="color: #CD853F; text-decoration: none;">
|
||
📅 Дата {% if sort_by=='date' %}{% if order=='desc' %}↓{% else %}↑{% endif %}{% endif %}
|
||
</a> |
|
||
<a href="/incoming-orders?sort=total&order={% if sort_by=='total' and order=='desc' %}asc{% else %}desc{% endif %}" style="color: #CD853F; text-decoration: none;">
|
||
💰 Сумма {% if sort_by=='total' %}{% if order=='desc' %}↓{% else %}↑{% endif %}{% endif %}
|
||
</a> |
|
||
<a href="/incoming-orders?sort=supplier&order={% if sort_by=='supplier' and order=='desc' %}asc{% else %}desc{% endif %}" style="color: #CD853F; text-decoration: none;">
|
||
🚚 Поставщик {% if sort_by=='supplier' %}{% if order=='desc' %}↓{% else %}↑{% endif %}{% endif %}
|
||
</a>
|
||
</div>
|
||
|
||
{% if orders %}
|
||
{% for order in orders %}
|
||
<div style="background: #FDF5E6; padding: 1rem; margin-bottom: 1rem; border-radius: 10px; border-left: 4px solid
|
||
{% if order.expiry_discount_percent and order.expiry_discount_percent > 0 %}#FFA500{% else %}#CD853F{% endif %};">
|
||
|
||
<div style="display: flex; justify-content: space-between;">
|
||
<strong>Поступление #{{ order.id }}</strong>
|
||
<span style="color: #666;">{{ order.date }}</span>
|
||
</div>
|
||
<p><strong>🚚 Поставщик:</strong> {{ order.supplier_name }}</p>
|
||
<p><strong>📦 Товар:</strong> {{ order.product_name }}</p>
|
||
<p><strong>📅 Срок годности:</strong> {{ order.expiry_date or 'не указан' }}</p>
|
||
<p><strong>📦 Количество:</strong> {{ order.quantity }} шт.</p>
|
||
<p><strong>💰 Цена закупки:</strong> {{ order.purchase_price }} ₽</p>
|
||
|
||
{% if order.expiry_discount_percent and order.expiry_discount_percent > 0 %}
|
||
<div style="background: #FFF3E0; padding: 0.5rem; border-radius: 5px; margin-top: 0.5rem;">
|
||
<p><strong>💰 Стоимость со скидкой:</strong></p>
|
||
<p style="margin-left: 1rem;">
|
||
Сумма: {{ order.total }} ₽<br>
|
||
Скидка по сроку годности: {{ order.expiry_discount_percent }}% ({{ order.discount_amount }} ₽)<br>
|
||
<span style="font-size: 1.1rem; color: #CD853F;"><strong>Итого: {{ order.final_total }} ₽</strong></span>
|
||
</p>
|
||
</div>
|
||
{% else %}
|
||
<p><strong>💰 Итого:</strong> {{ order.total }} ₽</p>
|
||
{% endif %}
|
||
</div>
|
||
{% endfor %}
|
||
{% else %}
|
||
<p>Приходных накладных пока нет.</p>
|
||
<p><a href="/incoming" class="btn-primary">➕ Оформить поступление</a></p>
|
||
{% endif %}
|
||
|
||
<style>
|
||
.btn-primary {
|
||
display: inline-block;
|
||
background: #CD853F;
|
||
color: white;
|
||
padding: 0.5rem 1rem;
|
||
text-decoration: none;
|
||
border-radius: 5px;
|
||
}
|
||
</style>
|
||
{% endblock %}
|