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

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

{% block content %}

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

<div class="content-center">
    <div>
<form action="" method="post">
  {% csrf_token %}
  <table class='table text-center'>
    <thead>
      <tr>
        <td style="width:25%">Article</td>
        <td>Prix HT</td>
        <td>TVA</td>
        <td>Droits</td>
        <td>Commandé</td>
        <td>Reçu</td>
      </tr>
    </thead>
    <tbody>
      {% for form in formset %}
        {% ifchanged form.category %}
          <tr class='section'>
            <td>{{ form.category_name }}</td>
            <td colspan="5"></td>
          </tr>
        {% endifchanged %}
        <tr>
          {{ form.article }}
          <td>{{ form.name }}</td>
          <td>{{ form.price_HT | add_class:"form-control" }}</td>
          <td>{{ form.TVA | add_class:"form-control" }}</td>
          <td>{{ form.rights | add_class:"form-control" }}</td>
          <td>{{ form.quantity_ordered }}</td>
          <td>{{ form.quantity_received | add_class:"form-control" }}</td>
      {% endfor %}
    </tbody>
  </table>
  {{ formset.management_form }}
  {% if not perms.kfet.add_inventory %}
  <div class='auth-form form-horizontal'>
    {% include "kfet/form_authentication_snippet.html" %}
  </div>
  {% endif %}
  <input type="submit" value="Enregistrer" class="btn btn-primary btn-lg btn-block">
</form>
    </div>
</div>

{% endblock %}
