{% extends "base.html" %} {% block title %}本店库存 - {{ current_user.store_name }}{% endblock %} {% block content %}
{{ current_user.store_name }} · 实时库存台账 共 {{ inventory|length }} 种水果
{% for item in inventory %} {% endfor %}
# 水果品类 累计领用 累计销售 当前库存 库存状态
{{ loop.index }} {{ item.fruit_name }} {{ item.total_received }} {{ item.total_sold }} {{ item.current_stock }} {% if item.current_stock == 0 %} 售罄 {% elif item.current_stock <= 5 %} 库存紧张 {% elif item.current_stock <= 20 %} 正常 {% else %} 充足 {% endif %}
合计 {{ inventory|sum(attribute='total_received') }} {{ inventory|sum(attribute='total_sold') }} {{ inventory|sum(attribute='current_stock') }}
{% endblock %}