From: Tollef Fog Heen Date: Wed, 1 Aug 2012 18:45:45 +0000 (+0200) Subject: Show both paid and unpaid invoices X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5e15d4aab57da3f4ff8bde078ef356d7347cb32;p=peojumk Show both paid and unpaid invoices --- diff --git a/invoice/views.py b/invoice/views.py index 84e628e..3dd098f 100644 --- a/invoice/views.py +++ b/invoice/views.py @@ -17,8 +17,8 @@ from invoice.forms import ClientForm, InvoiceForm, InvoiceUpdateForm @login_required def index(request): clients = Client.objects.all() - new_invoices = Invoice.objects.filter(status = 'N') - sent_invoices = Invoice.objects.filter(status = 'S') + unpaid_invoices = Invoice.objects.filter(status__in = ['N', 'S']) + paid_invoices = Invoice.objects.filter(status = 'P') return render_to_response('invoice/index.html', locals()) # ------------------- CLIENT --------------- diff --git a/templates/invoice/index.html b/templates/invoice/index.html index 432ec2f..c0399ba 100644 --- a/templates/invoice/index.html +++ b/templates/invoice/index.html @@ -2,7 +2,7 @@ {% block content %} @@ -13,7 +13,7 @@ -{% for i in new_invoices %} +{% for i in unpaid_invoices %}
Customer Total sum
@@ -30,4 +30,29 @@ {% endfor %}
+ + + + + +{% for i in paid_invoices %} + + + + + + +{% endfor %} +
Invoice # + Date + Customer + Total sum +
+ + {{ i.id }} + + {{ i.date }}{{ i.customer }}{{ i.currency }} {{ i.total_sum }}
+ {% endblock %}