annulation d'une facture non paye
darcs-hash:20061025182958-f46e9-c88fbf735adede3d119ff412ccd27aafe7131dae.gz
This commit is contained in:
parent
1fea392dae
commit
ffc73b0296
4 changed files with 53 additions and 25 deletions
|
@ -40,10 +40,10 @@ class root:
|
|||
} for art in f.articles()]
|
||||
facture['montant'] = f.total()
|
||||
facture['paypal'] = f.urlPaypal(useSandbox = cherrypy.config.get("paypal.useSandbox", False),
|
||||
businessMail = cherrypy.config.get("paypal.businessAdress", "paypal@crans.org"),
|
||||
return_page = "https://intranet.crans.org/monCompte/paypalReturn",
|
||||
cancel_return_page = "https://intranet.crans.org/monCompte/paypalCancel",
|
||||
)
|
||||
businessMail = cherrypy.config.get("paypal.businessAdress", "paypal@crans.org"),
|
||||
return_page = "https://intranet.crans.org/monCompte/paypalReturn",
|
||||
cancel_return_page = "https://intranet.crans.org/monCompte/paypalCancel",
|
||||
)
|
||||
|
||||
facture['payee'] = f.recuPaiement()
|
||||
listeFactures.append(facture)
|
||||
|
@ -53,7 +53,7 @@ class root:
|
|||
'template' :'factures',
|
||||
'values' :t,
|
||||
'stylesheets' :['cransFactures.css'],
|
||||
'scripts' :[],
|
||||
'scripts' :[],
|
||||
}
|
||||
index.exposed = True
|
||||
|
||||
|
@ -63,17 +63,16 @@ class root:
|
|||
lst = [ x for x in adh.historique() if x.split(u' : ',1)[1].startswith(u'credit') or x.split(u' : ',1)[1].startswith(u'debit') ]
|
||||
histLst = []
|
||||
for anItem in lst:
|
||||
#11/06/2006 01:40, gdetrez : credit 10.0 Euros [Facture n°1 : Impression]
|
||||
aLine = {}
|
||||
aLine["date"] = anItem.split(u",")[0]
|
||||
aLine["type"] = anItem.split(u' : ',2)[1].split(u' ')[0]
|
||||
aLine["montant"] = anItem.split(u' : ',2)[1].split(u' ')[1]
|
||||
try:
|
||||
aLine["intitule"] = anItem.split(u'[')[1].split(u']')[0]
|
||||
except Exception:
|
||||
aLine["intitule"] = ""
|
||||
histLst.append(aLine)
|
||||
|
||||
aLine = {}
|
||||
aLine["date"] = anItem.split(u",")[0]
|
||||
aLine["type"] = anItem.split(u' : ',2)[1].split(u' ')[0]
|
||||
aLine["montant"] = anItem.split(u' : ',2)[1].split(u' ')[1]
|
||||
try:
|
||||
aLine["intitule"] = anItem.split(u'[')[1].split(u']')[0]
|
||||
except Exception:
|
||||
aLine["intitule"] = ""
|
||||
histLst.append(aLine)
|
||||
|
||||
return {
|
||||
'template' :'factures-historique',
|
||||
'values' :{'liste':lst, 'historic_items':histLst},
|
||||
|
@ -81,3 +80,17 @@ class root:
|
|||
'scripts' :[],
|
||||
}
|
||||
historique.exposed = True
|
||||
|
||||
def delFacture(self, no):
|
||||
try:
|
||||
# trrouver la factures
|
||||
fact = self.__ldap.search('fid=' + no, 'w')['facture'][0]
|
||||
#verifier qu'elle appartient bien a l'adherent
|
||||
if not fact.proprietaire().mail() == cherrypy.session['uid']:
|
||||
raise Exception, "Impossible de supprimer cette facture"
|
||||
# la supprimer
|
||||
fact.delete()
|
||||
except Exception, e:
|
||||
cherrypy.log(str(e), "FACTURES", 1)
|
||||
return self.index()
|
||||
delFacture.exposed = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue