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 }} | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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" }} | |
- Клиент имеет отменённые заказы с внесённой оплатой. - Общая сумма к возврату: {{ refund_amount|floatformat:2 }} руб. -
+ +| № | +Дата | +Статус | +Сумма | +Остаток | ++ |
|---|---|---|---|---|---|
| #{{ order.order_number }} | +{{ order.created_at|date:"d.m.y" }} | ++ {% if order.status %} + {% if order.status.code == 'draft' %} + Черновик + {% elif order.status.code == 'pending' %} + Ожидает + {% elif order.status.code == 'in_production' %} + В пр-ве + {% elif order.status.code == 'ready' %} + Готов + {% elif order.status.code == 'delivered' %} + Доставлен + {% elif order.status.code == 'cancelled' %} + Отменён + {% else %} + {{ order.status.name }} + {% endif %} + {% else %} + - + {% endif %} + | +{{ order.total_amount|floatformat:2 }} | ++ {% if order.status and order.status.is_negative_end %} + {% if order.amount_paid > 0 %} + + {{ order.amount_paid|floatformat:2 }} + + {% else %} + — + {% endif %} + {% elif order.amount_due > 0 %} + {{ order.amount_due|floatformat:2 }} + {% else %} + 0.00 + {% endif %} + | ++ + + + | +
У клиента пока нет заказов.
+ {% endif %} +| Дата | +Тип | +Сумма | +Описание | +Заказ | +
|---|---|---|---|---|
| {{ transaction.created_at|date:"d.m.y H:i" }} | ++ {% if transaction.transaction_type == 'deposit' %} + Пополн. + {% elif transaction.transaction_type == 'spend' %} + Списан. + {% else %} + Корр. + {% endif %} + | ++ {% if transaction.transaction_type == 'deposit' or transaction.transaction_type == 'adjustment' and transaction.amount > 0 %} + +{{ transaction.amount|floatformat:2 }} + {% else %} + -{{ transaction.amount|floatformat:2 }} + {% endif %} + | +{{ transaction.description|default:"-"|truncatewords:5 }} | ++ {% if transaction.order %} + + #{{ transaction.order.order_number }} + + {% else %} + - + {% endif %} + | +
История транзакций пуста.
+ {% endif %} ++ Клиент имеет отменённые заказы с внесённой оплатой. + Общая сумма к возврату: {{ refund_amount|floatformat:2 }} руб. +
| Дата | -Тип | -Сумма | -Описание | -Заказ | -Создал | -
|---|---|---|---|---|---|
| {{ transaction.created_at|date:"d.m.Y H:i" }} | -- {% if transaction.transaction_type == 'deposit' %} - Пополнение - {% elif transaction.transaction_type == 'spend' %} - Списание - {% else %} - Корректировка - {% endif %} - | -- {% if transaction.transaction_type == 'deposit' or transaction.transaction_type == 'adjustment' and transaction.amount > 0 %} - +{{ transaction.amount|floatformat:2 }} руб. - {% else %} - -{{ transaction.amount|floatformat:2 }} руб. - {% endif %} - | -{{ transaction.description|default:"-" }} | -- {% if transaction.order %} - - #{{ transaction.order.order_number }} - - {% else %} - - - {% endif %} - | -{{ transaction.created_by.username|default:"-" }} | -
История транзакций пуста.
- {% endif %} -| № | -Дата создания | -Дата доставки | -Статус | -Оплата | -Сумма | -Оплачено | -Остаток | -Возврат | -Действия | -
|---|---|---|---|---|---|---|---|---|---|
| #{{ order.order_number }} | -{{ order.created_at|date:"d.m.Y H:i" }} | -
- {% if order.delivery_date %}
- {{ order.delivery_date|date:"d.m.Y" }}
- {% if order.delivery_time %}
- {{ order.delivery_time }} - {% endif %} - {% if order.is_delivery %} - Доставка - {% else %} - Самовывоз - {% endif %} - {% else %} - Не указана - {% endif %} - |
- - {% if order.status %} - {% if order.status.code == 'draft' %} - Черновик - {% elif order.status.code == 'pending' %} - Ожидает - {% elif order.status.code == 'in_production' %} - В производстве - {% elif order.status.code == 'ready' %} - Готов - {% elif order.status.code == 'delivered' %} - Доставлен - {% elif order.status.code == 'cancelled' %} - Отменён - {% else %} - {{ order.status.name }} - {% endif %} - {% else %} - Без статуса - {% endif %} - | -- {% if order.is_paid %} - - Оплачено - - {% elif order.status and order.status.is_negative_end and order.amount_paid > 0 %} - - Возврат ({{ order.amount_paid|floatformat:2 }} руб.) - - {% elif order.amount_paid > 0 %} - - Частично ({{ order.amount_paid|floatformat:2 }} руб.) - - {% else %} - - Не оплачено - - {% endif %} - | -{{ order.total_amount|floatformat:2 }} руб. | -- {% if order.amount_paid > 0 %} - {{ order.amount_paid|floatformat:2 }} руб. - {% else %} - 0.00 руб. - {% endif %} - | -- {% if order.status and order.status.is_negative_end %} - — - {% elif order.amount_due > 0 %} - {{ order.amount_due|floatformat:2 }} руб. - {% else %} - 0.00 руб. - {% endif %} - | -- {% if order.status and order.status.is_negative_end and order.amount_paid > 0 %} - - {{ order.amount_paid|floatformat:2 }} руб. - - {% else %} - — - {% endif %} - | -- - - - - - - | -
У клиента пока нет заказов.
- {% endif %} -