|
@@ -1,5 +1,6 @@
|
|
|
from django.core.management.base import BaseCommand, CommandError
|
|
|
from django.db.models import DecimalField, F, Sum, Func, Q
|
|
|
+from django.utils import timezone
|
|
|
|
|
|
from decimal import Decimal
|
|
|
|
|
@@ -14,7 +15,8 @@ class Command(BaseCommand):
|
|
|
total_income = Decimal(0.0)
|
|
|
lines = []
|
|
|
for service_type in ServiceType.objects.all():
|
|
|
- services = service_type.services
|
|
|
+ now = timezone.now()
|
|
|
+ services = service_type.services.exclude(start__gt=now).exclude(end__lte=now)
|
|
|
ntotal = services.count()
|
|
|
services = services.exclude(adherent=None)
|
|
|
nadh = services.count()
|