[ldap_crans] En rend un peu plus lisible le calcul de fin adh/conn
This commit is contained in:
parent
69efee5ce2
commit
ddc6fb8a98
2 changed files with 13 additions and 2 deletions
|
@ -8,6 +8,7 @@ import datetime
|
||||||
# Fichier généré à partir de bcfg2
|
# Fichier généré à partir de bcfg2
|
||||||
from config_srv import adm_only, role
|
from config_srv import adm_only, role
|
||||||
|
|
||||||
|
gtfepoch = "19700101000000Z"
|
||||||
##### Gestion des câblages
|
##### Gestion des câblages
|
||||||
# Selon la date, on met :
|
# Selon la date, on met :
|
||||||
# -ann_scol : Année scolaire en cours
|
# -ann_scol : Année scolaire en cours
|
||||||
|
|
|
@ -1492,7 +1492,12 @@ class BaseProprietaire(BaseClasseCrans):
|
||||||
|
|
||||||
# On récupère sur les factures l'ensemble de celles comportant une adhésion.
|
# On récupère sur les factures l'ensemble de celles comportant une adhésion.
|
||||||
adh_factures = self.factures_adh()
|
adh_factures = self.factures_adh()
|
||||||
finAdh = max([0.0] + [fromGeneralizedTimeFormat(facture._data.get('finAdhesion', ["19700101000000Z"])[0]) for facture in adh_factures if facture.controle() != "FALSE" and facture.recuPaiement() is not None])
|
fgtf = lambda fac:fromGeneralizedTimeFormat(fac._data.get('finAdhesion', [config.gtfepoch])[0])
|
||||||
|
finAdh = max([0.0] + [fgtf(facture) for facture
|
||||||
|
in adh_factures
|
||||||
|
if facture.controle() != "FALSE"
|
||||||
|
and facture.recuPaiement() is not None
|
||||||
|
])
|
||||||
|
|
||||||
if update == False:
|
if update == False:
|
||||||
return finAdh
|
return finAdh
|
||||||
|
@ -2382,7 +2387,12 @@ class Adherent(BaseProprietaire):
|
||||||
|
|
||||||
# On récupère sur les factures l'ensemble de celles comportant une connexion.
|
# On récupère sur les factures l'ensemble de celles comportant une connexion.
|
||||||
conn_factures = self.factures_conn()
|
conn_factures = self.factures_conn()
|
||||||
finConn = max([0.0] + [fromGeneralizedTimeFormat(facture._data.get('finConnexion', ["19700101000000Z"])[0]) for facture in conn_factures if facture.controle() != "FALSE" and facture.recuPaiement() is not None])
|
fgtf = lambda fac:fromGeneralizedTimeFormat(fac._data.get('finConnexion', [config.gtfepoch])[0])
|
||||||
|
finConn = max([0.0] + [fgtf(facture) for facture
|
||||||
|
in conn_factures
|
||||||
|
if facture.controle() != "FALSE"
|
||||||
|
and facture.recuPaiement() is not None
|
||||||
|
])
|
||||||
|
|
||||||
if mois is None:
|
if mois is None:
|
||||||
return finConn
|
return finConn
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue