diff --git a/RIGS/finance.py b/RIGS/finance.py index 57721a9f..9025e15b 100644 --- a/RIGS/finance.py +++ b/RIGS/finance.py @@ -103,6 +103,14 @@ class InvoiceWaiting(generic.ListView): paginate_by = 25 template_name = 'RIGS/event_invoice.html' + def get_context_data(self, **kwargs): + context = super(InvoiceWaiting, self).get_context_data(**kwargs) + total = 0 + for obj in context['object_list']: + total += obj.sum_total + context['total'] = total + return context + def get_queryset(self): # @todo find a way to select items events = self.model.objects.filter(is_rig=True, end_date__lt=datetime.date.today(), diff --git a/RIGS/templates/RIGS/event_invoice.html b/RIGS/templates/RIGS/event_invoice.html index 805eb3d9..29c56f42 100644 --- a/RIGS/templates/RIGS/event_invoice.html +++ b/RIGS/templates/RIGS/event_invoice.html @@ -5,7 +5,7 @@ {% block content %}