make Refilling.payment_method a SmallIntegerField

This commit is contained in:
imperosol
2025-11-19 20:49:06 +01:00
parent ad87617018
commit c588e5117d
9 changed files with 69 additions and 25 deletions

View File

@@ -67,7 +67,9 @@ class InvoiceCallView(
end_date = start_date + relativedelta(months=1)
kwargs["sum_cb"] = Refilling.objects.filter(
payment_method="CARD", date__gte=start_date, date__lte=end_date
payment_method=Refilling.PaymentMethod.CARD,
date__gte=start_date,
date__lte=end_date,
).aggregate(res=Sum("amount", default=0))["res"]
kwargs["sum_cb"] += (
Selling.objects.filter(