remove wrong info for now
This commit is contained in:
parent
21b479e253
commit
b76cc2ed64
|
@ -14,9 +14,7 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Ticket Type</th>
|
||||
<th class="text-center">Number Sold</th>
|
||||
<th class="text-right">Total Income</th>
|
||||
<th class="text-right">Average Price</th>
|
||||
<th class="text-center">Tickets Generated</th>
|
||||
<th class="text-center">Products</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -25,8 +23,6 @@
|
|||
<tr>
|
||||
<td><a href="{% url 'backoffice:shop_ticket_stats_detail' camp_slug=camp.slug pk=tt.pk %}">{{ tt.name }}</a></td>
|
||||
<td class="text-center">{{ tt.shopticket_count }}</td>
|
||||
<td class="text-right">{{ tt.total_price|floatformat:"2" }} DKK</td>
|
||||
<td class="text-right">{{ tt.average_price|floatformat:"2" }} DKK</td>
|
||||
<td class="text-center">{{ tt.product_set.count }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -18,12 +18,8 @@ logger = logging.getLogger("bornhack.%s" % __name__)
|
|||
|
||||
class TicketTypeManager(models.Manager):
|
||||
def with_price_stats(self):
|
||||
return (
|
||||
self.annotate(shopticket_count=models.Count("shopticket"))
|
||||
.annotate(average_price=models.Avg("shopticket__product__price"))
|
||||
.annotate(total_price=models.Sum("shopticket__product__price"))
|
||||
.exclude(shopticket_count=0)
|
||||
.order_by("total_price")
|
||||
return self.annotate(shopticket_count=models.Count("shopticket")).exclude(
|
||||
shopticket_count=0
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue