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

{% 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 }}</td>
          <td>{{ form.TVA }}</td>
          <td>{{ form.rights }}</td>
          <td>{{ form.quantity_ordered }}</td>
          <td>{{ form.quantity_received }}</td>
      {% endfor %}
    </tbody>
  </table>
  {% if not perms.kfet.order_to_inventory %}
    <input type="password" name="KFETPASSWORD">
  {% endif %}
  {{ formset.management_form }}
  <input type="submit" class="btn btn-primary btn-lg btn-block" value="Enregistrer">
</form>
    </div>
</div>

{% endblock %}
