Update app.py
Browse files
app.py
CHANGED
|
@@ -1009,49 +1009,56 @@ ADMIN_TEMPLATE = '''
|
|
| 1009 |
</form>
|
| 1010 |
</div>
|
| 1011 |
|
| 1012 |
-
<div class="card">
|
| 1013 |
-
<
|
| 1014 |
-
|
| 1015 |
-
|
| 1016 |
-
<
|
| 1017 |
-
|
| 1018 |
-
|
| 1019 |
-
|
| 1020 |
-
|
| 1021 |
-
|
| 1022 |
-
<
|
| 1023 |
-
|
| 1024 |
-
|
| 1025 |
-
|
| 1026 |
-
|
| 1027 |
-
|
| 1028 |
-
|
| 1029 |
-
|
| 1030 |
-
|
| 1031 |
-
|
| 1032 |
-
|
| 1033 |
-
|
| 1034 |
-
|
| 1035 |
-
|
| 1036 |
-
<
|
| 1037 |
-
|
| 1038 |
-
|
| 1039 |
-
|
| 1040 |
-
|
| 1041 |
-
|
| 1042 |
-
<
|
| 1043 |
-
<
|
| 1044 |
-
|
| 1045 |
-
|
| 1046 |
-
<
|
| 1047 |
-
|
| 1048 |
-
|
| 1049 |
-
|
| 1050 |
-
|
| 1051 |
-
|
| 1052 |
-
|
| 1053 |
-
|
| 1054 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1055 |
</div>
|
| 1056 |
</div>
|
| 1057 |
|
|
@@ -1505,4 +1512,4 @@ if __name__ == '__main__':
|
|
| 1505 |
threading.Thread(target=periodic_backup, daemon=True).start()
|
| 1506 |
|
| 1507 |
port = int(os.environ.get('PORT', 7860))
|
| 1508 |
-
app.run(host='0.0.0.0', port=port)
|
|
|
|
| 1009 |
</form>
|
| 1010 |
</div>
|
| 1011 |
|
| 1012 |
+
<div class="card" style="padding: 0;">
|
| 1013 |
+
<div class="category-header" onclick="toggleCategory('orders-history')" style="border-radius: 16px; border-bottom: none;">
|
| 1014 |
+
<div style="display: flex; align-items: center; gap: 10px;">
|
| 1015 |
+
<i class="fas fa-chevron-down" id="icon-orders-history" style="color: #636e72;"></i>
|
| 1016 |
+
<span style="font-weight: 800; font-size: 1.2rem; color: #2d3436;"><i class="fas fa-file-invoice-dollar" style="color:var(--info);"></i> История накладных</span>
|
| 1017 |
+
</div>
|
| 1018 |
+
</div>
|
| 1019 |
+
<div class="category-content" id="orders-history" style="padding: 0 20px 20px 20px; border-top: 1px solid var(--border);">
|
| 1020 |
+
<div style="overflow-x: auto; padding-top: 15px;">
|
| 1021 |
+
<table class="orders-table">
|
| 1022 |
+
<tr>
|
| 1023 |
+
<th>ID / Дата</th>
|
| 1024 |
+
<th>Клиент</th>
|
| 1025 |
+
<th>Сумма</th>
|
| 1026 |
+
<th>Скидка</th>
|
| 1027 |
+
<th>К оплате</th>
|
| 1028 |
+
<th>Действия</th>
|
| 1029 |
+
</tr>
|
| 1030 |
+
{% for order in orders.values()|sort(attribute='created_at', reverse=True) %}
|
| 1031 |
+
{% set raw_total = 0 %}
|
| 1032 |
+
{% for item in order.cart %}
|
| 1033 |
+
{% set raw_total = raw_total + (item.price|float * item.quantity|int) %}
|
| 1034 |
+
{% endfor %}
|
| 1035 |
+
<tr>
|
| 1036 |
+
<td>
|
| 1037 |
+
<a href="/order/{{ order.id }}" target="_blank" style="color:var(--info); font-weight:bold; text-decoration:none;">{{ order.id }}</a><br>
|
| 1038 |
+
<span style="font-size:0.8rem; color:#636e72;">{{ order.created_at }}</span>
|
| 1039 |
+
</td>
|
| 1040 |
+
<td style="font-size:0.9rem;">
|
| 1041 |
+
{{ order.customer_name }}<br>
|
| 1042 |
+
<i class="fas fa-phone" style="font-size:0.7rem; color:#999;"></i> {{ order.customer_phone }}<br>
|
| 1043 |
+
<i class="fas fa-map-marker-alt" style="font-size:0.7rem; color:#999;"></i> {{ order.customer_city }}
|
| 1044 |
+
</td>
|
| 1045 |
+
<td style="font-weight:600;">{{ raw_total }} {{ currency_code }}</td>
|
| 1046 |
+
<td>
|
| 1047 |
+
<form method="POST" style="display:flex; gap:5px; margin:0; align-items:center;">
|
| 1048 |
+
<input type="hidden" name="action" value="apply_discount">
|
| 1049 |
+
<input type="hidden" name="order_id" value="{{ order.id }}">
|
| 1050 |
+
<input type="number" name="discount_amount" value="{{ order.discount|default(0) }}" min="0" step="0.01" style="width:80px; padding:6px; font-size:0.9rem;">
|
| 1051 |
+
<button type="submit" class="btn btn-warning" style="padding:6px 10px;" title="Применить скидку"><i class="fas fa-check"></i></button>
|
| 1052 |
+
</form>
|
| 1053 |
+
</td>
|
| 1054 |
+
<td style="font-weight:800; color:var(--success);">{{ order.total_price }} {{ currency_code }}</td>
|
| 1055 |
+
<td>
|
| 1056 |
+
<a href="/order/{{ order.id }}" class="btn btn-primary" style="padding:6px 10px;" target="_blank"><i class="fas fa-eye"></i></a>
|
| 1057 |
+
</td>
|
| 1058 |
+
</tr>
|
| 1059 |
+
{% endfor %}
|
| 1060 |
+
</table>
|
| 1061 |
+
</div>
|
| 1062 |
</div>
|
| 1063 |
</div>
|
| 1064 |
|
|
|
|
| 1512 |
threading.Thread(target=periodic_backup, daemon=True).start()
|
| 1513 |
|
| 1514 |
port = int(os.environ.get('PORT', 7860))
|
| 1515 |
+
app.run(host='0.0.0.0', port=port)
|