Poursuite inventaire
This commit is contained in:
parent
8e8f308671
commit
c9b150c0cc
52
index.html
52
index.html
@ -7,14 +7,52 @@
|
|||||||
{{:include file="/%s/_nav.html"|args:$module.name current="index"}}
|
{{:include file="/%s/_nav.html"|args:$module.name current="index"}}
|
||||||
|
|
||||||
<section class="inventaire">
|
<section class="inventaire">
|
||||||
{{#list select="$$.designation AS 'Matériel'; $$.key AS 'Clé'" where="$$.type = 'equipment'"}}
|
|
||||||
<tr>
|
{{* itérer sur les catégories *}}
|
||||||
<th>{{$designation}}</th>
|
{{#load type="category" assign="category" order="$$.name"}}
|
||||||
<td>{{$key}}</td>
|
{{:assign nom_cat=$category.name}}
|
||||||
</tr>
|
{{: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}}
|
||||||
|
|
||||||
{{else}}
|
{{else}}
|
||||||
<p class="block alert">Il n'y a aucun matériel.</p>
|
<p class="block alert">Il n'y a aucune catégorie => il faut en créer au moins une.</p>
|
||||||
{{/list}}
|
{{/load}}
|
||||||
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
Loading…
Reference in New Issue
Block a user