Relevés d'une caisse triéés par date desc
This commit is contained in:
parent
b6c75fd84a
commit
6a175eee08
2 changed files with 14 additions and 11 deletions
|
@ -17,17 +17,15 @@
|
|||
<div class="content-right-block">
|
||||
<h2>Relevés</h2>
|
||||
<div>
|
||||
{% with statements=checkout.statements.all %}
|
||||
{% if not statements %}
|
||||
Pas de relevé
|
||||
{% else %}
|
||||
<ul>
|
||||
{% for statement in statements %}
|
||||
<li>{{ statement }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% if not statements %}
|
||||
Pas de relevé
|
||||
{% else %}
|
||||
<ul>
|
||||
{% for statement in statements %}
|
||||
<li><a href="{% url 'kfet.checkoutstatement.update' checkout.pk statement.pk %}">{{ statement }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -379,6 +379,11 @@ class CheckoutRead(DetailView):
|
|||
template_name = 'kfet/checkout_read.html'
|
||||
context_object_name = 'checkout'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(CheckoutRead, self).get_context_data(**kwargs)
|
||||
context['statements'] = context['checkout'].statements.order_by('-at')
|
||||
return context
|
||||
|
||||
# Checkout - Update
|
||||
|
||||
class CheckoutUpdate(SuccessMessageMixin, UpdateView):
|
||||
|
|
Loading…
Reference in a new issue