ajout batch_nuit
This commit is contained in:
@@ -65,3 +65,6 @@ def includeme(config):
|
|||||||
config.add_route('user_edit', '/user_edit/{cd_uti}')
|
config.add_route('user_edit', '/user_edit/{cd_uti}')
|
||||||
config.add_route('users', '/users')
|
config.add_route('users', '/users')
|
||||||
config.add_route('users_ua', '/users_ua')
|
config.add_route('users_ua', '/users_ua')
|
||||||
|
|
||||||
|
# utils
|
||||||
|
config.add_route('batch_nuit', '/batch_nuit/{param}')
|
||||||
|
|||||||
@@ -97,12 +97,12 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-offset-3 col-sm-9">
|
<div class="col-sm-offset-3 col-sm-9">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<a class="btn btn-default" href="${request.route_url('devis_web', nodevis=nodevis)}">
|
|
||||||
<span class="glyphicon glyphicon-arrow-left"></span> Annuler</a>
|
|
||||||
<button class="btn btn-primary" type="submit" name="form.submited">
|
<button class="btn btn-primary" type="submit" name="form.submited">
|
||||||
<span class="glyphicon glyphicon-ok"></span> Enregistrer</button>
|
<span class="glyphicon glyphicon-ok"></span> Enregistrer</button>
|
||||||
<button class="btn btn-danger" type="submit" name="form.deleted" tal:condition="nolig != '0'">
|
<button class="btn btn-danger" type="submit" name="form.deleted" tal:condition="nolig != '0'">
|
||||||
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
||||||
|
<a class="btn btn-default" href="${request.route_url('devis_web', nodevis=nodevis)}">
|
||||||
|
<span class="glyphicon glyphicon-arrow-left"></span> Annuler</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -42,48 +42,50 @@
|
|||||||
<!-- row : entête tableau-->
|
<!-- row : entête tableau-->
|
||||||
<table style="width:100%">
|
<table style="width:100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width:56%"></td>
|
<td style="width:15%"></td>
|
||||||
|
<td style="width:41%"></td>
|
||||||
<td style="width:8%; text-align:right">Surf./ Qté</td>
|
<td style="width:8%; text-align:right">Surf./ Qté</td>
|
||||||
<td style="width:18%; text-align:right">P.U. HT</td>
|
<td style="width:18%; text-align:right">P.U. HT</td>
|
||||||
<td style="width:18%; text-align:right">Montant HT</td>
|
<td style="width:18%; text-align:right">Montant HT</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3"><hr></td>
|
<td colspan="4"><hr></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- clignes de détail du devis -->
|
||||||
<div tal:replace="structure dt_html">Les lignes du devis ici</div>
|
<div tal:replace="structure dt_html">Les lignes du devis ici</div>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3"></td>
|
<td colspan="4"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"></td>
|
<td colspan="3"></td>
|
||||||
<td>Total HT</td>
|
<td>Total HT</td>
|
||||||
<td style="text-align:right">${layout.to_euro(devis.TOTALHT)}</td>
|
<td style="text-align:right">${layout.to_euro(devis.TOTALHT)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"></td>
|
<td colspan="3"></td>
|
||||||
<td>TVA ${layout.to_percent(devis.TAUXTVA)}</td>
|
<td>TVA ${layout.to_percent(devis.TAUXTVA)}</td>
|
||||||
<td style="text-align:right">${layout.to_euro(devis.TOTALTVA)}</td>
|
<td style="text-align:right">${layout.to_euro(devis.TOTALTVA)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"></td>
|
<td colspan="3"></td>
|
||||||
<td><b>Total TTC</b></td>
|
<td><b>Total TTC</b></td>
|
||||||
<td style="text-align:right"><b>${layout.to_euro(devis.TOTALTTC)}</b></td>
|
<td style="text-align:right"><b>${layout.to_euro(devis.TOTALTTC)}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3"> </td>
|
<td colspan="5"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3">
|
<td colspan="5">
|
||||||
Si vous acceptez ce devis, veuillez nous en retourner un exemplaire signé et précédé de la mention "Bon pour Accord".
|
Si vous acceptez ce devis, veuillez nous en retourner un exemplaire signé et précédé de la mention "Bon pour Accord".
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3"> </td>
|
<td colspan="4"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- row : bas de devis-->
|
<!-- row : bas de devis-->
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td colspan="2">
|
||||||
<p tal:condition="devis.TYPECLI == 'P'">
|
<p tal:condition="devis.TYPECLI == 'P'">
|
||||||
<b>Conditions de réglement :</b><br />
|
<b>Conditions de réglement :</b><br />
|
||||||
Acompte de 30 % à la commande, Le solde à réception de la facture.
|
Acompte de 30 % à la commande, Le solde à réception de la facture.
|
||||||
|
|||||||
@@ -71,7 +71,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr tal:repeat="detail details">
|
<tr tal:repeat="detail details">
|
||||||
<td><a href="/devis_ligne/${detail.type_ligne}/${nodevis}/${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>
|
||||||
|
${detail.libelle}
|
||||||
|
<span tal:condition="detail.metrage"><br />${detail.metrage}</span>
|
||||||
|
<span tal:condition="detail.deduction"> - ${detail.deduction}</span>
|
||||||
|
</td>
|
||||||
<td class="text-right">${layout.to_decz(detail.qte)}</td>
|
<td class="text-right">${layout.to_decz(detail.qte)}</td>
|
||||||
<td class="text-right">${layout.to_euroz(detail.prixht)}</td>
|
<td class="text-right">${layout.to_euroz(detail.prixht)}</td>
|
||||||
<td class="text-right">${layout.to_euroz(detail.mtht)}</td>
|
<td class="text-right">${layout.to_euroz(detail.mtht)}</td>
|
||||||
|
|||||||
@@ -340,7 +340,8 @@ def devis_preview(request):
|
|||||||
elif ligne.ref == 'TX':
|
elif ligne.ref == 'TX':
|
||||||
dt_html += '<tr><td colspan="3"><p>%s</p></td></tr>' % ligne.libelle
|
dt_html += '<tr><td colspan="3"><p>%s</p></td></tr>' % ligne.libelle
|
||||||
elif ligne.type_ligne == 'AR':
|
elif ligne.type_ligne == 'AR':
|
||||||
dt_html += '<tr><td><p>%s<br />' % ligne.libelle
|
dt_html += '<tr><td style="vertical-align: top">%s</td>' % ligne.ref
|
||||||
|
dt_html += '<td><p>%s<br />' % ligne.libelle
|
||||||
if ligne.metrage:
|
if ligne.metrage:
|
||||||
dt_html += ligne.metrage
|
dt_html += ligne.metrage
|
||||||
if ligne.deduction:
|
if ligne.deduction:
|
||||||
|
|||||||
21
mondumas/views/utils.py
Normal file
21
mondumas/views/utils.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# -*- coding: utf8 -*-
|
||||||
|
from pyramid.response import Response
|
||||||
|
from pyramid.view import (
|
||||||
|
view_config,
|
||||||
|
)
|
||||||
|
|
||||||
|
@view_config(route_name='batch_nuit')
|
||||||
|
def batch_nuit(request):
|
||||||
|
"""
|
||||||
|
Traitement de nuit lancé chaque nuit à heure fixe par cron
|
||||||
|
Par sécurité, ce view ne peut être appelé qu'avec un paramètre secret 'JonSn0w'
|
||||||
|
|
||||||
|
"""
|
||||||
|
# import pdb;pdb.set_trace()
|
||||||
|
# contrôle : paramètre correct ? non, terminer
|
||||||
|
par = request.matchdict['param']
|
||||||
|
if par != 'JonSn0w':
|
||||||
|
return Response('Erreur : paramètre incorrect')
|
||||||
|
|
||||||
|
return Response('Batch nuit terminé OK')
|
||||||
|
|
||||||
Reference in New Issue
Block a user