forked from DGNum/gestioCOF
also sort the unsold table
This commit is contained in:
parent
6d0ec6de43
commit
158b19778b
|
@ -79,38 +79,49 @@
|
||||||
<h2>Articles non vendus</h2>
|
<h2>Articles non vendus</h2>
|
||||||
<h2>Article{{ not_sold_articles|length|pluralize }} non vendu{{ nots_sold_article|length|pluralize }}</h2>
|
<h2>Article{{ not_sold_articles|length|pluralize }} non vendu{{ nots_sold_article|length|pluralize }}</h2>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover table-condensed">
|
<table
|
||||||
|
class="table table-hover table-condensed sortable"
|
||||||
|
{# Initial sort: [(is_sold,desc), (name,asc)] #}
|
||||||
|
data-sortlist="[[3,1], [0,0]]">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Nom</td>
|
<td>Nom</td>
|
||||||
<td class="text-right">Prix</td>
|
<td class="text-right">Prix</td>
|
||||||
<td class="text-right">Stock</td>
|
<td class="text-right">Stock</td>
|
||||||
<td class="text-right">En vente</td>
|
<td class="text-right" data-sorter="article__is_sold">En vente</td>
|
||||||
<td class="text-right">Affiché</td>
|
<td class="text-right" data-sorter="article__hidden">Affiché</td>
|
||||||
<td class="text-right">Dernier inventaire</td>
|
<td class="text-right" data-sorter="shortDate">Dernier inventaire</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
{% regroup not_sold_articles by category as not_sold_category_list %}
|
||||||
{% for article in not_sold_articles %}
|
|
||||||
{% ifchanged article.category %}
|
{% for category in not_sold_category_list %}
|
||||||
<tr class="section">
|
<tbody class="tablesorter-no-sort">
|
||||||
<td colspan="6">{{ article.category.name }}</td>
|
<tr class="section">
|
||||||
</tr>
|
<td colspan="6">{{ category.grouper }}</td>
|
||||||
{% endifchanged %}
|
</tr>
|
||||||
<tr>
|
</tbody>
|
||||||
<td>
|
<tbody>
|
||||||
<a href="{% url 'kfet.article.read' article.pk %}">
|
{% for article in category.list %}
|
||||||
{{ article.name }}
|
<tr>
|
||||||
</a>
|
<td>
|
||||||
</td>
|
<a href="{% url 'kfet.article.read' article.pk %}">
|
||||||
<td class="text-right">{{ article.price }}€</td>
|
{{ article.name }}
|
||||||
<td class="text-right">{{ article.stock }}</td>
|
</a>
|
||||||
<td class="text-right">{{ article.is_sold | yesno:"En vente,Non vendu"}}</td>
|
</td>
|
||||||
<td class="text-right">{{ article.hidden | yesno:"Caché,Affiché" }}</td>
|
<td class="text-right">{{ article.price }}€</td>
|
||||||
<td class="text-right">{{ article.inventory.0.at }}</td>
|
<td class="text-right">{{ article.stock }}</td>
|
||||||
</tr>
|
<td class="text-right">{{ article.is_sold | yesno:"En vente,Non vendu"}}</td>
|
||||||
{% endfor %}
|
<td class="text-right">{{ article.hidden | yesno:"Caché,Affiché" }}</td>
|
||||||
</tbody>
|
{% with last_inventory=article.inventory.0 %}
|
||||||
|
<td class="text-right" title="{{ last_inventory.at }}">
|
||||||
|
{{ last_inventory.at|date:'d/m/Y H:i' }}
|
||||||
|
</td>
|
||||||
|
{% endwith %}
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue