ajout module devis

This commit is contained in:
2020-09-23 17:11:07 +02:00
parent 64b049251e
commit ec19e2db35
872 changed files with 65160 additions and 112 deletions

View File

@@ -0,0 +1,117 @@
<metal:block use-macro="main_template">
<div metal:fill-slot="content">
<br />
<!-- ENTETE -->
<div class="row">
<!-- CHANTIER -->
<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>
<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}
</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 />
</td>
</tr>
</table>
</div>
</div> <!-- row -->
<!-- ENTETE DEVIS -->
<table class="table table-bordered table-condensed">
<tr class="well">
<th class="text-right">Total HT</th>
<th class="text-right">Total TVA</th>
<th class="text-right">Total TTC</th>
<th class="text-right">TVA</th>
</tr>
<tr>
<td class="text-right">${layout.to_decz(dossier.TOTALHT)}</td>
<td class="text-right">${layout.to_euroz(dossier.TOTALTVA)}</td>
<td class="text-right">${layout.to_euroz(dossier.TOTALTTC)}</td>
<td class="text-right">${dossier.TAUXTVA} %</td>
</tr>
</table>
<table class="table table-bordered table-condensed">
<tr class="well">
<th>Réf</th>
<th>Désignation</th>
<th class="text-right">Qté</th>
<th class="text-right">PU HT</th>
<th class="text-right">Montant HT</th>
<th></th>
</tr>
<tr tal:repeat="detail details">
<td>${detail.REF}</td>
<td>${detail.LIB}</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.MTHT)}</td>
<td class="text-center">${detail.USERMAJ}</td>
</tr>
</table>
<p>
<a class="btn btn-success" role="button" href="${request.route_url('devis_create', nodossier=nodossier)}"
data-toggle="modal" data-target="#confirmCreate"><span class="glyphicon glyphicon-plus"></span> Nouvelle ligne</a>
</p>
<!-- Modal : Confirmation CREATION -->
<div class="modal fade" id="confirmCreate" role="dialog" aria-labelledby="confirmCreateLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Ajouter une ligne de devis</h4>
</div>
<div class="modal-body">
<!-- The form is placed inside the body of modal -->
<form id="add_justif-form" class="form-horizontal" action="${url}" method="post"
data-fv-framework="bootstrap"
data-fv-icon-valid="glyphicon glyphicon-ok"
data-fv-icon-invalid="glyphicon glyphicon-remove"
data-fv-icon-validating="glyphicon glyphicon-refresh">
<div class="form-group">
<label class="control-label col-xs-4">Sélectionner le type :</label>
<div class="col-xs-8">
<label class="radio"><input type="radio" name="type_lig" value="TX" checked>Titre, sous-titre, ligne detexte</label>
<label class="radio"><input type="radio" name="type_lig" value="AR">Article</label>
<label class="radio"><input type="radio" name="type_lig" value="CA">Calcul</label>
<label class="radio"><input type="radio" name="type_lig" value="ST">Sous-total</label>
</div>
</div>
<div class="form-group">
<div class="col-xs-5 col-xs-offset-3">
<button type="submit" class="btn btn-danger" name="form.added">Ajouter</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<br />
<br />
</div>
</metal:block>

View File

@@ -0,0 +1,100 @@
<metal:block use-macro="main_template">
<div metal:fill-slot="content">
<div class="alert alert-danger" tal:condition="message" tal:content="message" />
<div class="row">
<form id="devis-search-form" class="form-horizontal" role="form" action="${url}" method="post"
data-fv-framework="bootstrap"
data-fv-icon-valid="glyphicon glyphicon-ok"
data-fv-icon-invalid="glyphicon glyphicon-remove"
data-fv-icon-validating="glyphicon glyphicon-refresh">
<div class="form-group">
<label class="col-sm-4 control-label">Société</label>
<div class="col-xs-8">
<label class="radio-inline"><input type="radio" name="societe" value="PE"
tal:attributes="checked societe=='PE'">PE</label>
<label class="radio-inline"><input type="radio" name="societe" value="ME"
tal:attributes="checked societe=='ME'">ME</label>
<label class="radio-inline"><input type="radio" name="societe" value="PL"
tal:attributes="checked societe=='PL'">PL</label>
<label class="radio-inline"><input type="radio" name="societe" value="PO"
tal:attributes="checked societe=='PO'">PO</label>
<label class="radio-inline"><input type="radio" name="societe" value="CD"
tal:attributes="checked societe=='CD'">CD</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Nom ou numéro du chantier</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="name" value="${name}"
placeholder="Le nom ou le numéro doit avoir de 2 à 30 caractères de long" >
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<button id="submitButton" class="btn btn-primary" type="submit" name="form.submitted">
<span class="glyphicon glyphicon-search"></span>&nbsp;Rechercher</button>
</div>
</div>
</form>
</div><!-- row -->
<div class="row">
<table class="table table-bordered">
<thead>
<tr>
<th>Numéro</th>
<th>Date</th>
<th>Client</th>
<th>Chantier</th>
<th class="text-right">Montant</th>
<th>Sinistre</th>
<th class="text-center">Statut</th>
</tr>
<tr tal:repeat="detail devis">
<td>
<a href="/devis_view/${societe}-DE${detail.numero}">${societe}-${detail.numero}</a>
</td>
<td>${detail.date.strftime('%d-%m-%Y')}</td>
<td>${detail.nomcli}</td>
<td>${detail.chantier}</td>
<td class="text-right">${layout.to_euro(detail.montant)}</td>
<td>${detail.nosin}</td>
<td class="text-center">${detail.status}</td>
</tr>
</thead>
</table>
<br />
<br />
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#devis-search-form').formValidation({
framework: 'bootstrap',
message: 'This value is not valid',
icon: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
});
$('form input').on('keypress', function(e) {
var code = e.keyCode || e.which;
if (code === 13) {
e.preventDefault();
// simuler clic bouton submit
document.getElementById("submitButton").click();
}
});
</script>
</div>
</metal:block>

View File

@@ -0,0 +1,99 @@
<metal:block use-macro="main_template">
<div metal:fill-slot="content">
<br />
<!-- ENTETE -->
<div class="row">
<!-- CHANTIER -->
<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>
<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}
</td>
</tr>
<tr>
<td>
Etage - Code<br />
Tél. domicile - prof.<br />
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}
</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 />
</td>
</tr>
<tr>
<td>
Responsable<br />
Tél. 1 - 2<br />
Tél. mobile - fax
</td>
<td>
${dossier.NOMRESP}<br />
${dossier.TEL1} - ${dossier.TEL2}<br />
${dossier.TELP} - ${dossier.FAX}
</td>
</tr>
</table>
</div>
<h4>Statut : ${dossier.STATUS}</h4>
</div> <!-- row -->
<!-- ENTETE DEVIS -->
<table class="table table-bordered table-condensed">
<tr class="well">
<th class="text-right">Total HT</th>
<th class="text-right">Total TVA</th>
<th class="text-right">Total TTC</th>
<th class="text-right">TVA</th>
</tr>
<tr>
<td class="text-right">${layout.to_decz(dossier.TOTALHT)}</td>
<td class="text-right">${layout.to_euroz(dossier.TOTALTVA)}</td>
<td class="text-right">${layout.to_euroz(dossier.TOTALTTC)}</td>
<td class="text-right">${dossier.TAUXTVA} %</td>
</tr>
</table>
<table class="table table-bordered table-condensed">
<tr class="well">
<th>Réf</th>
<th>Désignation</th>
<th class="text-right">Qté</th>
<th class="text-right">PU HT</th>
<th class="text-right">Montant HT</th>
<th></th>
</tr>
<tr tal:repeat="detail details">
<td>${detail.REF}</td>
<td>${detail.LIB}</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.MTHT)}</td>
<td class="text-center">${detail.USERMAJ}</td>
</tr>
</table>
</div>
</metal:block>