Changed order overview columns to increase usefulness

This commit is contained in:
Raphael Michel
2016-09-04 22:56:00 +02:00
parent 2569ebec55
commit d8f81955ba
3 changed files with 4 additions and 3 deletions

View File

@@ -36,7 +36,8 @@ def order_overview(event: Event) -> Tuple[List[Tuple[ItemCategory, List[Item]]],
num_total = {
(p['item'], p['variation']): (p['cnt'], p['price'])
for p in (OrderPosition.objects
.filter(order__event=event)
.filter(order__event=event,
order__status__in=[Order.STATUS_PENDING, Order.STATUS_EXPIRED, Order.STATUS_PAID])
.values('item', 'variation')
.annotate(cnt=Count('id'), price=Sum('price')).order_by())
}

View File

@@ -17,7 +17,7 @@
<thead>
<tr>
<th>{% trans "Product" %}</th>
<th>{% trans "Total orders" %}</th>
<th>{% trans "Total (pending or paid)" %}</th>
<th>{% trans "Payment pending" %}</th>
<th>{% trans "Cancelled" %}</th>
<th>{% trans "Refunded" %}</th>

View File

@@ -149,7 +149,7 @@ class OverviewReport(Report):
]
tdata = [
[
_('Product'), _('Total orders'), '', _('Pending'), '', _('Cancelled'), '', _('Refunded'), '',
_('Product'), _('Total (pending or paid)'), '', _('Pending'), '', _('Cancelled'), '', _('Refunded'), '',
_('Paid'), ''
],
[