Own column for unapproved orders in order overview

This commit is contained in:
Raphael Michel
2020-11-01 15:00:54 +01:00
parent da149682aa
commit 7a98f3fa89
4 changed files with 64 additions and 13 deletions

View File

@@ -127,6 +127,7 @@ def order_overview(
order__event=event
).annotate(
status=Case(
When(order__status='n', order__require_approval=True, then=Value('unapproved')),
When(canceled=True, then=Value('c')),
default=F('order__status')
)
@@ -135,6 +136,7 @@ def order_overview(
).annotate(cnt=Count('id'), price=Sum('price'), tax_value=Sum('tax_value')).order_by()
states = {
'unapproved': 'unapproved',
'canceled': Order.STATUS_CANCELED,
'paid': Order.STATUS_PAID,
'pending': Order.STATUS_PENDING,
@@ -198,6 +200,7 @@ def order_overview(
order__event=event
).annotate(
status=Case(
When(order__status='n', order__require_approval=True, then=Value('unapproved')),
When(canceled=True, then=Value('c')),
default=F('order__status')
)