Order creation improvements.

- colspan takes into account the scale length.
- add box_capacity
This commit is contained in:
Aurélien Delobelle 2017-05-19 17:55:31 +02:00
parent c0b8430a12
commit 109a692cea
2 changed files with 8 additions and 5 deletions

View file

@ -17,7 +17,7 @@
<thead>
<tr>
<td rowspan="2">Article</td>
<td colspan="5">Ventes
<td colspan="{{ scale|length }}">Ventes
<span class='glyphicon glyphicon-question-sign' title="Ventes des 5 dernières semaines" data-placement="bottom"></span>
</td>
<td rowspan="2">V. moy.<br>
@ -30,6 +30,9 @@
<span class='glyphicon glyphicon-question-sign' title="Prévision de ventes" data-placement="bottom"></span>
</td>
<td rowspan="2">Stock</td>
<td rowspan="2">Box<br>
<span class='glyphicon glyphicon-question-sign' title="Capacité d'une boite" data-placement="bottom"></span>
</td>
<td rowspan="2">Rec.<br>
<span class='glyphicon glyphicon-question-sign' title="Quantité conseillée" data-placement="bottom"></span>
</td>
@ -44,9 +47,8 @@
<tbody>
{% for form in formset %}
{% ifchanged form.category %}
<tr class='section'>
<td> {{ form.category_name }}</td>
<td colspan="11"></td>
<tr class='section text-left'>
<td colspan="{{ scale|length|add:'8' }}">{{ form.category_name }}</td>
</tr>
{% endifchanged %}
<tr>
@ -59,6 +61,7 @@
<td>{{ form.v_et }}</td>
<td>{{ form.v_prev }}</td>
<td>{{ form.stock }}</td>
<td>{{ form.box_capacity|default:"" }}</td>
<td>{{ form.c_rec }}</td>
<td class="nopadding">{{ form.quantity_ordered | add_class:"form-control" }}</td>
</tr>

View file

@ -1910,7 +1910,7 @@ def order_create(request, pk):
else:
formset = cls_formset(initial=initial)
scale.label_fmt = "S-{rev_i}"
scale.label_fmt = "S -{rev_i}"
return render(request, 'kfet/order_create.html', {
'supplier': supplier,