[intranet] suppression des trailing whitespaces qui gênent la lecture
darcs-hash:20090128153306-bd074-4a8923921ada6494c88bee3a177042f771249f1b.gz
This commit is contained in:
parent
636e75038f
commit
0abe5fb17f
3 changed files with 83 additions and 84 deletions
|
@ -1,19 +1,19 @@
|
|||
#! /usr/bin/env python
|
||||
# -*- coding: iso-8859-15 -*-
|
||||
# ##################################################################################################### #
|
||||
# ########################################################################
|
||||
# Mes Sous
|
||||
# ##################################################################################################### #
|
||||
# ########################################################################
|
||||
# Description:
|
||||
# Affiche la liste des factures et l'historique de debits/credits de l'adherent.
|
||||
# Fait aussi les rechargements Paypal
|
||||
# Affiche la liste des factures et l'historique de debits/credits de
|
||||
# l'adherent. Fait aussi les rechargements Paypal
|
||||
# Informations:
|
||||
#
|
||||
#
|
||||
# Pages:
|
||||
# index:liste des factures
|
||||
# historique: historique des débits/crédits
|
||||
# rechargementPaypal: Comme son nom l'indique
|
||||
#
|
||||
# ##################################################################################################### #
|
||||
# ########################################################################
|
||||
import cherrypy, sys, os, datetime
|
||||
|
||||
|
||||
|
@ -35,11 +35,9 @@ class main(ModuleBase):
|
|||
return "Personnel"
|
||||
def icon(self):
|
||||
return "icon.png"
|
||||
|
||||
_club = True
|
||||
|
||||
|
||||
|
||||
def getCurrentAdministrativeYear(self):
|
||||
'''
|
||||
premiere partie de l''annee scolaire en cours
|
||||
|
@ -61,7 +59,7 @@ class main(ModuleBase):
|
|||
t['message'] = message
|
||||
t['error'] = error
|
||||
t['solde'] = adh.solde
|
||||
|
||||
|
||||
############## liste des factures ##############
|
||||
listeFactures = []
|
||||
for f in adh.factures():
|
||||
|
@ -76,18 +74,20 @@ class main(ModuleBase):
|
|||
'prixTotal':art['pu']*art['nombre'],
|
||||
} for art in f.articles()]
|
||||
facture['montant'] = f.total()
|
||||
facture['paypal'] = f.urlPaypal(useSandbox = cherrypy.config.get("paypal.useSandbox", False),
|
||||
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",
|
||||
)
|
||||
|
||||
|
||||
facture['payee'] = f.recuPaiement()
|
||||
listeFactures.append(facture)
|
||||
t['listeFactures'] = listeFactures
|
||||
|
||||
return {
|
||||
'template' :'factures',
|
||||
'template' :'factures',
|
||||
|
||||
'values' :t,
|
||||
'stylesheets' :['cransFactures.css'],
|
||||
'scripts' :[],
|
||||
|
@ -96,7 +96,6 @@ class main(ModuleBase):
|
|||
|
||||
def historique(self, page = 1, items_per_page = 20):
|
||||
adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid'])
|
||||
|
||||
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:
|
||||
|
@ -109,7 +108,7 @@ class main(ModuleBase):
|
|||
except Exception:
|
||||
aLine["intitule"] = ""
|
||||
histLst.append(aLine)
|
||||
|
||||
|
||||
histLst.reverse()
|
||||
page = int(page)
|
||||
items_per_page = int(items_per_page)
|
||||
|
@ -117,20 +116,20 @@ class main(ModuleBase):
|
|||
prevPage = None
|
||||
else:
|
||||
prevPage = page - 1
|
||||
|
||||
|
||||
if page * items_per_page >= histLst.__len__():
|
||||
nextPage = None
|
||||
nextPage = None
|
||||
else:
|
||||
nextPage = page + 1
|
||||
offset = items_per_page * ( page - 1)
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
'template' :'factures-historique',
|
||||
'template' :'factures-historique',
|
||||
'values' :{
|
||||
'liste':lst,
|
||||
'historic_items':histLst[offset:offset + items_per_page],
|
||||
'nextPage':nextPage,
|
||||
'historic_items':histLst[offset:offset + items_per_page],
|
||||
'nextPage':nextPage,
|
||||
'prevPage':prevPage
|
||||
},
|
||||
'stylesheets' :['cransFactures.css'],
|
||||
|
@ -152,11 +151,11 @@ class main(ModuleBase):
|
|||
return self.index()
|
||||
delFacture.exposed = True
|
||||
|
||||
|
||||
|
||||
##########################
|
||||
# paypal
|
||||
##########################
|
||||
#
|
||||
#
|
||||
# methode qui affiche successivement les
|
||||
# templates du popup pour recharger son compte impression
|
||||
# via paypal
|
||||
|
@ -165,13 +164,13 @@ class main(ModuleBase):
|
|||
adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid'])
|
||||
if (etape == "1"): # Introduction
|
||||
return {
|
||||
'template' :'MonCompteRechargePaypal1',
|
||||
'template' :'MonCompteRechargePaypal1',
|
||||
'standalone' :True,
|
||||
'values' :{},
|
||||
}
|
||||
elif (etape == "2"): # choix montant
|
||||
return {
|
||||
'template' :'MonCompteRechargePaypal2',
|
||||
'template' :'MonCompteRechargePaypal2',
|
||||
'standalone' :True,
|
||||
'values' :{},
|
||||
}
|
||||
|
@ -186,14 +185,14 @@ class main(ModuleBase):
|
|||
combien = combien.replace(u',', u'.')
|
||||
# convertissage
|
||||
combien = float(combien)
|
||||
# arrondissage-tronquage :
|
||||
# arrondissage-tronquage :
|
||||
combien = float(int(combien*100)/100.0)
|
||||
# nombre positif
|
||||
if combien < 0:
|
||||
raise ValueError
|
||||
except Exception:
|
||||
return {
|
||||
'template' :'MonCompteRechargePaypal2',
|
||||
'template' :'MonCompteRechargePaypal2',
|
||||
'standalone' :True,
|
||||
'values' :{'error':"Le montant doit être un nombre positif !", 'combien':combien},
|
||||
}
|
||||
|
@ -209,7 +208,7 @@ class main(ModuleBase):
|
|||
} for art in f.articles()]
|
||||
pageData['total'] = f.total()
|
||||
return {
|
||||
'template' :'MonCompteRechargePaypal3',
|
||||
'template' :'MonCompteRechargePaypal3',
|
||||
'standalone' :True,
|
||||
'values' :pageData,
|
||||
}
|
||||
|
@ -218,20 +217,20 @@ class main(ModuleBase):
|
|||
f = cherrypy.session['freshFacture']
|
||||
f.save()
|
||||
return {
|
||||
'template' :'MonCompteRechargePaypal4',
|
||||
'template' :'MonCompteRechargePaypal4',
|
||||
'standalone' :True,
|
||||
'values' :{'lienPaypal' : f.urlPaypal(useSandbox = cherrypy.config.get("paypal.useSandbox", False),
|
||||
'values' :{'lienPaypal' : 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",
|
||||
)},
|
||||
}
|
||||
rechargerCompteImpression.exposed = True
|
||||
|
||||
|
||||
def paypalReturn(self, **kw):
|
||||
_crans_cp.log("retour de paypal avec les infos : %s" % " ".join( [ "[%s: %s]" % (str(a), str(kw[a])) for a in kw] ) )
|
||||
return {
|
||||
'template' :'MonComptePaypalReturn',
|
||||
'template' :'MonComptePaypalReturn',
|
||||
'standalone' :True,
|
||||
'values' :{},
|
||||
}
|
||||
|
@ -240,7 +239,7 @@ class main(ModuleBase):
|
|||
def paypalCancel(self, **kw):
|
||||
_crans_cp.log("annulation de paypal avec les infos : %s" % " ".join( [ "[%s: %s]" % (str(a), str(kw[a])) for a in kw] ) )
|
||||
return {
|
||||
'template' :'MonComptePaypalCancel',
|
||||
'template' :'MonComptePaypalCancel',
|
||||
'standalone' :True,
|
||||
'values' :{},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue