@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 ---------------
{% 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 %}