Correction d'un bug : affichage d'un devis vide

darcs-hash:20071001095709-f46e9-99e4918d3ca5290463e28c27b9cf163fed77a529.gz
This commit is contained in:
gdetrez 2007-10-01 11:57:09 +02:00
parent ad499ff344
commit 31ad765d3f
2 changed files with 33 additions and 14 deletions

View file

@ -108,16 +108,23 @@ class main(ModuleBase):
#
def devis(self):
return {
'template':'impression-devis',
'values':
{
'devis':cherrypy.session['impression'].devisDetaille(),
'total':cherrypy.session['impression'].prix(),
'nomFichier':cherrypy.session['impression'].fileName(),
},
'standalone':True,
}
if cherrypy.session.has_key('impression') and cherrypy.session['impression'] != None :
return {
'template':'impression-devis',
'values':
{
'devis':cherrypy.session['impression'].devisDetaille(),
'total':cherrypy.session['impression'].prix(),
'nomFichier':cherrypy.session['impression'].fileName(),
},
'standalone':True,
}
else:
return {
'template':'impression-devis',
'values': { },
'standalone':True,
}
devis.exposed=True

View file

@ -29,12 +29,17 @@
margin:0;
padding:5px 20px;
}
table.factureDetails td.full {
text-align:center;
border: none;
}
</style>
</head>
<body>
<div style="background:white url(/static/images/petitCr@ns.png) top left no-repeat; padding:2em;width:21cm;border:thin black solid;">
<h1 style="margin:1em 1em 1em 50px;">Devis pour impression</h1>
<span style="font-weight:bold;">Fichier : </span> $nomFichier
<span style="font-weight:bold;">Fichier : </span> $getVar('nomFichier', 'XXXXX')
<div id="facture" style="margin:2em 1em 1em 1em;">
<table cellspacing="0" border="0" class="factureDetails">
<tr>
@ -44,7 +49,8 @@
<th>total</th>
</tr>
#for anItem in $devis
#if $getVar('devis', False)
#for anItem in $devis
<tr>
<td>$anItem[0]</td>
<td>$anItem[1]&nbsp;&euro;</td>
@ -54,12 +60,18 @@
</td>
</tr>
#end for
#end for
<tr>
<td colspan="3" class="tdTotalDetailIntitule">
Total
</td>
<td class="tdTotalDetail">$total&nbsp;&euro;</td>
<td class="tdTotalDetail">$getVar('total', "XXX")&nbsp;&euro;</td>
</tr>
#else
<tr><td class="full" colspan="4"><h2>Non disponible </h2></td></tr>
#end if
</table>
</div>
</div>