{% extends "base.html" %} {% block title %}{{ customer.full_name }}{% endblock %} {% block content %}
Информация о клиенте
{% if total_debt > 0 %} {% endif %}
Имя: {{ customer.name|default:"—" }}
Телефон: {{ customer.phone|default:"—" }}
Email: {{ customer.email|default:"—" }}
Заметки: {{ customer.notes|default:"—" }}

Все успешные заказы: {{ total_orders_sum|floatformat:2 }} руб.
За последний год: {{ last_year_orders_sum|floatformat:2 }} руб.
Общий долг: {{ total_debt|floatformat:2 }} руб. (Заказов: {{ active_orders_count }})

Дата создания: {{ customer.created_at|date:"d.m.Y H:i" }}
Последнее изменение: {{ customer.updated_at|date:"d.m.Y H:i" }}
Каналы связи
{% if contact_channels %}
    {% for channel in contact_channels %}
  • {% if channel.channel_type == 'telegram' %} Telegram {% elif channel.channel_type == 'instagram' %} Instagram {% elif channel.channel_type == 'whatsapp' %} WhatsApp {% elif channel.channel_type == 'viber' %} Viber {% elif channel.channel_type == 'vk' %} VK {% elif channel.channel_type == 'facebook' %} Facebook {% elif channel.channel_type == 'phone' %} Телефон {% elif channel.channel_type == 'email' %} Email {% else %} {{ channel.get_channel_type_display }} {% endif %} {{ channel.value }} {% if channel.is_primary %}основной{% endif %} {% if channel.notes %}{{ channel.notes }}{% endif %}
    {% csrf_token %}
  • {% endfor %}
{% else %}

Нет дополнительных каналов связи. Добавьте Instagram, Telegram и другие контакты.

{% endif %}
Новый
{% if orders_page %}
{% for order in orders_page %} 0 %}class="table-warning"{% endif %}> {% endfor %}
Дата Статус Сумма Остаток
#{{ 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 %}
{% if orders_page.has_other_pages %}
{% endif %} {% else %}

У клиента пока нет заказов.

{% endif %}
{% if wallet_transactions %}
{% for transaction in wallet_transactions %} {% endfor %}
Дата Тип Сумма Описание Заказ
{{ 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 %}
{% else %}

История транзакций пуста.

{% endif %}
Операции с кошельком клиента
{% if customer.wallet_balance > 0 %} {{ customer.wallet_balance|floatformat:2 }} руб. {% elif customer.wallet_balance == 0 %} {{ customer.wallet_balance|floatformat:2 }} руб. {% else %} {{ customer.wallet_balance|floatformat:2 }} руб. {% endif %}
Пополнение
{% csrf_token %}
Списание
{% csrf_token %}
Макс: {{ customer.wallet_balance|floatformat:2 }} р.
Все операции логируются в истории выше.
{% if refund_amount > 0 %}
{% endif %}
{% endblock %}