Whos aussi doit oublier les histoires de paiement et compagnie.

This commit is contained in:
Pierre-Elliott Bécue 2015-07-15 21:16:35 +02:00
parent 14a1905de3
commit 67bf2363cf

View file

@ -180,17 +180,11 @@ def adhers_brief(adhers) :
ook = u'\x1b[1;32mO\x1b[1;0m' ook = u'\x1b[1;32mO\x1b[1;0m'
nok = u'\x1b[1;31mn\x1b[1;0m' nok = u'\x1b[1;31mn\x1b[1;0m'
# Paiement # Paiement
if a.adhesion() > time() or a.paiement(): if a.adhesion() > time():
if 'p' in a.controle(): paid = ook if 'p' in a.controle(): paid = ook
else: paid = ok else: paid = ok
else: paid = nok else: paid = nok
# Carte d'étudiant
if a.carteEtudiant():
if 'c' in a.controle(): carte = ook
else: carte = ok
else : carte = nok
machines = '' machines = ''
# Récupération des machines # Récupération des machines
if len(adhers) <= limit_aff_machines: if len(adhers) <= limit_aff_machines:
@ -205,26 +199,26 @@ def adhers_brief(adhers) :
machines = None machines = None
# Données # Données
if len(adhers) <= limit_aff_machines: if len(adhers) <= limit_aff_machines:
data.append([a.id(), a.Nom(), a.chbre(), paid, carte, machines]) data.append([a.id(), a.Nom(), a.chbre(), paid, machines])
else: else:
data.append([a.id(), a.Nom(), a.chbre(), paid, carte]) data.append([a.id(), a.Nom(), a.chbre(), paid])
if len(adhers) <= limit_aff_machines: if len(adhers) <= limit_aff_machines:
return u"Machines en rouge = machines avec limitation de services\n" + \ return u"Machines en rouge = machines avec limitation de services\n" + \
u"P : paiement année en cours, le fond vert indique le précâblage (G bleu = inscription gratuite)\n" + \ u"P : paiement année en cours, le fond vert indique le précâblage (G bleu = inscription gratuite)\n" + \
u"C : carte d'étudiant année en cours\n" + \ u"C : carte d'étudiant année en cours\n" + \
tableau(data, tableau(data,
titre = [u'aid', u'Prénom Nom', u'Chbre', u'P', u'C', u'Machines'], titre = [u'aid', u'Prénom Nom', u'Chbre', u'P', u'Machines'],
largeur = [5, 30, 5, 1, 1, '*'], largeur = [5, 30, 5, 1, '*'],
alignement = ['d', 'c', 'g', 'c', 'c', 'c']) alignement = ['d', 'c', 'g', 'c', 'c'])
else: else:
return u"Machines en rouge = machines avec limitation de services\n" + \ return u"Machines en rouge = machines avec limitation de services\n" + \
u"P : paiement année en cours, le fond vert indique le précâblage (G bleu = inscription gratuite)\n" + \ u"P : paiement année en cours, le fond vert indique le précâblage (G bleu = inscription gratuite)\n" + \
u"C : carte d'étudiant année en cours\n" + \ u"C : carte d'étudiant année en cours\n" + \
tableau(data, tableau(data,
titre = [u'aid', u'Prénom Nom', u'Chbre', u'P', u'C'], titre = [u'aid', u'Prénom Nom', u'Chbre', u'P'],
largeur = [5, '*', 5, 1, 1], largeur = [5, '*', 5, 1],
alignement = ['d', 'c', 'g', 'c', 'c']) alignement = ['d', 'c', 'g', 'c'])
def machines_brief(machines) : def machines_brief(machines) :
""" """
@ -581,10 +575,7 @@ def adher_details(adher) :
f += strftime('%d/%m/%Y %H:%M:%S', localtime(adher.dateInscription())) f += strftime('%d/%m/%Y %H:%M:%S', localtime(adher.dateInscription()))
f += coul(u'\nÉtat administratif : ','gras') f += coul(u'\nÉtat administratif : ','gras')
jour = True jour = True
if not adher.carteEtudiant() : if adher.adhesion() <= time():
f += coul(u"manque carte d'étudiant",'violet')
jour = False
if config.ann_scol not in adher.paiement() and (adher.adhesion() <= time()):
if not jour: f += ' et ' if not jour: f += ' et '
f += coul(u"non adhérent actuellement",'violet') f += coul(u"non adhérent actuellement",'violet')
jour = False jour = False
@ -654,10 +645,7 @@ def adher_details(adher) :
if adher.adhesion() > time(): if adher.adhesion() > time():
f += coul(u"Adhésion jusqu'au %s" % strftime("%d/%m/%Y %H:%M:%S", localtime(adher.adhesion())), "vert") f += coul(u"Adhésion jusqu'au %s" % strftime("%d/%m/%Y %H:%M:%S", localtime(adher.adhesion())), "vert")
f += u"\n" f += u"\n"
elif config.ann_scol in adher.paiement(): elif config.periode_transitoire and (config.debut_periode_transitoire <= min(adher.adhesion(), adher.connexion()) <= config.fin_periode_transitoire):
f += coul(u"Paiement pour %s/%s ok (connexion incluse)" % (config.ann_scol, config.ann_scol+1), "vert")
f += u"\n"
elif config.periode_transitoire and ((config.ann_scol - 1) in adher.paiement() or config.debut_periode_transitoire <= min(adher.adhesion(), adher.connexion()) <= config.fin_periode_transitoire):
f += coul(u"Fin d'adhésion, mais en sursis jusqu'au %s" % (strftime("%d/%m/%Y %H:%M:%S", localtime(config.fin_periode_transitoire)),), "rouge") f += coul(u"Fin d'adhésion, mais en sursis jusqu'au %s" % (strftime("%d/%m/%Y %H:%M:%S", localtime(config.fin_periode_transitoire)),), "rouge")
f += u"\n" f += u"\n"
@ -668,12 +656,6 @@ def adher_details(adher) :
f += coul(u"(Théoriquement %s, sous réserve de réadhésion)" % (strftime("%d/%m/%Y %H:%M:%S", localtime(adher.connexion())),), "rouge") f += coul(u"(Théoriquement %s, sous réserve de réadhésion)" % (strftime("%d/%m/%Y %H:%M:%S", localtime(adher.connexion())),), "rouge")
f += u'\n' f += u'\n'
# Carte d'étudiant fournie
if adher.carteEtudiant():
f += coul(u"Carte d'étudiant fournie.",'gras')
if 'c' in adher.controle(): f += coul(u' (Contrôle OK)', 'vert')
f += u'\n'
f += _blacklist(adher) f += _blacklist(adher)
f += _info(adher) f += _info(adher)
f += _hist(adher) f += _hist(adher)
@ -928,7 +910,7 @@ def club_details(club) :
# État administratif # État administratif
f += coul(u'État administratif : ','gras') f += coul(u'État administratif : ','gras')
jour = True jour = True
if club.adhesion() < time() and config.ann_scol not in club.paiement(): if club.adhesion() < time():
jour = False jour = False
f += coul(u"Non adhérent." ,'violet') f += coul(u"Non adhérent." ,'violet')
@ -950,9 +932,6 @@ def club_details(club) :
if club.adhesion() > time(): if club.adhesion() > time():
f += coul(u"Adhésion jusque %s (connexion incluse)." % (strftime("%d/%m/%Y %H:%M:%S", localtime(club.adhesion())),), "vert") f += coul(u"Adhésion jusque %s (connexion incluse)." % (strftime("%d/%m/%Y %H:%M:%S", localtime(club.adhesion())),), "vert")
f += '\n' f += '\n'
elif config.ann_scol in club.paiement():
f += coul(u"Adhésion pour l'année en cours", "vert")
f += '\n'
login = club.compte() login = club.compte()
if login : if login :
@ -1152,7 +1131,7 @@ def prise_etat(chbre) :
# On met aussi l'état # On met aussi l'état
prise = sw_chbre(chbre) prise = sw_chbre(chbre)
vlans += ', '.join(prise.vlans()) vlans += ', '.join(prise.vlans())
f += u'prise %s' % prise.prise_brute f += u'prise %s' % prise.prise_brute
rows, cols = get_screen_size() rows, cols = get_screen_size()
if prise.is_up() : if prise.is_up() :