From 9c58465015d4f63da1e0c217a18f9c8b7b86ccf0 Mon Sep 17 00:00:00 2001 From: gdetrez Date: Wed, 6 Dec 2006 03:16:35 +0100 Subject: [PATCH] quelques bugs darcs-hash:20061206021635-f46e9-2be3eca7ee1eab5d071aa90b1b8d410880f8c698.gz --- intranet/pages/gestionFactures.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/intranet/pages/gestionFactures.py b/intranet/pages/gestionFactures.py index 6394697f..7704be9b 100755 --- a/intranet/pages/gestionFactures.py +++ b/intranet/pages/gestionFactures.py @@ -86,21 +86,23 @@ class root: return [] liste_factures_affichees = [] for f in liste_factures_ldap: - facture = {} - facture['no'] = f.numero() - facture['adherent'] = f.proprietaire().mail() - facture['montant'] = f.total() - facture['payee'] = f.recuPaiement() - facture['intitule'] = f.articles()[0]['designation'] - facture['details'] = [ + try: + facture = {} + facture['no'] = f.numero() + facture['adherent'] = f.proprietaire().mail() + facture['montant'] = f.total() + facture['payee'] = f.recuPaiement() + facture['intitule'] = f.articles()[0]['designation'] + facture['details'] = [ { 'intitule':art['designation'], 'quantite':art['nombre'], 'prixUnitaire':art['pu'], 'prixTotal':art['pu']*art['nombre'], } for art in f.articles()] - liste_factures_affichees.append(facture) - + liste_factures_affichees.append(facture) + except: + crans.cp.log("Facture non affichable : fid=%s" % str(f.numero()), "GESTION FACTURES", 1) return liste_factures_affichees @@ -112,9 +114,9 @@ class root: fact.delete() except Exception, e: crans.cp.log(unicode(e), "GESTION FACTURES", 1) - return self.index(erreur=u"Problème lors de la suppression") - crans.cp.log(u"Facture supprimée [fid=%s]" % fid, "GESTION FACTURES") - return self.index(message=u"Facture suprimée") + return self.index(erreur=u"Probleme lors de la suppression") + crans.cp.log(u"Facture supprimee [fid=%s]" % fid, "GESTION FACTURES") + return self.displayTemplate(message=u"Facture suprimée") delFacture.exposed = True def crediteFacture(self, fid): @@ -127,6 +129,6 @@ class root: except Exception, e: crans.cp.log("pb crédit", "GESTION FACTURES", 1) return self.index(erreur=u"Problème lors du crédit") - crans.cp.log("Facture créditée [fid=%s]" % fid, "GESTION FACTURES") - return self.index(message=u"Facture créditée") + crans.cp.log("Facture creditee [fid=%s]" % fid, "GESTION FACTURES") + return self.displayTemplate(message=u"Facture créditée") crediteFacture.exposed = True