put the latest invoice number at the top of the file

This commit is contained in:
Thomas Steen Rasmussen 2021-08-11 09:47:21 +02:00
parent b0656ff911
commit 8b7807b88b

View file

@ -467,7 +467,7 @@ class InvoiceListCSVView(CampViewMixin, EconomyTeamPermissionMixin, ListView):
] = f'attachment; filename="bornhack-infoices-{timezone.now()}.csv"' ] = f'attachment; filename="bornhack-infoices-{timezone.now()}.csv"'
writer = csv.writer(response) writer = csv.writer(response)
writer.writerow(["invoice", "invoice_date", "amount_dkk", "order", "paid"]) writer.writerow(["invoice", "invoice_date", "amount_dkk", "order", "paid"])
for invoice in Invoice.objects.all(): for invoice in Invoice.objects.all().order_by("-id"):
writer.writerow( writer.writerow(
[ [
invoice.id, invoice.id,