retouche get tarifs

This commit is contained in:
2021-06-04 12:26:13 +02:00
parent 83860d3c21
commit 1356fc2255
9 changed files with 117 additions and 188 deletions

View File

@@ -3,11 +3,11 @@
<form method="POST" id="frm" class="form-horizontal">
<div class="form-group">
<label class="control-label col-md-1">Famille : </label>
<label class="control-label col-md-1">groupe : </label>
<div class="col-md-3">
<select class="form-control" id="famille" name="famille" onChange="$('#frm').submit()">
<tal:block tal:repeat="item familles">
<option value="${item}" tal:attributes="selected famille==item and 'selected' or None">${item}</option>
<select class="form-control" id="groupe" name="groupe" onChange="$('#frm').submit()">
<tal:block tal:repeat="item groupes">
<option value="${item}" tal:attributes="selected groupe==item and 'selected' or None">${item}</option>
</tal:block>
</select>
</div>
@@ -16,7 +16,7 @@
<p>
<a href="${request.application_url}/parametres" class="btn btn-default" role="button">
<span class="glyphicon glyphicon-chevron-left"></span> Retour</a>
<a href="${request.application_url}/article_edit/0" class="btn btn-success" role="button">
<a href="${request.application_url}/tarif_edit/${groupe}/0" class="btn btn-success" role="button">
<span class="glyphicon glyphicon-plus"></span> Nouvel tarif</a>
<a href="${request.application_url}/tarifs_import" class="btn btn-primary" role="button">
<span class="glyphicon glyphicon-import"></span> Import tarifs</a>
@@ -27,11 +27,9 @@
<tr>
<th>Référence</th>
<th>Libellé</th>
<th>Libellé 2</th>
<th>Unité</th>
<th class="text-right">Prix HT 1</th>
<th class="text-right">Prix HT 2</th>
<th>Réf. client 1</th>
<th>Réf. client 2</th>
<th>Modif le</th>
</tr>
</thead>
</table>
@@ -41,23 +39,24 @@
<script type="text/javascript">
var dataSet = ${dt_data};
var groupe = '${groupe}';
$(document).ready(function() {
$.fn.dataTable.moment('DD-MM-YYYY HH:mm');
$('#articles_list').DataTable({
data: dataSet,
pageLength: 100,
bLengthChange: false,
searching: false,
searching: true,
language: {
url: 'https://cdn.datatables.net/plug-ins/1.10.16/i18n/French.json'
},
columnDefs: [
{ className: "text-right", "targets": [3,4] },
{ className: "text-right", "targets": [3] },
{ targets: 0,
render: function (data, type, full, meta) {
// ajouter un link vers le formulaire
return '<a href="/article_edit/' + data + '">' + data + '</a>';
return '<a href="/tarif_edit/' + groupe + '/' + data + '">' + data + '</a>';
},
},
]