forked from DGNum/gestioCOF
also sort the unsold table
This commit is contained in:
parent
6d0ec6de43
commit
158b19778b
1 changed files with 36 additions and 25 deletions
|
@ -79,24 +79,30 @@
|
||||||
<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 %}
|
||||||
|
<tbody class="tablesorter-no-sort">
|
||||||
<tr class="section">
|
<tr class="section">
|
||||||
<td colspan="6">{{ article.category.name }}</td>
|
<td colspan="6">{{ category.grouper }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endifchanged %}
|
</tbody>
|
||||||
|
<tbody>
|
||||||
|
{% for article in category.list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url 'kfet.article.read' article.pk %}">
|
<a href="{% url 'kfet.article.read' article.pk %}">
|
||||||
|
@ -107,10 +113,15 @@
|
||||||
<td class="text-right">{{ article.stock }}</td>
|
<td class="text-right">{{ article.stock }}</td>
|
||||||
<td class="text-right">{{ article.is_sold | yesno:"En vente,Non vendu"}}</td>
|
<td class="text-right">{{ article.is_sold | yesno:"En vente,Non vendu"}}</td>
|
||||||
<td class="text-right">{{ article.hidden | yesno:"Caché,Affiché" }}</td>
|
<td class="text-right">{{ article.hidden | yesno:"Caché,Affiché" }}</td>
|
||||||
<td class="text-right">{{ article.inventory.0.at }}</td>
|
{% 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>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue