diff --git a/subscription/forms.py b/subscription/forms.py index 7f8cd7d7..29a70b8d 100644 --- a/subscription/forms.py +++ b/subscription/forms.py @@ -8,22 +8,11 @@ from django.utils.translation import gettext_lazy as _ from core.models import User from core.utils import get_last_promo -from core.views.forms import SelectDate, SelectDateTime +from core.views.forms import SelectDate from core.views.widgets.ajax_select import AutoCompleteSelectUser from subscription.models import Subscription -class SelectionDateForm(forms.Form): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.fields["start_date"] = forms.DateTimeField( - label=_("Start date"), widget=SelectDateTime, required=True - ) - self.fields["end_date"] = forms.DateTimeField( - label=_("End date"), widget=SelectDateTime, required=True - ) - - class SubscriptionForm(forms.ModelForm): allowed_payment_methods = ["CARD", "CASH", "AE_ACCOUNT"] diff --git a/subscription/templates/subscription/stats.jinja b/subscription/templates/subscription/stats.jinja index eb124032..c695d996 100644 --- a/subscription/templates/subscription/stats.jinja +++ b/subscription/templates/subscription/stats.jinja @@ -11,51 +11,38 @@ {% block content %} -
-
- - -
- {% trans %}Total subscriptions{% endtrans %} : {{ subscriptions_total.count() }}
- {% trans %}Subscriptions by type{% endtrans %}
- {% for location in locations %}
- {{ location[1] }} : {{ subscriptions_total.filter(location=location[0]).count() }}
+ {% trans %}Total subscriptions{% endtrans %} : {{ subscriptions_total.count() }}
+ {% trans %}Subscriptions by type{% endtrans %}
+ {% for location in locations %}
+ {{ location[1] }} : {{ subscriptions_total.filter(location=location[0]).count() }}
+ {% endfor %}
+
+
+
| {% trans %}Subscription type{% endtrans %} | + {% for location in locations %} +{{ location[1] }} | + {% endfor %} +{% trans %}Total{% endtrans %} | + + {% for type in subscriptions_types %} +
|---|---|---|
| {{ subscriptions_types[type]['name'] }} | + {% set subscriptions_total_type = subscriptions_total.filter(subscription_type=type) %} + {% for location in locations %} +
+ {% set subscriptions_total_type_location = subscriptions_total_type.filter(location=location[0]) %}
+ {% trans %}Total{% endtrans %} : {{ subscriptions_total_type_location.count()}} + {% for p_type in payment_types %} + {{ p_type[1] }} : {{ subscriptions_total_type_location.filter(payment_method=p_type[0]).count()}} + {% endfor %} + |
+ {% endfor %}
+ {{subscriptions_total_type.count()}} | +
| {% trans %}Subscription type{% endtrans %} | - {% for location in locations %} -{{ location[1] }} | - {% endfor %} -{% trans %}Total{% endtrans %} | - {% for type in subscriptions_types %} -
|---|---|---|
| {{ subscriptions_types[type]['name'] }} | - {% set subscriptions_total_type = subscriptions_total.filter(subscription_type=type) %} - {% for location in locations %} -
- {% set subscriptions_total_type_location = subscriptions_total_type.filter(location=location[0]) %}
- {% trans %}Total{% endtrans %} : {{ subscriptions_total_type_location.count()}} - {% for p_type in payment_types %} - {{ p_type[1] }} : {{ subscriptions_total_type_location.filter(payment_method=p_type[0]).count()}} - {% endfor %} - |
- {% endfor %}
- {{subscriptions_total_type.count()}} - |