2023-10-16 11:57:55 +02:00
|
|
|
{{:assign var="custom_css." value="./style.css"}}
|
|
|
|
{{:assign var="custom_css." value="/content.css"}}
|
|
|
|
|
|
|
|
{{:admin_header title="Gestion des matériels" custom_css=$custom_css current="module_equipment"}}
|
2023-10-10 10:59:46 +02:00
|
|
|
|
|
|
|
{{* barre de navigation *}}
|
2023-10-16 11:57:55 +02:00
|
|
|
{{:include file="/%s/_nav.html"|args:$module.name current="index"}}
|
|
|
|
|
|
|
|
<section class="inventaire">
|
2023-10-20 16:21:21 +02:00
|
|
|
|
|
|
|
{{* itérer sur les catégories *}}
|
|
|
|
{{#load type="category" assign="category" order="$$.name"}}
|
|
|
|
{{:assign nom_cat=$category.name}}
|
|
|
|
{{:assign key_cat=$key}}
|
|
|
|
|
|
|
|
<h3>{{$nom_cat}}</h3>
|
|
|
|
|
|
|
|
{{* itérer sur les matériels de la catégorie courante *}}
|
|
|
|
{{#list
|
|
|
|
select="$$.designation AS 'Désignation'; '' AS 'Stock' ; '' AS 'Sortie' ; '' AS 'Disponible'"
|
|
|
|
type="equipment"
|
|
|
|
category=$key_cat
|
|
|
|
order=1
|
|
|
|
}}
|
|
|
|
|
|
|
|
{{:assign equipment_key=$key}}
|
|
|
|
{{:assign var="stock" value=0}}
|
|
|
|
{{:assign var="sortie" value=0}}
|
|
|
|
|
|
|
|
{{* itérer sur les mouvements du matériel courant *}}
|
|
|
|
{{#load type="movement" equipment=$equipment_key assign="movement"}}
|
|
|
|
{{if $movement.direction === 'entrée'}}
|
|
|
|
{{:assign stock="%d+%d"|math:$stock:$movement.amount}}
|
|
|
|
{{else}}
|
|
|
|
{{:assign sortie="%d+%d"|math:$sortie:$movement.amount}}
|
|
|
|
{{/if}}
|
|
|
|
{{/load}}
|
|
|
|
{{:assign dispo="%d-%d"|math:$stock:$sortie}}
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<th>{{$designation}}</th>
|
|
|
|
<td>{{$stock}}</td>
|
|
|
|
<td>{{$sortie}}</td>
|
|
|
|
<td>{{$dispo}}</td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
{{else}}
|
|
|
|
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
|
|
|
{{/list}}
|
|
|
|
|
2023-10-16 11:57:55 +02:00
|
|
|
{{else}}
|
2023-10-20 16:21:21 +02:00
|
|
|
<p class="block alert">Il n'y a aucune catégorie => il faut en créer au moins une.</p>
|
|
|
|
{{/load}}
|
|
|
|
|
|
|
|
|
2023-10-16 11:57:55 +02:00
|
|
|
</section>
|
2023-10-10 10:59:46 +02:00
|
|
|
|
|
|
|
{{:admin_footer}}
|