Ajout opérations lignes historique

This commit is contained in:
Jean-Christophe Engel 2024-10-24 10:15:56 +02:00
parent 8454c15225
commit 84fb29c15d
2 changed files with 166 additions and 92 deletions

View File

@ -1,3 +1,5 @@
{{* -*- brindille -*- *}}
{{:assign equipment_key=$_GET.key|trim}}
{{#load key=$_GET.key assign="equipment"}}
{{else}}
@ -46,14 +48,16 @@
type="movement"
select="$$.date AS 'Date';
CASE $$.direction WHEN 'input' THEN 'Entrée' WHEN 'output' THEN 'Sortie' END AS 'Mvt';
CASE $$.direction WHEN 'input' THEN $$.input_nature WHEN 'output' THEN $$.output_nature END AS 'Type';
CASE $$.direction WHEN 'input' THEN $$.input_nature WHEN 'output' THEN $$.output_nature END AS 'operation';
$$.amount AS 'Nombre';
$$.comment AS 'Commentaire'"
equipment=$equipment_key
order=1
}}
{{:assign var="type_mvt" from="config.%s_nature.%s"|args:$direction:$col3}}
{{if $direction === "input" && $input_nature|in:$input_types ||
$direction === "output" && $output_nature|in:$output_types
$direction === "output"&& $output_nature|in:$output_types
}}
<tr>
<td>{{$date|date_short}}</td>
@ -61,7 +65,63 @@
<td>{{$col3}}</td>
<td>{{$amount}}</td>
<td>{{$comment}}</td>
<td></td>
<td class="actions">
{{if $direction === "input"}}
{{* entrée *}}
{{if $type_mvt == 'temporaire'}}
{{:linkbutton
label="Retour"
href="mouvements/sorties/emprunte.html?key=%s"|args:$key
shape="history"
target="_dialog"}}
{{elseif $type_mvt == 'définitif'}}
{{:linkbutton
label="Sortir"
href="mouvements/sorties/stock_disponible.html?key=%s"|args:$key
shape="minus"
target="_dialog"}}
{{/if}}
{{:linkbutton
label="Dupliquer"
href="mouvements/dupliquer_mouvement.html?mvt_key=%s&direction=input"|args:$key
shape="plus"
target="_dialog"}}
{{:linkbutton
label="Modifier"
href="mouvements/modifier_mouvement.html?key=%s&direction=input"|args:$key
shape="edit"
target="_dialog"}}
{{:linkbutton
label="Supprimer"
href="mouvements/entrees/delete_entree.html?key=%s"|args:$key
shape="delete"
target="_dialog"}}
{{else}}
{{* sortie *}}
{{if $type_mvt == 'temporaire'}}
{{:linkbutton
label="Retour"
href="mouvements/entrees/retour.html?key=%s"|args:key
shape="history"
target="_dialog"}}
{{/if}}
{{:linkbutton
label="Dupliquer"
href="mouvements/dupliquer_mouvement.html?mvt_key=%s&direction=output"|args:$key
shape="plus"
target="_dialog"}}
{{:linkbutton
label="Modifier"
href="mouvements/modifier_mouvement.html?key=%s&direction=output"|args:$key
shape="edit"
target="_dialog"}}
{{:linkbutton
label="Supprimer"
href="mouvements/sorties/delete_sortie.html?key=%s"|args:$key
shape="delete"
target="_dialog"}}
{{/if}}
</td>
</tr>
{{/if}}
{{/list}}

View File

@ -9,8 +9,10 @@
{{if $equipments === null}}
<p class="block alert">Aucun matériel.</p>
{{else}}
<section class="inventaire">
<h2 class="ruler">Matériels dont l'association est propriétaire</h2>
<details class="inventaire" open="open">
<summary>
<h2>Matériels dont l'association est propriétaire</h2>
</summary>
{{* itérer sur les catégories *}}
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
@ -25,10 +27,14 @@
{{/if}}
{{/foreach}}
{{/if}}
{{if $present}}
{{if $print_cat_name}}
<details class="inventaire" open="open">
<summary>
<h3>{{$cat_elem.name}}</h3>
{{/if}}
</summary>
<table class="list">
<thead>
@ -60,7 +66,7 @@
<td>{{$dispo}}</td>
<td class="actions">
{{:linkbutton
label="Historique des mouvements"
label="Mouvements"
href="%shistorique.html?key=%s&prop=1"|args:$module.url:$eqpmt_key
shape="table"
target="_dialog"}}
@ -77,10 +83,15 @@
{{/foreach}}
</tbody>
</table>
</details>
{{/if}}
{{/foreach}}
</details>
<h2 class="ruler">Matériels dont l'association n'est pas propriétaire</h2>
<details class="inventaire" open="open">
<summary>
<h2>Matériels dont l'association n'est pas propriétaire</h2>
</summary>
{{* itérer sur les catégories *}}
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
@ -95,11 +106,14 @@
{{/if}}
{{/foreach}}
{{/if}}
{{if $present}}
{{if $present}}
{{if $print_cat_name}}
<details class="inventaire" open="open">
<summary>
<h3>{{$cat_elem.name}}</h3>
{{/if}}
</summary>
<table class="list">
<thead>
@ -113,7 +127,6 @@
{{* itérer sur les matériels de la catégorie *}}
{{#foreach from=$cat_elem.eqpmt key="eqpmt_key" item="eqpmt"}}
{{:assign keys=$eqpmt|keys}}
{{if "nonproprio"|in:$keys && $eqpmt.nonproprio !== 0}}
{{:assign dispo="%d-%d"|math:$eqpmt.stock:$eqpmt.exterieur}}
@ -122,7 +135,7 @@
<td>{{$eqpmt.nonproprio}}</td>
<td class="actions">
{{:linkbutton
label="Historique des mouvements"
label="Mouvements"
href="%shistorique.html?key=%s"|args:$module.url:$eqpmt_key
shape="table"
target="_dialog"}}
@ -139,7 +152,8 @@
{{/foreach}}
</tbody>
</table>
</details>
{{/if}}
{{/foreach}}
</section>
</details>
{{/if}}