mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Include fee-cancelled positions in placed orders by product graph (#5791)
The 'placed orders by product' graph already includes orders that are pending, expired, or fully cancelled without a fee. However, items cancelled with a fee were omitted. This change ensures all placed orders are included in the graph, including those cancelled with a fee.
This commit is contained in:
@@ -59,6 +59,14 @@
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div id="obp_chart" class="chart"></div>
|
||||
<p class="help-block">
|
||||
<small>
|
||||
{% blocktrans trimmed %}
|
||||
Placed orders include all orders (pending, paid, cancelled, and expired);
|
||||
paid orders include only paid orders and exclude all cancelled orders.
|
||||
{% endblocktrans %}
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% if seats %}
|
||||
|
||||
@@ -128,7 +128,7 @@ class IndexView(EventPermissionRequiredMixin, ChartContainingView, TemplateView)
|
||||
# Orders by product
|
||||
ctx['obp_data'] = cache.get('statistics_obp_data' + ckey)
|
||||
if not ctx['obp_data']:
|
||||
opqs = OrderPosition.objects
|
||||
opqs = OrderPosition.all
|
||||
if subevent:
|
||||
opqs = opqs.filter(subevent=subevent)
|
||||
num_ordered = {
|
||||
@@ -141,7 +141,7 @@ class IndexView(EventPermissionRequiredMixin, ChartContainingView, TemplateView)
|
||||
num_paid = {
|
||||
p['item']: p['cnt']
|
||||
for p in (opqs
|
||||
.filter(order__event=self.request.event, order__status=Order.STATUS_PAID)
|
||||
.filter(order__event=self.request.event, order__status=Order.STATUS_PAID, canceled=False)
|
||||
.values('item')
|
||||
.annotate(cnt=Count('id')).order_by())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user