mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-26 09:52:16 +00:00
Fix counter on outstanding invoices page ('length' property doesn't work because of the custom SQL query)
This commit is contained in:
@@ -25,6 +25,7 @@ class InvoiceIndex(generic.ListView):
|
|||||||
for i in context['object_list']:
|
for i in context['object_list']:
|
||||||
total += i.balance
|
total += i.balance
|
||||||
context['total'] = total
|
context['total'] = total
|
||||||
|
context['count'] = len(list(context['object_list']))
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Outstanding Invoices
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block heading %}
|
{% block heading %}
|
||||||
Outstanding Invoices ({{object_list|length}} Events, £ {{ total|floatformat:2 }})
|
Outstanding Invoices ({{ count }} Events, £ {{ total|floatformat:2 }})
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block description %}
|
{% block description %}
|
||||||
|
|||||||
Reference in New Issue
Block a user