kancelyary_project/templates/order_detail.html

171 lines
4.3 KiB
HTML
Raw 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 content %}
<div class="page-header">
<h2>Заказ #{{ order.order_id }}</h2>
<div class="header-actions">
<a href="{{ url_for('edit_order', order_id=order.order_id) }}" class="btn-edit">Редактировать</a>
<a href="{{ url_for('index') }}" class="btn-back">Назад к списку</a>
</div>
</div>
<div class="order-detail-card">
<div class="order-info">
<div class="info-row">
<span class="info-label">Партнер:</span>
<span class="info-value">{{ order.partner_name }}</span>
</div>
<div class="info-row">
<span class="info-label">Дата заказа:</span>
<span class="info-value">{{ order.order_date }}</span>
</div>
<div class="info-row">
<span class="info-label">Статус:</span>
<span class="info-value status-{{ order.status }}">{{ order.status }}</span>
</div>
{% if order.notes %}
<div class="info-row">
<span class="info-label">Примечания:</span>
<span class="info-value">{{ order.notes }}</span>
</div>
{% endif %}
</div>
<h3>Состав заказа</h3>
{% if order.items and order.items|length > 0 %}
<table class="items-table">
<thead>
<tr>
<th>№</th>
<th>Товар</th>
<th>Количество</th>
<th>Цена за ед.</th>
<th>Сумма</th>
</tr>
</thead>
<tbody>
{% for item in order.items %}
<tr>
<td>{{ loop.index }}</td>
<td>{{ item.product_name }}</td>
<td>{{ item.quantity }}</td>
<td>{{ "%.2f"|format(item.price) }} ₽</td>
<td>{{ "%.2f"|format(item.subtotal) }} ₽</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="4" class="text-right">Сумма без скидки:</td>
<td>{{ "%.2f"|format(order.subtotal) }} ₽</td>
</tr>
{% if order.discount_percent and order.discount_percent > 0 %}
<tr>
<td colspan="4" class="text-right">Скидка ({{ order.discount_desc }}):</td>
<td>-{{ "%.2f"|format(order.discount_amount) }} ₽</td>
</tr>
{% endif %}
<tr class="total-row">
<td colspan="4" class="text-right"><strong>ИТОГО:</strong></td>
<td><strong>{{ "%.2f"|format(order.total) }} ₽</strong></td>
</tr>
</tfoot>
</table>
{% else %}
<div class="empty-state">
<p>В заказе нет товаров</p>
<a href="{{ url_for('edit_order', order_id=order.order_id) }}" class="btn-edit">Добавить товары</a>
</div>
{% endif %}
</div>
<style>
.order-detail-card {
background: white;
border-radius: 8px;
padding: 25px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.order-info {
background-color: #F5F5F5;
padding: 20px;
border-radius: 8px;
margin-bottom: 30px;
}
.info-row {
display: flex;
margin-bottom: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #E0E0E0;
}
.info-row:last-child {
border-bottom: none;
margin-bottom: 0;
padding-bottom: 0;
}
.info-label {
font-weight: 600;
width: 150px;
color: #696969;
}
.info-value {
flex: 1;
}
.items-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
.items-table th {
background-color: #696969;
color: white;
padding: 12px 15px;
text-align: left;
}
.items-table td {
padding: 12px 15px;
border-bottom: 1px solid #E0E0E0;
}
.items-table tbody tr:hover {
background-color: #F5F5F5;
}
.items-table tfoot {
background-color: #E0E0E0;
font-weight: 500;
}
.items-table .total-row {
background-color: #696969;
color: white;
}
.text-right {
text-align: right;
}
.empty-state {
text-align: center;
padding: 40px;
background-color: #F5F5F5;
border-radius: 8px;
margin-top: 20px;
}
.empty-state p {
color: #666;
margin-bottom: 20px;
font-size: 1.1rem;
}
</style>
{% endblock %}