kancelyary_project/templates/view_order.html

211 lines
5.2 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 content %}
<div class="page-header">
<h2>Просмотр заказа #{{ order.order_id }}</h2>
<a href="{{ url_for('index') }}" class="btn-back">Назад к списку</a>
</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>
{% 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>
<th>Сумма с наценкой 10%</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.base_subtotal) }} ₽</td>
<td>{{ "%.2f"|format(item.subtotal_with_markup) }} ₽</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="4" class="text-right"><strong>Итого без наценки:</strong></td>
<td><strong>{{ "%.2f"|format(order.subtotal_without_markup) }} ₽</strong></td>
<td></td>
</tr>
<tr>
<td colspan="4" class="text-right">Наценка 10%:</td>
<td></td>
<td>+{{ "%.2f"|format(order.subtotal_with_markup - order.subtotal_without_markup) }} ₽</td>
</tr>
<tr>
<td colspan="4" class="text-right"><strong>Сумма с наценкой:</strong></td>
<td></td>
<td><strong>{{ "%.2f"|format(order.subtotal_with_markup) }} ₽</strong></td>
</tr>
{% if order.discount_percent and order.discount_percent > 0 %}
<tr>
<td colspan="4" class="text-right">Скидка ({{ order.discount_desc }}):</td>
<td></td>
<td>-{{ "%.2f"|format(order.discount_amount) }} ₽</td>
</tr>
{% endif %}
<tr class="total-row">
<td colspan="4" class="text-right"><strong>ИТОГО К ОПЛАТЕ:</strong></td>
<td></td>
<td><strong>{{ "%.2f"|format(order.total) }} ₽</strong></td>
</tr>
</tfoot>
</table>
{% else %}
<div class="empty-state">
<p>В заказе нет товаров</p>
</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 tfoot tr:last-child {
background-color: #696969;
color: white;
}
.items-table .total-row td {
font-size: 1.1rem;
}
.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;
}
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
}
.page-header h2 {
font-size: 2rem;
color: #696969;
font-weight: 500;
}
.btn-back {
display: inline-block;
background-color: #E0E0E0;
color: #696969;
text-decoration: none;
padding: 8px 16px;
border-radius: 4px;
font-weight: 600;
transition: background-color 0.3s;
border: 1px solid #696969;
}
.btn-back:hover {
background-color: #D0D0D0;
}
</style>
{% endblock %}