Correction d'un bug : affichage d'un devis vide
darcs-hash:20071001095709-f46e9-99e4918d3ca5290463e28c27b9cf163fed77a529.gz
This commit is contained in:
parent
ad499ff344
commit
31ad765d3f
2 changed files with 33 additions and 14 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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] €</td>
|
||||
|
@ -54,12 +60,18 @@
|
|||
</td>
|
||||
|
||||
</tr>
|
||||
#end for
|
||||
#end for
|
||||
<tr>
|
||||
<td colspan="3" class="tdTotalDetailIntitule">
|
||||
Total
|
||||
</td>
|
||||
<td class="tdTotalDetail">$total €</td>
|
||||
<td class="tdTotalDetail">$getVar('total', "XXX") €</td>
|
||||
</tr>
|
||||
|
||||
#else
|
||||
<tr><td class="full" colspan="4"><h2>Non disponible </h2></td></tr>
|
||||
#end if
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue