Commit a12f9dd5 authored by Skia's avatar Skia
Browse files

Fix club sellings

parent 2ef5a4d3
Pipeline #269 failed with stage
in 19 seconds
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment