]> err.no Git - peojumk/commitdiff
Show invoices needing work on front page
authorTollef Fog Heen <tfheen@err.no>
Sun, 3 Jun 2012 13:24:07 +0000 (15:24 +0200)
committerTollef Fog Heen <tfheen@err.no>
Sun, 3 Jun 2012 13:24:07 +0000 (15:24 +0200)
invoice/views.py
templates/invoice/index.html

index 28f5b44d1965ff496f499b8eb2655c849f61f2a9..1fdee68876e5fcb70a38b53dbfa6e7c85c51dc67 100644 (file)
@@ -16,7 +16,9 @@ from invoice.forms import ClientForm, InvoiceForm
 @login_required
 def index(request):
     clients = Client.objects.all()
-    return render_to_response('invoice/index.html', {'clients': clients})
+    new_invoices = Invoice.objects.filter(status = 'N')
+    sent_invoices = Invoice.objects.filter(status = 'S')
+    return render_to_response('invoice/index.html', locals())
 
 # ------------------- CLIENT ---------------
 
index 57a206152067602bc879109d35a146b3222150e6..4b268b8b757a77e4e94730726b50f0f629f2bb06 100644 (file)
@@ -1 +1,23 @@
 {% extends "base_site.html" %}
+{% block content %}
+
+<div class="page-header">
+  <h2>New invoices</h2>
+</div>
+
+<table>
+<tr>
+  <th>Date</td>
+  <th>Customer</td>
+  <th>Total sum</td>
+</tr>
+{% for i in new_invoices %}
+<tr>
+  <td>{{ i.date }}</td>
+  <td>{{ i.customer }}</td>
+  <td>{{ i.currency }} {{ i.total_sum }}</td>
+</tr>
+{% endfor %}
+</table>
+
+{% endblock %}