rename to paid_order_count

This commit is contained in:
Thomas Steen Rasmussen 2021-07-22 08:06:43 +02:00
parent f61d0b85e8
commit 02b796e90b
2 changed files with 2 additions and 2 deletions

View file

@ -31,7 +31,7 @@
<td class="text-right">{{ p.price|floatformat:"2" }}&nbsp;DKK</td> <td class="text-right">{{ p.price|floatformat:"2" }}&nbsp;DKK</td>
<td class="text-right">{{ p.cost|floatformat:"2" }}&nbsp;DKK</td> <td class="text-right">{{ p.cost|floatformat:"2" }}&nbsp;DKK</td>
<td class="text-right">{{ p.profit|floatformat:"2" }}&nbsp;DKK</td> <td class="text-right">{{ p.profit|floatformat:"2" }}&nbsp;DKK</td>
<td class="text-center">{{ p.order_count }}</td> <td class="text-center">{{ p.paid_order_count }}</td>
<td class="text-center">{{ p.total_units_sold }}</td> <td class="text-center">{{ p.total_units_sold }}</td>
<td class="text-right">{{ p.total_revenue|floatformat:"2" }}&nbsp;DKK</td> <td class="text-right">{{ p.total_revenue|floatformat:"2" }}&nbsp;DKK</td>
<td class="text-right">{{ p.total_cost|floatformat:"2" }}&nbsp;DKK</td> <td class="text-right">{{ p.total_cost|floatformat:"2" }}&nbsp;DKK</td>

View file

@ -403,7 +403,7 @@ class ProductStatsManager(models.Manager):
.annotate(total_revenue=F("price") * F("total_units_sold")) .annotate(total_revenue=F("price") * F("total_units_sold"))
.annotate(total_cost=F("cost") * F("total_units_sold")) .annotate(total_cost=F("cost") * F("total_units_sold"))
.annotate(total_profit=F("profit") * F("total_units_sold")) .annotate(total_profit=F("profit") * F("total_units_sold"))
.annotate(order_count=Count("orderproductrelation__order")) .annotate(paid_order_count=Count("orderproductrelation__order"))
) )