fix: Улучшения системы ценообразования комплектов
Исправлены 4 проблемы: 1. Расчёт цены первого товара - улучшена валидация в getProductPrice и calculateFinalPrice 2. Отображение actual_price в Select2 вместо обычной цены 3. Количество по умолчанию = 1 для новых форм компонентов 4. Auto-select текста при клике на поле количества для удобства редактирования Изменённые файлы: - products/forms.py: добавлен __init__ в KitItemForm для quantity.initial = 1 - products/templates/includes/select2-product-init.html: обновлена formatSelectResult - products/templates/productkit_create.html: добавлен focus handler для auto-select - products/templates/productkit_edit.html: добавлен focus handler для auto-select 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,8 @@
|
||||
<tr>
|
||||
<th>Уровень лояльности:</th>
|
||||
<td>
|
||||
<span class="badge
|
||||
<span>({{ customer.get_loyalty_discount }}% скидка)</span>
|
||||
<span class="badge ms-2
|
||||
{% if customer.loyalty_tier == 'bronze' %}bg-secondary text-dark
|
||||
{% elif customer.loyalty_tier == 'silver' %}bg-light text-dark
|
||||
{% elif customer.loyalty_tier == 'gold' %}bg-warning text-dark
|
||||
@@ -49,7 +50,6 @@
|
||||
{% endif %}">
|
||||
{{ customer.get_loyalty_tier_display }}
|
||||
</span>
|
||||
<span class="ms-2">({{ customer.get_loyalty_discount }}% скидка)</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -66,19 +66,6 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>День рождения:</th>
|
||||
<td>{{ customer.birthday|date:"d.m.Y"|default:"Не указан" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Годовщина:</th>
|
||||
<td>{{ customer.anniversary|date:"d.m.Y"|default:"Не указана" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Предпочтительные цвета:</th>
|
||||
<td>{{ customer.preferred_colors|default:"Не указаны" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Заметки:</th>
|
||||
<td>{{ customer.notes|default:"Нет" }}</td>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<td>{{ customer.total_spent|default:0|floatformat:2 }} ₽</td>
|
||||
<td>{{ customer.total_spent|default:0|floatformat:2 }} руб.</td>
|
||||
|
||||
<td>
|
||||
{% if customer.is_vip %}
|
||||
|
||||
Reference in New Issue
Block a user