Ajout liste matériel d'une catégorie
This commit is contained in:
parent
772381be37
commit
6551c9ec07
|
@ -17,6 +17,7 @@
|
|||
<td>{{$type}}
|
||||
<td>{{$key}}</td>
|
||||
<td class="actions">
|
||||
{{:linkbutton label="Liste des matériels" href="list_equipment.html?id=%s&dialog"|args:$key shape="search" target="_dialog"}}
|
||||
{{:linkbutton label="Supprimer" href="delete_category.html?id=%s"|args:$key shape="delete" target="_dialog"}}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
{{#restrict section="config" level="admin" block=true}}{{/restrict}}
|
||||
|
||||
{{#load key=$_GET.id}}
|
||||
{{:assign cat_name=$name}}
|
||||
{{/load}}
|
||||
|
||||
{{:admin_header title="Matériels de la catégorie « %s »"|args:$cat_name current="module_equipment"}}
|
||||
|
||||
{{if $_GET.dialog === null}}
|
||||
{{* barre de navigation *}}
|
||||
{{:include file="/%s/_nav.html"|args:$module.name current="categories"}}
|
||||
{{else}}
|
||||
<header class="header">
|
||||
<h1>Matériels de la catégorie « {{$cat_name}} »</h1>
|
||||
</header>
|
||||
{{/if}}
|
||||
|
||||
{{* afficher les matériels de la catégorie sélectionnée avec le stock, les entrées et les sorties *}}
|
||||
<section class="categories">
|
||||
|
||||
{{#list
|
||||
select="$$.designation AS 'Désignation'; '' AS 'Stock' ; '' AS 'Sortie' ; '' AS 'Disponible'"
|
||||
type="equipment"
|
||||
category=$_GET.id
|
||||
order=1}}
|
||||
|
||||
{{:assign equipment_key=$key}}
|
||||
{{:assign var="stock" value=0}}
|
||||
{{:assign var="sortie" value=0}}
|
||||
|
||||
{{* récupérer 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>
|
||||
<td>{{$designation}}</td>
|
||||
<td>{{$stock}}</td>
|
||||
<td>{{$sortie}}</td>
|
||||
<td>{{$dispo}}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{{/list}}
|
||||
|
||||
</section>
|
||||
|
||||
{{:admin_footer}}
|
Loading…
Reference in New Issue