From aac1b74dbf8bda67592a29fec346d12b4b6a16c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl-David=20Lasseri?= Date: Thu, 27 Aug 2015 20:23:30 +0200 Subject: [PATCH] =?UTF-8?q?[gest=5Fcrans.py]=20Impression=20=C3=A0=20la=20?= =?UTF-8?q?vol=C3=A9e=20des=20logins/mdp=20wifi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On rajoute la possibilité d'imprimer directement les mdp wifi et on prépare le terrain pour les factures --- gestion/gest_crans.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/gestion/gest_crans.py b/gestion/gest_crans.py index ee6196e0..3ad046ea 100755 --- a/gestion/gest_crans.py +++ b/gestion/gest_crans.py @@ -30,7 +30,7 @@ import signal import getopt from time import strftime, strptime, localtime, mktime, time import re - +import subprocess import affich_tools import config import config.cotisation as cotisation @@ -1213,6 +1213,13 @@ def set_vente(proprio): try: f.recuPaiement(strftime("%Y-%m-%d %H:%M:%S")) f.save() + # arg = u'--title "Impression facture" ' + # arg += u'--yesno "Voulez vous imprimer cette facture ?\n" 0 0' + # no, res_1 = dialog(arg) + # if no: + # return 1 + # else: + # subprocess.call(['/usr/scripts/cransticket/dump_creds.py','fid=%s' % f.numero()]) arg = u'--title "Vente terminée" ' arg += u'--msgbox "Vous pouvez remettre à l\'adherent les articles suivant :\n%s\n\nMerci de noter la facture: fid=%s" 0 0' % ('\n'.join([ "%s %s" % (art['nombre'], art['designation']) @@ -1251,9 +1258,26 @@ def confirm(clas): return 1 try: res = clas.save() + cprint(res) + affich_tools.prompt(u"Appuyez sur ENTREE pour continuer") + if isinstance(clas,MachineWifi): + arg = u'--title "Imprimer code wifi ?" ' + arg += u'--yesno "Voulez vous imprimer ce code wifi ?\n" 0 0' + no ,res_0 = dialog(arg) + if no: + pass + 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.save() + # arg = u'--title "Impression facture" ' + # arg += u'--yesno "Voulez vous imprimer cette facture ?\n" 0 0' + # no, res_2 = dialog(arg) + # if no: + # pass + # else: + # subprocess.call(['/usr/scripts/cransticket/dump_creds.py','fid=%s' % in_facture.numero()]) except Exception as c: arg = u'--title "Enregistrement" ' arg += u'--msgbox "%s\n\n\n" 0 0' % to_unicode(unicode(c.args[0])) @@ -1261,8 +1285,6 @@ def confirm(clas): return 1 in_facture = None - cprint(res) - affich_tools.prompt(u"Appuyez sur ENTREE pour continuer") def set_blackliste(clas): u""" Édite ou ajoute un item de la blackliste """