From 288d90332b1a04fcb16994b5de944ce509bbd1e0 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Tue, 10 Aug 2021 21:10:31 +0200 Subject: [PATCH] fix a few things in the invoice list --- .../templates/includes/invoice_list_panel.html | 14 +++++++------- src/shop/models.py | 7 +++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/backoffice/templates/includes/invoice_list_panel.html b/src/backoffice/templates/includes/invoice_list_panel.html index 934fe65a..5d5ca65a 100644 --- a/src/backoffice/templates/includes/invoice_list_panel.html +++ b/src/backoffice/templates/includes/invoice_list_panel.html @@ -1,14 +1,14 @@ {% load bornhack %} {% if invoice_list %} - +
- + @@ -16,11 +16,11 @@ {% for invoice in invoice_list %} - - - - - + + + + + diff --git a/src/shop/models.py b/src/shop/models.py index 5ca2d1b0..1fdb2863 100644 --- a/src/shop/models.py +++ b/src/shop/models.py @@ -683,6 +683,13 @@ class Invoice(CreatedUpdatedModel): def regretdate(self): return self.created + timedelta(days=15) + @property + def get_order(self): + if self.order: + return self.order + else: + return self.customorder + class CoinifyAPIInvoice(CreatedUpdatedModel): coinify_id = models.IntegerField(null=True)
Invoice # Username Email Invoice DatePaid OrderPaid Actions
{{ invoice.id }}{{ invoice.user.username }}{{ invoice.user.email }} DKK{{ invoice.invoice_date }}{{ invoice.paid|truefalseicon }}{{ invoice.order }}{{ invoice.get_order.user.username }}{{ invoice.get_order.user.email }}{{ invoice.created|date }}{{ invoice.get_order }}{{ invoice.get_order.paid|truefalseicon }} n/a