mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +00:00
Fix club sellings
This commit is contained in:
parent
2ef5a4d37b
commit
a12f9dd53e
@ -9,7 +9,7 @@
|
||||
<p><input type="submit" value="{% trans %}Show{% endtrans %}" /></p>
|
||||
</form>
|
||||
<p>
|
||||
{% trans %}Quantity: {% endtrans %}{{ result.count() }} {% trans %}units{% endtrans %}<br/>
|
||||
{% trans %}Quantity: {% endtrans %}{{ total_quantity }} {% trans %}units{% endtrans %}<br/>
|
||||
{% trans %}Total: {% endtrans %}{{ total }} €
|
||||
</p>
|
||||
<table>
|
||||
|
@ -196,6 +196,7 @@ class ClubSellingView(ClubTabsMixin, CanEditMixin, DetailView):
|
||||
qs = qs.filter(product__id=form.cleaned_data['product'].id)
|
||||
kwargs['result'] = qs.all().order_by('-id')
|
||||
kwargs['total'] = sum([s.quantity * s.unit_price for s in qs.all()])
|
||||
kwargs['total_quantity'] = sum([s.quantity for s in qs.all()])
|
||||
else:
|
||||
kwargs['result'] = qs[:0]
|
||||
kwargs['form'] = form
|
||||
|
Loading…
Reference in New Issue
Block a user