diff --git a/src/pretix/base/models/event.py b/src/pretix/base/models/event.py index df968fbc79..ced8fd7fac 100644 --- a/src/pretix/base/models/event.py +++ b/src/pretix/base/models/event.py @@ -385,7 +385,7 @@ class Event(EventMixin, LoggedModel): if img: return urljoin(build_absolute_uri(self, 'presale:event.index'), img) - def free_seats(self, ignore_voucher=None, sales_channel='web'): + def free_seats(self, ignore_voucher=None, sales_channel='web', include_blocked=False): from .orders import CartPosition, Order, OrderPosition from .vouchers import Voucher vqs = Voucher.objects.filter( @@ -416,7 +416,7 @@ class Event(EventMixin, LoggedModel): vqs ) ).filter(has_order=False, has_cart=False, has_voucher=False) - if sales_channel not in self.settings.seating_allow_blocked_seats_for_channel: + if not (sales_channel in self.settings.seating_allow_blocked_seats_for_channel or include_blocked): qs = qs.filter(blocked=False) return qs @@ -1032,7 +1032,7 @@ class SubEvent(EventMixin, LoggedModel): def __str__(self): return '{} - {}'.format(self.name, self.get_date_range_display()) - def free_seats(self, ignore_voucher=None, sales_channel='web'): + def free_seats(self, ignore_voucher=None, sales_channel='web', include_blocked=False): from .orders import CartPosition, Order, OrderPosition from .vouchers import Voucher vqs = Voucher.objects.filter( @@ -1066,7 +1066,7 @@ class SubEvent(EventMixin, LoggedModel): vqs ) ).filter(has_order=False, has_cart=False, has_voucher=False) - if sales_channel not in self.settings.seating_allow_blocked_seats_for_channel: + if not (sales_channel in self.settings.seating_allow_blocked_seats_for_channel or include_blocked): qs = qs.filter(blocked=False) return qs diff --git a/src/pretix/plugins/statistics/templates/pretixplugins/statistics/index.html b/src/pretix/plugins/statistics/templates/pretixplugins/statistics/index.html index 71b16389e5..0af5cbe97b 100644 --- a/src/pretix/plugins/statistics/templates/pretixplugins/statistics/index.html +++ b/src/pretix/plugins/statistics/templates/pretixplugins/statistics/index.html @@ -3,6 +3,8 @@ {% load compress %} {% load static %} {% load escapejson %} +{% load money %} +{% load getitem %} {% block title %}{% trans "Statistics" %}{% endblock %} {% block content %}
| {% trans "Product" %} | ++ | {% trans "Unsold Seats" %} | +{% trans "Potential Profits" %} | +||
|---|---|---|---|---|---|
| + | {% trans "Minimum Price" %} | +{% trans "Blocked" %} | +{% trans "Available" %} | +{% trans "Blocked" %} | +{% trans "Available" %} | +
| {% trans "On Sale" %} | ++ | + | + | + | + |
| {{ item }} | +{{ props.price|money:request.event.currency }} | +{{ props.blocked.seats }} | +{{ props.free.seats }} | +{{ props.blocked.potential|money:request.event.currency }} | +{{ props.free.potential|money:request.event.currency }} | +
| {% trans "Not on Sale" %} | ++ | + | + | + | + |
| {% trans "Seats not attributed to any specific product" %} | ++ | {{ unattributed.blocked.seats }} | +{{ unattributed.free.seats }} | ++ | + |