From 50d34af42850ba4816af26737cd9a7366b675ddb Mon Sep 17 00:00:00 2001 From: root Date: Wed, 4 Mar 2015 02:24:04 +0000 Subject: [PATCH] Fix for #14 Removed reference to cost__gt=0 so discounts work. --- RIGS/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIGS/models.py b/RIGS/models.py index 3474c0b8..56886ca0 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -259,7 +259,7 @@ class Event(models.Model, RevisionMixin): #total = 0.0 #for item in self.items.filter(cost__gt=0).extra(select="SUM(cost * quantity) AS sum"): # total += item.sum - total = EventItem.objects.filter(event=self, cost__gt=0).aggregate(sum_total=models.Sum('cost',field="quantity * cost"))['sum_total'] + total = EventItem.objects.filter(event=self).aggregate(sum_total=models.Sum('cost',field="quantity * cost"))['sum_total'] if total: return total return Decimal("0.00")