From 271ac66098e3941f137ab1f72e79bcf19fdc88f5 Mon Sep 17 00:00:00 2001 From: Andrey Smakotin Date: Tue, 20 Jan 2026 01:20:50 +0300 Subject: [PATCH] =?UTF-8?q?fix(forms):=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20format=5Fdecimal?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20input=20type=3Dnumber?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Заменён floatformat на format_decimal в полях input type="number", чтобы числа всегда использовали точку как десятичный разделитель, независимо от локали. Это исправляет ошибки парсинга в браузере. Co-Authored-By: Claude Opus 4.5 --- .../templates/discounts/discount_form.html | 79 ++++++++++++++----- .../orders/templates/orders/order_detail.html | 5 +- 2 files changed, 64 insertions(+), 20 deletions(-) diff --git a/myproject/discounts/templates/discounts/discount_form.html b/myproject/discounts/templates/discounts/discount_form.html index 1e9bedd..2b3319b 100644 --- a/myproject/discounts/templates/discounts/discount_form.html +++ b/myproject/discounts/templates/discounts/discount_form.html @@ -1,4 +1,5 @@ {% extends "system_settings/base_settings.html" %} +{% load inventory_filters %} {% block title %}{% if is_edit %}Редактирование скидки{% else %}Создание скидки{% endif %}{% endblock %} @@ -33,13 +34,13 @@
Выше = применяется раньше
@@ -47,7 +48,7 @@
- +
@@ -58,15 +59,15 @@
@@ -74,11 +75,11 @@
@@ -87,7 +88,7 @@
+ {% if form.is_auto.value %}checked{% endif %}> @@ -97,7 +98,7 @@
+ {% if form.is_active.value %}checked{% endif %}> @@ -110,15 +111,15 @@ @@ -131,14 +132,14 @@
Для скидок на заказ
Оставьте пустым для безлимитного использования
@@ -148,12 +149,12 @@
+ value="{{ form.start_date.value|date:'Y-m-d\TH:i'|default_if_none:'' }}">
+ value="{{ form.end_date.value|date:'Y-m-d\TH:i'|default_if_none:'' }}">
@@ -211,4 +212,46 @@
+ + {% endblock %} diff --git a/myproject/orders/templates/orders/order_detail.html b/myproject/orders/templates/orders/order_detail.html index d55ad7f..bd9e827 100644 --- a/myproject/orders/templates/orders/order_detail.html +++ b/myproject/orders/templates/orders/order_detail.html @@ -1,4 +1,5 @@ {% extends 'base.html' %} +{% load inventory_filters %} {% block title %}Заказ {{ order.order_number }}{% endblock %} @@ -337,7 +338,7 @@
{% csrf_token %} - + @@ -351,7 +352,7 @@ type="number" step="0.01" min="0" - max="{% if order.customer.wallet_balance < order.amount_due %}{{ order.customer.wallet_balance|floatformat:2 }}{% else %}{{ order.amount_due|floatformat:2 }}{% endif %}" + max="{% if order.customer.wallet_balance < order.amount_due %}{{ order.customer.wallet_balance|format_decimal:2 }}{% else %}{{ order.amount_due|format_decimal:2 }}{% endif %}" name="wallet_amount" class="form-control" placeholder="Сумма"