From 07829f867b64fa281be818ed25b7e8912d42b996 Mon Sep 17 00:00:00 2001 From: Andrey Smakotin Date: Sun, 28 Dec 2025 23:59:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D1=89=D0=B8=D1=82=D0=B0=20=D1=83?= =?UTF-8?q?=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B7=D0=B0=D0=BA?= =?UTF-8?q?=D0=B0=D0=B7=D0=BE=D0=B2=20=D0=B8=20=D1=83=D0=BB=D1=83=D1=87?= =?UTF-8?q?=D1=88=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80?= =?UTF-8?q?=D1=84=D0=B5=D0=B9=D1=81=D0=B0=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Orders: - Удаление разрешено только для черновиков (draft) - Запрет удаления заказов с оплатой (amount_paid > 0) - Кнопка "Удалить" скрыта для недопустимых заказов Customers: - Inline-редактирование полей клиента - Улучшен дизайн карточки клиента - Добавлена история заказов и кошелька 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../templates/customers/customer_detail.html | 858 +++++++++++------- .../templates/customers/customer_form.html | 111 +-- .../templates/customers/customer_list.html | 6 +- myproject/customers/urls.py | 2 +- myproject/customers/views.py | 119 ++- .../orders/templates/orders/order_detail.html | 2 + myproject/orders/views.py | 24 +- 7 files changed, 684 insertions(+), 438 deletions(-) diff --git a/myproject/customers/templates/customers/customer_detail.html b/myproject/customers/templates/customers/customer_detail.html index d18065f..9ce2626 100644 --- a/myproject/customers/templates/customers/customer_detail.html +++ b/myproject/customers/templates/customers/customer_detail.html @@ -6,12 +6,15 @@
-
-

Клиент: {{ customer.full_name }}

+
@@ -20,67 +23,161 @@
-
-
-
Информация о клиенте
+
+
+
Информация о клиенте
- - - - - - - - - - - - - - - - - - - - - - - +
Имя:{{ customer.full_name }}
Email:{{ customer.email|default:"Не указано" }}
Телефон:{{ customer.phone|default:"Не указано" }}
Сумма всех успешных заказов:{{ total_orders_sum|floatformat:2 }} руб.
Сумма заказов за последний год:{{ last_year_orders_sum|floatformat:2 }} руб.
Общий долг по активным заказам:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + + + + + + + + + + + + - - + + +
Имя: - {% if total_debt > 0 %} - {{ total_debt|floatformat:2 }} руб. - (Кол-во заказов: {{ active_orders_count }}) - {% else %} - 0.00 руб. - {% endif %} + {{ customer.name|default:"—" }} + +
+ + + +
+
+
+ + +
+
Телефон: + {{ customer.phone|default:"—" }} + +
+ + + +
+
+
+ + +
+
Email: + {{ customer.email|default:"—" }} + +
+ + + +
+
+
+ + +
+
Заметки: + {{ customer.notes|default:"—" }} + +
+ + + +
+
+ +

Все успешные заказы: + {{ total_orders_sum|floatformat:2 }} руб.
Заметки:{{ customer.notes|default:"Нет" }} За последний год: + {{ last_year_orders_sum|floatformat:2 }} руб. +
Дата создания:{{ customer.created_at|date:"d.m.Y H:i" }} Общий долг: + {% if total_debt > 0 %} + {{ total_debt|floatformat:2 }} руб. + (Заказов: {{ active_orders_count }}) + {% else %} + 0.00 руб. + {% endif %} +

Дата создания:{{ customer.created_at|date:"d.m.Y H:i" }}
Дата обновления:{{ customer.updated_at|date:"d.m.Y H:i" }} Последнее изменение:{{ customer.updated_at|date:"d.m.Y H:i" }}
- +
-
-
-
Каналы связи
+ +
+
+
Каналы связи
@@ -112,12 +209,17 @@ {% if channel.is_primary %}основной{% endif %} {% if channel.notes %}{{ channel.notes }}{% endif %}
-
- {% csrf_token %} - -
+
+ {% csrf_token %} + +
+
{% endfor %} @@ -126,35 +228,202 @@ {% endif %}
-
- - {% if refund_amount > 0 %} -
-