From a12f9dd53eca4fd97311a17cb690fa294463ec25 Mon Sep 17 00:00:00 2001 From: Skia Date: Mon, 3 Oct 2016 13:55:20 +0200 Subject: [PATCH] Fix club sellings --- club/templates/club/club_sellings.jinja | 2 +- club/views.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/club/templates/club/club_sellings.jinja b/club/templates/club/club_sellings.jinja index 6e4848df..34acc234 100644 --- a/club/templates/club/club_sellings.jinja +++ b/club/templates/club/club_sellings.jinja @@ -9,7 +9,7 @@

-{% trans %}Quantity: {% endtrans %}{{ result.count() }} {% trans %}units{% endtrans %}
+{% trans %}Quantity: {% endtrans %}{{ total_quantity }} {% trans %}units{% endtrans %}
{% trans %}Total: {% endtrans %}{{ total }} €

diff --git a/club/views.py b/club/views.py index 65760f38..82a1c0f4 100644 --- a/club/views.py +++ b/club/views.py @@ -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