Report canceled orders as underpaid if necessary

This commit is contained in:
Raphael Michel
2021-08-18 17:35:28 +02:00
parent 1f46a8b91b
commit ead755aa86
2 changed files with 4 additions and 2 deletions

View File

@@ -419,6 +419,8 @@ class Order(LockModel, LoggedModel):
is_underpaid=Case(
When(Q(status=Order.STATUS_PAID) & Q(pending_sum_t__gt=1e-8),
then=Value(1)),
When(Q(status=Order.STATUS_CANCELED) & Q(pending_sum_rc__gt=1e-8),
then=Value(1)),
default=Value(0),
output_field=models.IntegerField()
)