mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +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>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div id="obp_chart" class="chart"></div>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
{% if seats %}
|
{% if seats %}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ class IndexView(EventPermissionRequiredMixin, ChartContainingView, TemplateView)
|
|||||||
# Orders by product
|
# Orders by product
|
||||||
ctx['obp_data'] = cache.get('statistics_obp_data' + ckey)
|
ctx['obp_data'] = cache.get('statistics_obp_data' + ckey)
|
||||||
if not ctx['obp_data']:
|
if not ctx['obp_data']:
|
||||||
opqs = OrderPosition.objects
|
opqs = OrderPosition.all
|
||||||
if subevent:
|
if subevent:
|
||||||
opqs = opqs.filter(subevent=subevent)
|
opqs = opqs.filter(subevent=subevent)
|
||||||
num_ordered = {
|
num_ordered = {
|
||||||
@@ -141,7 +141,7 @@ class IndexView(EventPermissionRequiredMixin, ChartContainingView, TemplateView)
|
|||||||
num_paid = {
|
num_paid = {
|
||||||
p['item']: p['cnt']
|
p['item']: p['cnt']
|
||||||
for p in (opqs
|
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')
|
.values('item')
|
||||||
.annotate(cnt=Count('id')).order_by())
|
.annotate(cnt=Count('id')).order_by())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user