Removed reference to cost__gt=0 so discounts work.
This commit is contained in:
root
2015-03-04 02:24:04 +00:00
parent ed660b9106
commit 50d34af428

View File

@@ -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")