diff --git a/counter/templates/counter/cash_summary_list.jinja b/counter/templates/counter/cash_summary_list.jinja
index 7ea832b6..a9432d06 100644
--- a/counter/templates/counter/cash_summary_list.jinja
+++ b/counter/templates/counter/cash_summary_list.jinja
@@ -38,7 +38,7 @@
- {% for c in cashsummary_list.order_by('-date') %}
+ {% for c in cashsummary_list %}
{{ user_profile_link(c.user) }} |
{{ c.counter }} |
@@ -55,6 +55,26 @@
{% endfor %}
+
+{% if is_paginated %}
+ {% if page_obj.has_previous() %}
+ {% trans %}Previous{% endtrans %}
+ {% else %}
+ {% trans %}Previous{% endtrans %}
+ {% endif %}
+ {% for i in paginator.page_range %}
+ {% if page_obj.number == i %}
+ {{ i }} ({% trans %}current{% endtrans %})
+ {% else %}
+ {{ i }}
+ {% endif %}
+ {% endfor %}
+ {% if page_obj.has_next() %}
+ {% trans %}Next{% endtrans %}
+ {% else %}
+ {% trans %}Next{% endtrans %}
+ {% endif %}
+{% endif %}
{% else %}
{% trans %}There is no cash register summary in this website.{% endtrans %}
{% endif %}
diff --git a/counter/views.py b/counter/views.py
index ed97a84e..a703ae03 100644
--- a/counter/views.py
+++ b/counter/views.py
@@ -938,6 +938,8 @@ class CashSummaryListView(CanEditPropMixin, CounterAdminTabsMixin, ListView):
template_name = 'counter/cash_summary_list.jinja'
context_object_name = "cashsummary_list"
current_tab = "cash_summary"
+ queryset = CashRegisterSummary.objects.all().order_by('-date')
+ paginate_by = settings.SITH_COUNTER_CASH_SUMMARY_LENGTH
def get_context_data(self, **kwargs):
""" Add sums to the context """
diff --git a/sith/settings.py b/sith/settings.py
index 042e3114..2c9298f1 100644
--- a/sith/settings.py
+++ b/sith/settings.py
@@ -357,6 +357,9 @@ SITH_COUNTER_BANK = [
('LA-POSTE', 'La Poste'),
]
+# Defines pagination for cash summary
+SITH_COUNTER_CASH_SUMMARY_LENGTH = 50
+
# Defines which product type is the refilling type, and thus increases the account amount
SITH_COUNTER_PRODUCTTYPE_REFILLING = 11