{% extends 'kfet/base.html' %}

{% block title %}Nouvel inventaire{% endblock %}
{% block content-header-title %}Nouvel inventaire{% endblock %}

{% block content %}

{% include 'kfet/base_messages.html' %}

<form action="" method="post">
  <table>
    <thead>
      <tr>
        <td>Article</td>
        <td>Théo.</td>
        <td>Réel</td>
      </tr>
    </thead>
    <tbody>
      {% for form in formset %}
        {% ifchanged form.category %}
          <tr>
            <td colspan="3">{{ form.category_name }}</td>
          </tr>
        {% endifchanged %}
        <tr>
          {{ form.article }}
          <td>{{ form.name }}</td>
          <td>{{ form.stock_old }}</td>
          <td>{{ form.stock_new }}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
  {% if not perms.kfet.add_inventory %}
    <input type="password" name="KFETPASSWORD">
  {% endif %}
  {% csrf_token %}
  {{ formset.management_form }}
  <input type="submit" value="Enregistrer" class="btn btn-primary btn-lg">
</form>

{% endblock %}
