Commit 5180bb4b authored by Raphael-david Lasseri's avatar Raphael-david Lasseri

[dump.py, client.py] Support complet des impressions de factures

On ne filtre plus sur les dates de connexion et d'adhesion pour les factures autres
parent a93b6ed3
......@@ -69,18 +69,29 @@ class Ticket(object):
else:
chambre = u'EXT'
deb_adh = crans_utils.datetime_from_generalized_time_format(facture['debutAdhesion'][0].value)
fin_adh = crans_utils.datetime_from_generalized_time_format(facture['finAdhesion'][0].value)
fin_co = crans_utils.datetime_from_generalized_time_format(facture['finConnexion'][0].value)
try:
deb_adh = crans_utils.datetime_from_generalized_time_format(facture['debutAdhesion'][0].value)
deb_adh = deb_adh.strftime('%d/%m/%Y')
except:
deb_adh=False
try:
fin_adh = crans_utils.datetime_from_generalized_time_format(facture['finAdhesion'][0].value)
fin_adh = fin_adh.strftime('%d/%m/%Y')
except:
fin_adh=False
try:
fin_co = crans_utils.datetime_from_generalized_time_format(facture['finConnexion'][0].value)
fin_co = fin_co.strftime('%d/%m/%Y')
except:
fin_co=False
todo = {
'fid' : facture['fid'][0].value,
'article' : [ art.value for art in facture['article']],
'modePaiement' : facture['modePaiement'][0].value,
'recuPaiement' : facture['recuPaiement'][0].value,
'debutAdhesion' : deb_adh.strftime('%d/%m/%Y'),
'finAdhesion' : fin_adh.strftime('%d/%m/%Y'),
'finConnexion' : fin_co.strftime('%d/%m/%Y'),
'debutAdhesion' : deb_adh,
'finAdhesion' : fin_adh,
'finConnexion' : fin_co,
'chbre' : chambre,
'nom' : proprietaire['nom'][0].value,
'prenom' : proprietaire['prenom'][0].value,
......
......@@ -113,10 +113,12 @@ def show_facture(facture):
printer.println(u'Externe'.encode(CODING))
else:
printer.println((u'Chambre : ' + facture['chbre']).encode(CODING))
printer.println((u'Début adhésion : ' + facture['debutAdhesion']).encode(CODING))
printer.println((u'Fin adhésion : ' + facture['finAdhesion']).encode(CODING))
printer.println((u'Fin connexion : ' + facture['finConnexion']).encode(CODING))
if facture['debutAdhesion']:
printer.println((u'Début adhésion : ' + facture['debutAdhesion']).encode(CODING))
if facture['finAdhesion']:
printer.println((u'Fin adhésion : ' + facture['finAdhesion']).encode(CODING))
if facture['finConnexion']:
printer.println((u'Fin connexion : ' + facture['finConnexion']).encode(CODING))
printer.justify('L')
printer.println(u'--------------------------------'.encode(CODING))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment