mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Update shopping list history (ShoppingListItem creation)
This commit is contained in:
@ -10,25 +10,42 @@
|
||||
{% endif %}
|
||||
|
||||
<h3>{{ shoppinglist.name }}</h3>
|
||||
{% for t in ProductType.objects.order_by('name') %}
|
||||
{% if shoppinglist.items_to_buy.filter(type=t) %}
|
||||
{% for t in ProductType.objects.order_by('name').all() %}
|
||||
{% if shoppinglist.shopping_items_to_buy.filter(type=t) %}
|
||||
<h4>{{ t }}</h4>
|
||||
<br>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{% trans %}Name{% endtrans %}</td>
|
||||
<td>{% trans %}Number{% endtrans %}</td>
|
||||
<td>{% trans %}Quantity asked{% endtrans %}</td>
|
||||
<td>{% trans %}Quantity bought{% endtrans %}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for i in shoppinglist.items_to_buy.filter(type=t).order_by('name') %}
|
||||
{% for i in shoppinglist.shopping_items_to_buy.filter(type=t).order_by('name').all() %}
|
||||
<tr>
|
||||
<td>{{ i.name }}</td>
|
||||
<td>{{ i.tobuy_quantity }}</td>
|
||||
<td>{{ i.bought_quantity }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<h4>Other</h4>
|
||||
<br>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{% trans %}Comments{% endtrans %}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ shoppinglist.comment }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
@ -28,11 +28,11 @@ Shopping list for {{ stock }}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for s in shoppinglist_list.filter(todo=True).filter(stock_owner=stock).order_by('-date') %}
|
||||
{% for s in stock.shopping_lists.filter(todo=True).filter(stock_owner=stock).order_by('-date').all() %}
|
||||
<tr>
|
||||
<td>{{ s.date|localtime|date("Y-m-d H:i") }}</td>
|
||||
<td><a href="{{ url('stock:shoppinglist_items', stock_id=stock.id, shoppinglist_id=s.id)}}">{{ s.name }}</a></td>
|
||||
<td>{{ s.items_to_buy.count() }}</td>
|
||||
<td>{{ s.shopping_items_to_buy.count() }}</td>
|
||||
<td>
|
||||
<a href="{{ url('stock:update_after_shopping', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Update stock{% endtrans %}</a>
|
||||
</td>
|
||||
@ -57,11 +57,11 @@ Shopping list for {{ stock }}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for s in shoppinglist_list.filter(todo=False).filter(stock_owner=stock).order_by('-date') %}
|
||||
{% for s in stock.shopping_lists.filter(todo=False).filter(stock_owner=stock).order_by('-date').all() %}
|
||||
<tr>
|
||||
<td>{{ s.date|localtime|date("Y-m-d H:i") }}</td>
|
||||
<td><a href="{{ url('stock:shoppinglist_items', stock_id=stock.id, shoppinglist_id=s.id)}}">{{ s.name }}</a></td>
|
||||
<td>{{ s.items_to_buy.count() }}</td>
|
||||
<td>{{ s.shopping_items_to_buy.count() }}</td>
|
||||
<td>
|
||||
<a href="{{ url('stock:shoppinglist_set_todo', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Mark as to do{% endtrans %}</a>
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user