diff --git a/gestion/config/config.py b/gestion/config/config.py index daad1c22..28466f73 100644 --- a/gestion/config/config.py +++ b/gestion/config/config.py @@ -8,6 +8,7 @@ import datetime # Fichier généré à partir de bcfg2 from config_srv import adm_only, role +gtfepoch = "19700101000000Z" ##### Gestion des câblages # Selon la date, on met : # -ann_scol : Année scolaire en cours diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index f18b5f99..1bf39a1a 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -1492,7 +1492,12 @@ class BaseProprietaire(BaseClasseCrans): # On récupère sur les factures l'ensemble de celles comportant une adhésion. 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: return finAdh @@ -2382,7 +2387,12 @@ class Adherent(BaseProprietaire): # On récupère sur les factures l'ensemble de celles comportant une connexion. 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: return finConn