Исправлено форматирование остатков: показ дробных значений

Изменён floatformat с :0 на :-3 для корректного отображения
дробных остатков товаров (до 3 знаков после запятой).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-03 00:16:55 +03:00
parent b4f42f97b0
commit d28a845664
2 changed files with 5 additions and 5 deletions

View File

@@ -285,9 +285,9 @@
{# Информация об остатках для товаров #} {# Информация об остатках для товаров #}
<div class="mt-1"> <div class="mt-1">
<small class="stock-info {% if item.total_free > 0 %}text-success{% else %}text-danger{% endif %}"> <small class="stock-info {% if item.total_free > 0 %}text-success{% else %}text-danger{% endif %}">
<i class="bi bi-box-seam"></i> <i class="bi bi-box-seam"></i>
<strong>{{ item.total_free|floatformat:0 }}</strong> свободно <strong>{{ item.total_free|floatformat:"-3" }}</strong> свободно
<span class="text-muted">/ {{ item.total_available|floatformat:0 }} всего</span> <span class="text-muted">/ {{ item.total_available|floatformat:"-3" }} всего</span>
</small> </small>
</div> </div>
{% endif %} {% endif %}

View File

@@ -193,8 +193,8 @@
</td> </td>
<td> <td>
{% if item.item_type == 'product' %} {% if item.item_type == 'product' %}
<strong class="{% if item.total_free > 0 %}text-success{% else %}text-danger{% endif %}">{{ item.total_free|floatformat:0 }}</strong>{% if item.total_reserved > 0 %}<small class="text-muted"> / {{ item.total_available|floatformat:0 }}</small> <strong class="{% if item.total_free > 0 %}text-success{% else %}text-danger{% endif %}">{{ item.total_free|floatformat:-2 }}</strong>{% if item.total_reserved > 0 %}<small class="text-muted"> / {{ item.total_available|floatformat:-2 }}</small>
<small class="text-warning d-block">{{ item.total_reserved|floatformat:0 }} в резерве</small> <small class="text-warning d-block">{{ item.total_reserved|floatformat:-2 }} в резерве</small>
{% endif %} {% endif %}
{% else %} {% else %}
<span class="text-muted">-</span> <span class="text-muted">-</span>