genere devis en pdf

This commit is contained in:
2020-11-11 15:05:59 +01:00
parent 6bc9d34fde
commit dab24387a2
10 changed files with 173 additions and 130 deletions

View File

@@ -6,37 +6,35 @@
<div class="row">
<!-- colonne gauche : REFERENCES -->
<div class="col-sm-6">
<p tal:condition="dossier.no_agrement">N° Agrément : ${dossier.no_agrement}</p>
<p tal:condition="devis.no_agrement">N° Agrément : ${devis.no_agrement}</p>
<br/><br/>
<p tal:condition="dossier.NOSIN">N° sinistre : ${dossier.NOSIN}</p>
<p tal:condition="dossier.NOPOL">N° sinistre : ${dossier.NOPOL}</p>
<p tal:condition="dossier.REF_EXPERT">Réf. expert : ${dossier.REF_EXPERT}</p>
<p tal:condition="dossier.VREF">V/Référence : ${dossier.VREF}</p>
<p tal:condition="devis.NOSIN">N° sinistre : ${devis.NOSIN}</p>
<p tal:condition="devis.NOPOL">N° sinistre : ${devis.NOPOL}</p>
<p tal:condition="devis.REF_EXPERT">Réf. expert : ${devis.REF_EXPERT}</p>
<p tal:condition="devis.VREF">V/Référence : ${devis.VREF}</p>
<br />
<p>${dossier.LIBCOMPL}</p>
<p>${devis.LIBCOMPL}</p>
<br/><br/>
<p>N° dossier : ${dossier.nochantier}</p>
<p>N° dossier : ${devis.nochantier}</p>
<br/><br/>
<H3>DEVIS N° ${dossier.societe}-${dossier.NO_ID}<h/H3>
<H3>DEVIS N° ${devis.societe}-${devis.NO_ID}<h/H3>
</div>
<!-- colonne droite : ADRESSES -->
<div class="col-sm-6">
<br/><br/>
<h4>${dossier.C_QUALITE} ${dossier.C_NOM}</h4>
<h4>${dossier.C_ADR}</h4>
<h4 tal:condition="dossier.C_ADR2">${dossier.C_ADR2}<br /></h4>
<br />
<h4>${dossier.C_CP} ${dossier.C_VILLE}</h4>
<h4>${devis.C_QUALITE} ${devis.C_NOM}</h4>
<h4>${devis.C_ADR}</h4>
<h4 tal:condition="devis.C_ADR2">${devis.C_ADR2}<br /></h4>
<h4>${devis.C_CP} ${devis.C_VILLE}</h4>
<br />
<br />
<p>Rilieux-la-Pape, le ${dossier.DATE.strftime('%d-%m-%Y')}</p>
<p>Rilieux-la-Pape, le ${devis.DATE.strftime('%d-%m-%Y')}</p>
<br />
<h4>${dossier.QUALITE} ${dossier.NOM}</h4>
<h4>${dossier.ADRESSE}</h4>
<h4 tal:condition="dossier.ADRESSE2">${dossier.ADRESSE2}<br /></h4>
<br />
<h4>${dossier.CP} ${dossier.VILLE}</h4>
<h4>${devis.QUALITE} ${devis.NOM}</h4>
<h4>${devis.ADRESSE}</h4>
<h4 tal:condition="devis.ADRESSE2">${devis.ADRESSE2}<br /></h4>
<h4>${devis.CP} ${devis.VILLE}</h4>
</div>
</div> <!-- row : entête-->
<br/>
@@ -63,13 +61,13 @@
</div>
<div class="col-sm-2">
<h4>Total HT</h4>
<h4>TVA ${layout.to_percent(dossier.TAUXTVA)}</h4>
<h4>TVA ${layout.to_percent(devis.TAUXTVA)}</h4>
<h4>Total TTC</h4>
</div>
<div class="col-sm-3">
<h4 class="text-right">${layout.to_euro(dossier.TOTALHT)}</h4>
<h4 class="text-right">${layout.to_euro(dossier.TOTALTVA)}</h4>
<h4 class="text-right">${layout.to_euro(dossier.TOTALTTC)}</h4>
<h4 class="text-right">${layout.to_euro(devis.TOTALHT)}</h4>
<h4 class="text-right">${layout.to_euro(devis.TOTALTVA)}</h4>
<h4 class="text-right">${layout.to_euro(devis.TOTALTTC)}</h4>
</div>
<br />
<div class="col-sm-12">
@@ -80,11 +78,11 @@
</div> <!-- row : bas de devis-->
<div class="row">
<div class="col-sm-6">
<p tal:condition="dossier.TYPECLI == 'P'">
<p tal:condition="devis.TYPECLI == 'P'">
<b>Conditions de réglement :</b><br />
Acompte de 30 % à la commande, Le solde à réception de la facture.
</p>
<p tal:condition="dossier.CODETVA == 4">
<p tal:condition="devis.CODETVA == 4">
NOTA : Pour bénéficier du taux réduit de T.V.A. à 7%, vous devez nous fournir en même temps que l'acceptation du devis, une attestation sur papier libre, stipulant que votre habitation est construite depuis plus de deux ans.
</p>
</div>

View File

@@ -7,14 +7,14 @@
<div class="col-md-6">
<table class="table table-condensed">
<tr>
<td><h4>CHANTIER</h4><h4 class="text-primary">${dossier.societe}-${dossier.nochantier}</h4>
<td><h4>CHANTIER</h4><h4 class="text-primary">${devis.societe}-${devis.nochantier}</h4>
</td>
<td>
<h4>${dossier.C_QUALITE} ${dossier.C_NOM}</h4>
${dossier.C_ADR}<br />
<span tal:condition="dossier.C_ADR2">${dossier.C_ADR2}<br /></span>
${dossier.C_CP} ${dossier.C_VILLE}<br />
${dossier.C_EMAIL}
<h4>${devis.C_QUALITE} ${devis.C_NOM}</h4>
${devis.C_ADR}<br />
<span tal:condition="devis.C_ADR2">${devis.C_ADR2}<br /></span>
${devis.C_CP} ${devis.C_VILLE}<br />
${devis.C_EMAIL}
</td>
</tr>
<tr>
@@ -24,9 +24,9 @@
Tél. mobile - fax
</td>
<td>
${dossier.C_ETAGE} - ${dossier.C_CODE}<br />
${dossier.C_TEL1} - ${dossier.C_TEL2}<br />
${dossier.C_TELP} - ${dossier.C_FAX}
${devis.C_ETAGE} - ${devis.C_CODE}<br />
${devis.C_TEL1} - ${devis.C_TEL2}<br />
${devis.C_TELP} - ${devis.C_FAX}
</td>
</tr>
</table>
@@ -38,10 +38,10 @@
<tr>
<td><h4>CLIENT</h4></td>
<td>
<h4>${dossier.QUALITE} ${dossier.NOM}</h4>
${dossier.ADRESSE}<br />
<span tal:condition="dossier.ADRESSE2">${dossier.ADRESSE2}<br /></span>
${dossier.CP} ${dossier.VILLE}<br />
<h4>${devis.QUALITE} ${devis.NOM}</h4>
${devis.ADRESSE}<br />
<span tal:condition="devis.ADRESSE2">${devis.ADRESSE2}<br /></span>
${devis.CP} ${devis.VILLE}<br />
</td>
</tr>
<tr>
@@ -51,14 +51,14 @@
Tél. mobile - fax
</td>
<td>
${dossier.NOMRESP}<br />
${dossier.TEL1} - ${dossier.TEL2}<br />
${dossier.TELP} - ${dossier.FAX}
${devis.NOMRESP}<br />
${devis.TEL1} - ${devis.TEL2}<br />
${devis.TELP} - ${devis.FAX}
</td>
</tr>
</table>
</div>
<h4>Statut : ${dossier.STATUS}</h4>
<h4>Statut : ${devis.STATUS}</h4>
</div> <!-- row -->
<!-- ENTETE DEVIS -->
<table class="table table-bordered table-condensed">
@@ -69,10 +69,10 @@
<th class="text-right">TVA</th>
</tr>
<tr>
<td class="text-right">${layout.to_euro(dossier.TOTALHT)}</td>
<td class="text-right">${layout.to_euro(dossier.TOTALTVA)}</td>
<td class="text-right">${layout.to_euro(dossier.TOTALTTC)}</td>
<td class="text-right">${dossier.TAUXTVA} %</td>
<td class="text-right">${layout.to_euro(devis.TOTALHT)}</td>
<td class="text-right">${layout.to_euro(devis.TOTALTVA)}</td>
<td class="text-right">${layout.to_euro(devis.TOTALTTC)}</td>
<td class="text-right">${devis.TAUXTVA} %</td>
</tr>
</table>

View File

@@ -7,34 +7,35 @@
<div class="col-md-6">
<table class="table table-condensed">
<tr>
<td><h4>CHANTIER</h4><h4 class="text-primary">${dossier.societe}-${dossier.nochantier}</h4>
<td><h4>CHANTIER</h4>
<p><a href="/dossier_view/${devis.societe}-${devis.nochantier}">${devis.societe}-${devis.nochantier}</a></p>
</td>
<td>
<h4>${dossier.C_QUALITE} ${dossier.C_NOM}</h4>
${dossier.C_ADR}<br />
<span tal:condition="dossier.C_ADR2">${dossier.C_ADR2}<br /></span>
${dossier.C_CP} ${dossier.C_VILLE}<br />
${dossier.C_EMAIL}
<h4>${devis.C_QUALITE} ${devis.C_NOM}</h4>
${devis.C_ADR}<br />
<span tal:condition="devis.C_ADR2">${devis.C_ADR2}<br /></span>
${devis.C_CP} ${devis.C_VILLE}<br />
${devis.C_EMAIL}
</td>
</tr>
</table>
</div>
<!-- Mon compte -->
<div class="col-md-6 ${bg_color}">
<table class="table table-condensed ">
<tr>
<td><h4>CLIENT</h4></td>
<td>
<h4>${dossier.QUALITE} ${dossier.NOM}</h4>
${dossier.ADRESSE}<br />
<span tal:condition="dossier.ADRESSE2">${dossier.ADRESSE2}<br /></span>
${dossier.CP} ${dossier.VILLE}<br />
<h4>${devis.QUALITE} ${devis.NOM}</h4>
${devis.ADRESSE}<br />
<span tal:condition="devis.ADRESSE2">${devis.ADRESSE2}<br /></span>
${devis.CP} ${devis.VILLE}<br />
</td>
</tr>
</table>
</div>
</div> <!-- row -->
<br />
<!-- ENTETE DEVIS -->
<table class="table table-bordered table-condensed">
<tr class="well">
@@ -44,19 +45,21 @@
<th class="text-right">TVA</th>
</tr>
<tr>
<td class="text-right">${layout.to_euro(dossier.TOTALHT)}</td>
<td class="text-right">${layout.to_euro(dossier.TOTALTVA)}</td>
<td class="text-right">${layout.to_euro(dossier.TOTALTTC)}</td>
<td class="text-right">${dossier.TAUXTVA} %</td>
<td class="text-right">${layout.to_euro(devis.TOTALHT)}</td>
<td class="text-right">${layout.to_euro(devis.TOTALTVA)}</td>
<td class="text-right">${layout.to_euro(devis.TOTALTTC)}</td>
<td class="text-right">${devis.TAUXTVA} %</td>
</tr>
</table>
<p>
<a class="btn btn-primary" role="button" href="${request.route_url('devis_preview', nodossier=nodossier)}">
<span class="glyphicon glyphicon-plus"></span> Prévisualiser</a>
</p>
<table class="table table-bordered table-condensed">
<form id="devis_web-form" action="${url}" method="post">
<a class="btn btn-default" role="button" href="${request.route_url('devis_preview', nodevis=nodevis)}">
<span class="glyphicon glyphicon-eye-open"></span> Aperçu PDF</a>
<button id="generateButton" class="btn btn-warning" type="submit" name="form.generate">
<i class="glyphicon glyphicon-refresh"></i> Générer PDF</button>
</form>
<br />
<table class="table table-bordered table-condensed">
<tr class="well">
<th>Réf</th>
<th>Désignation</th>
@@ -67,7 +70,7 @@
<th></th>
</tr>
<tr tal:repeat="detail details">
<td><a href="/devis_ligne/${detail.type_ligne}/${nodossier}/${detail.nolig}">${detail.ref}</a></td>
<td><a href="/devis_ligne/${detail.type_ligne}/${nodevis}/${detail.nolig}">${detail.ref}</a></td>
<td>${detail.libelle}</td>
<td class="text-right">${layout.to_decz(detail.qte)}</td>
<td class="text-right">${layout.to_euroz(detail.prixht)}</td>
@@ -75,10 +78,10 @@
<td class="text-center">${detail.usermaj}</td>
<td class="text-center">
<a class="btn btn-primary btn-xs" role="button" tal:condition="detail.nolig>1"
href="${request.route_url('devis_lig_mv',move='up',nodossier=nodossier,nolig=detail.nolig)}">
href="${request.route_url('devis_lig_mv',move='up',nodevis=nodevis,nolig=detail.nolig)}">
<span class="glyphicon glyphicon-arrow-up"></span></a>
<a class="btn btn-primary btn-xs" role="button" tal:condition="detail.nolig < max_no"
href="${request.route_url('devis_lig_mv',move='dn',nodossier=nodossier,nolig=detail.nolig)}">
href="${request.route_url('devis_lig_mv',move='dn',nodevis=nodevis,nolig=detail.nolig)}">
<span class="glyphicon glyphicon-arrow-down"></span></a>
</td>
</tr>

View File

@@ -53,7 +53,7 @@
<div class="col-sm-8">
<select class="form-control" name="article">
<div tal:repeat="item articles">
<option value="${item.REF}" tal:attributes="selected article==item.LIBART and 'selected' or None">${item.LIBART} ${item.PRIXHT1}</option>
<option value="${item.REF}" tal:attributes="selected article==item.LIBART and 'selected' or None">${item.LIBART} ${layout.to_euro(item.PRIXHT1)}</option>
</div>
</select>
</div>

View File

@@ -357,7 +357,7 @@
<div tal:condition="access > 0 and date_relu!=''">
<br />
<a class="btn btn-default" href="/rdf_rapport/${rapport.no_id}">
<span class="glyphicon glyphicon-file"></span> Aperçu PDF</a>
<span class="glyphicon glyphicon-eye-open"></span> Aperçu PDF</a>
<button id="generateButton" class="btn btn-warning" type="submit" name="form.generate">
<i class="glyphicon glyphicon-refresh"></i> Générer PDF</button>
<a class="btn btn-primary" href="/rdf_bill/${rapport.no_id}">