From c5c903b1140f9392f0ad906b3dc74263406dd701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Sat, 26 Sep 2015 00:35:38 +0200 Subject: [PATCH] recuPaiement devient un generalizedTimeFormat --- gestion/gest_crans.py | 8 ++++---- gestion/whos.py | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gestion/gest_crans.py b/gestion/gest_crans.py index 289b8b97..8be36b7e 100755 --- a/gestion/gest_crans.py +++ b/gestion/gest_crans.py @@ -1100,7 +1100,7 @@ def set_solde(clas): try: # Met aussi à jour le solde. - f.recuPaiement(strftime("%Y-%m-%d %H:%M:%S")) + f.recuPaiement(datetimeToGTF(localizedDatetime())) f.save() db.services_to_restart('mail_solde', [ '%s a fait %s euros pour %s [mode: %s, remarque: %s]' % @@ -1256,7 +1256,7 @@ def set_vente(proprio): return 1 else: try: - f.recuPaiement(strftime("%Y-%m-%d %H:%M:%S")) + f.recuPaiement(datetimeToGTF(localizedDatetime())) f.save() # arg = u'--title "Impression facture" ' # arg += u'--yesno "Voulez vous imprimer cette facture ?\n" 0 0' @@ -1314,7 +1314,7 @@ def confirm(clas): else: subprocess.call(['/usr/scripts/cransticket/dump_creds.py', 'mid=%s' % clas.id()]) if in_facture is not None: - in_facture.recuPaiement(strftime("%Y-%m-%d %H:%M:%S")) + in_facture.recuPaiement(datetimeToGTF(localizedDatetime())) in_facture.save() # arg = u'--title "Impression facture" ' # arg += u'--yesno "Voulez vous imprimer cette facture ?\n" 0 0' @@ -1857,7 +1857,7 @@ def set_facture_recu(facture): if annul: return 1 if u"Pmt" in res: - facture.recuPaiement(strftime("%Y-%m-%d %H:%M:%S")) + facture.recuPaiement(datetimeToGTF(localizedDatetime())) else: facture.recuPaiement(False) diff --git a/gestion/whos.py b/gestion/whos.py index 5f09b242..4ed8c6f3 100755 --- a/gestion/whos.py +++ b/gestion/whos.py @@ -53,6 +53,7 @@ from affich_tools import * from ldap_crans import is_actif, crans_ldap, AssociationCrans, hostname from ldap_crans import MachineCrans, MachineWifi, BorneWifi from ldap_crans import Adherent +from ldap_crans import datetimeFromGTF from hptools import sw_chbre, ConversationError import gestion.annuaires_pg as annuaires_pg import gestion.config as config @@ -293,7 +294,7 @@ def factures_brief(factures) : facture.id(), p, facture.modePaiement(), - coul(facture.recuPaiement(), "vert") if facture.recuPaiement() else coul("NON", "rouge"), + coul(datetimeFromGTF(facture.recuPaiement()).strftime("%d/%m/%Y %H:%M:%S%z"), "vert") if facture.recuPaiement() else coul("NON", "rouge"), controle, ', '.join(article['code'] for article in facture.articles()), unicode(facture.total()) + u" €", @@ -420,7 +421,7 @@ def list_factures(factures) : data.append([ f.id(), f.modePaiement(), - coul(f.recuPaiement(), "vert") if f.recuPaiement() else coul("NON", "rouge"), + coul(datetimeFromGTF(facture.recuPaiement()).strftime("%d/%m/%Y %H:%M:%S%z"), "vert") if f.recuPaiement() else coul("NON", "rouge"), controle, ', '.join(a['code'] for a in f.articles()), u"%s€" % sum([float(a['pu'])*int(a['nombre']) for a in f.articles()]) @@ -705,7 +706,7 @@ def facture_details(facture) : f += facture.modePaiement() f += u" " f += coul(u"Paiement reçu : ", "gras") - f += coul(facture.recuPaiement(), "vert") if facture.recuPaiement() else coul(u"Non", "rouge") + f += coul(datetimeFromGTF(facture.recuPaiement()).strftime("%d/%m/%Y %H:%M:%S%z"), "vert") if facture.recuPaiement() else coul(u"Non", "rouge") f += u"\n" f += coul(u"Contrôle : ", "gras") f += controle