mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-23 15:33:45 +00:00
Fix all_adherent and all_has_access function
This commit is contained in:
parent
a01c9e2303
commit
0a427cd30d
1 changed files with 10 additions and 16 deletions
|
@ -93,13 +93,10 @@ def all_adherent(search_time=None, including_asso=True):
|
||||||
search_time = timezone.now()
|
search_time = timezone.now()
|
||||||
filter_user = Q(
|
filter_user = Q(
|
||||||
facture__in=Facture.objects.filter(
|
facture__in=Facture.objects.filter(
|
||||||
vente__in=Vente.objects.filter(
|
vente__cotisation__in=Cotisation.objects.filter(
|
||||||
Q(type_cotisation="All") | Q(type_cotisation="Adhesion"),
|
Q(vente__facture__facture__valid=True) &
|
||||||
cotisation__in=Cotisation.objects.filter(
|
Q(date_start_memb__lt=search_time) &
|
||||||
vente__in=Vente.objects.filter(
|
Q(date_end_memb__gt=search_time)
|
||||||
facture__in=Facture.objects.all().exclude(valid=False)
|
|
||||||
)
|
|
||||||
).filter(Q(date_start__lt=search_time) & Q(date_end__gt=search_time)),
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -186,15 +183,12 @@ def all_has_access(search_time=None, including_asso=True):
|
||||||
)
|
)
|
||||||
| Q(
|
| Q(
|
||||||
facture__in=Facture.objects.filter(
|
facture__in=Facture.objects.filter(
|
||||||
vente__in=Vente.objects.filter(
|
vente__cotisation__in=Cotisation.objects.filter(
|
||||||
cotisation__in=Cotisation.objects.filter(
|
Q(vente__facture__facture__valid=True) &
|
||||||
Q(type_cotisation="All") | Q(type_cotisation="Connexion"),
|
Q(date_start_con__lt=search_time) &
|
||||||
vente__in=Vente.objects.filter(
|
Q(date_end_con__gt=search_time) &
|
||||||
facture__in=Facture.objects.all().exclude(valid=False)
|
Q(date_start_memb__lt=search_time) &
|
||||||
),
|
Q(date_end_memb__gt=search_time)
|
||||||
).filter(
|
|
||||||
Q(date_start__lt=search_time) & Q(date_end__gt=search_time)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue