fix(forms): использовать format_decimal для input type=number

Заменён floatformat на format_decimal в полях input type="number",
чтобы числа всегда использовали точку как десятичный разделитель,
независимо от локали. Это исправляет ошибки парсинга в браузере.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-20 01:20:50 +03:00
parent 0b5db0c2e6
commit 271ac66098
2 changed files with 64 additions and 20 deletions

View File

@@ -1,4 +1,5 @@
{% extends 'base.html' %}
{% load inventory_filters %}
{% block title %}Заказ {{ order.order_number }}{% endblock %}
@@ -337,7 +338,7 @@
<!-- Кнопка "Применить максимум" -->
<form method="post" action="{% url 'orders:apply-wallet' order.order_number %}" class="mb-2">
{% csrf_token %}
<input type="hidden" name="wallet_amount" value="{% if order.customer.wallet_balance < order.amount_due %}{{ order.customer.wallet_balance|floatformat:2 }}{% else %}{{ order.amount_due|floatformat:2 }}{% endif %}">
<input type="hidden" name="wallet_amount" value="{% if order.customer.wallet_balance < order.amount_due %}{{ order.customer.wallet_balance|format_decimal:2 }}{% else %}{{ order.amount_due|format_decimal:2 }}{% endif %}">
<button type="submit" class="btn btn-success w-100">
<i class="bi bi-wallet2"></i> Применить максимум
</button>
@@ -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="Сумма"