@login_required
def index(request):
clients = Client.objects.all()
- unpaid_invoices = Invoice.objects.filter(status__in = ['N', 'S'])
- paid_invoices = Invoice.objects.filter(status = 'P')
+ unpaid_invoices = Invoice.objects.filter(status__in = ['N', 'S']).order_by('id')
+ paid_invoices = Invoice.objects.filter(status = 'P').order_by('id')
return render_to_response('invoice/index.html', locals())
# ------------------- CLIENT ---------------