2024-03-26 17:58:24 +01:00
|
|
|
{{* -*- brindille -*- *}}
|
|
|
|
|
2024-11-14 16:21:10 +01:00
|
|
|
{{*
|
2024-11-16 10:26:48 +01:00
|
|
|
inventaire des entrées/sorties des matériels permanents
|
2024-11-14 16:21:10 +01:00
|
|
|
paramètres
|
2024-11-15 20:40:35 +01:00
|
|
|
- category_keys : catégories dont on veut faire l'inventaire
|
2024-11-14 16:21:10 +01:00
|
|
|
*}}
|
2023-11-17 11:15:26 +01:00
|
|
|
|
|
|
|
{{* Extraire et compiler les infos de la base *}}
|
2024-03-26 17:58:24 +01:00
|
|
|
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
2023-11-17 11:15:26 +01:00
|
|
|
|
2024-11-16 10:26:48 +01:00
|
|
|
{{* Vérifier s'il y a au moins un matériel propriété de l'asso *}}
|
|
|
|
{{:assign mat_prop=false}}
|
|
|
|
{{#foreach from=$equipments key=key item=eqpmt}}
|
|
|
|
{{if $eqpmt|has_key:"stock"}}
|
|
|
|
{{:assign mat_prop=true}}
|
|
|
|
{{:break}}
|
|
|
|
{{/if}}
|
|
|
|
{{/foreach}}
|
|
|
|
|
|
|
|
{{if $mat_prop}}
|
2023-12-06 09:59:11 +01:00
|
|
|
|
2024-11-15 20:40:35 +01:00
|
|
|
{{* Sélecteur catégories *}}
|
2024-11-15 20:26:29 +01:00
|
|
|
<fieldset class="shortForm" style="width: 30%;">
|
2024-11-14 16:21:10 +01:00
|
|
|
<legend>Filtrer par catégorie</legend>
|
|
|
|
<nav class="dropdown">
|
|
|
|
<ul>
|
|
|
|
<li><a></a></li>
|
2024-11-16 10:26:48 +01:00
|
|
|
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?">Toutes les catégories</a></li>
|
2024-11-15 20:26:29 +01:00
|
|
|
{{#load type="category" assign="category"}}
|
|
|
|
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
|
|
|
|
<a href="?cat_key={{$key}}">
|
|
|
|
<strong>{{$category.name}}</strong>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{{/load}}
|
2024-11-14 16:21:10 +01:00
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</fieldset>
|
2023-12-07 17:33:49 +01:00
|
|
|
|
2024-11-16 10:26:48 +01:00
|
|
|
<h2>Matériels propriété de l'association</h2>
|
|
|
|
{{#list
|
|
|
|
select="
|
|
|
|
$$.date AS 'Date' ;
|
|
|
|
(SELECT $$.designation
|
|
|
|
FROM @TABLE AS b
|
|
|
|
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
|
|
|
|
"" as 'Catégorie' ;
|
|
|
|
"" AS 'Stock' ;
|
|
|
|
"" AS 'Sorti' ;
|
|
|
|
"" AS 'Dispo'
|
|
|
|
"
|
|
|
|
type="movement"
|
|
|
|
group="$$.equipment"
|
|
|
|
direction="input"
|
|
|
|
order=2
|
|
|
|
}}
|
2024-10-28 09:53:29 +01:00
|
|
|
|
2024-11-16 10:26:48 +01:00
|
|
|
{{:assign var=cat_key from="equipments.%s.category"|args:$equipment}}
|
|
|
|
{{if $_GET.cat_key != null && $_GET.cat_key != $cat_key}}
|
|
|
|
{{:continue}}
|
|
|
|
{{/if}}
|
2024-10-28 09:53:29 +01:00
|
|
|
|
2024-11-16 10:26:48 +01:00
|
|
|
{{:assign var=cat_name from="cumul_mvt.%s.name"|args:$cat_key}}
|
|
|
|
{{:assign var=stock from="equipments.%s.stock"|args:$equipment}}
|
|
|
|
{{:assign var=exterieur from="equipments.%s.exterieur"|args:$equipment}}
|
|
|
|
{{:assign dispo="%d-%d"|math:$stock:$exterieur}}
|
|
|
|
{{*:debug stock=$stock exterieur=$exterieur dispo=$dispo*}}
|
|
|
|
|
|
|
|
{{if $stock == null}}
|
|
|
|
{{:continue}}
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>{{$date|date_short}}</td>
|
|
|
|
<td>{{$col2}}</td>
|
|
|
|
<td>{{$cat_name}}</td>
|
|
|
|
<td>{{$stock}}</td>
|
|
|
|
<td>{{if $exterieur == null}}0{{else}}{{$exterieur}}{{/if}}</td>
|
|
|
|
<td>{{$dispo}}</td>
|
|
|
|
<td class="actions">
|
|
|
|
{{if $exterieur > 0}}
|
2024-11-15 20:26:29 +01:00
|
|
|
{{:linkbutton
|
2024-11-16 10:26:48 +01:00
|
|
|
label="Retour"
|
|
|
|
href="mouvements/entrees/retour.html?key=%s&prop=1"|args:$equipment
|
|
|
|
shape="history"
|
|
|
|
target="_dialog"}}
|
|
|
|
{{/if}}
|
|
|
|
{{if $dispo > 0}}
|
2024-11-15 20:26:29 +01:00
|
|
|
{{:linkbutton
|
2024-11-16 10:26:48 +01:00
|
|
|
label="Sortie"
|
|
|
|
shape="plus"
|
|
|
|
href="mouvements/sorties/stock_disponible.html?key=%s&prop=1"|args:$equipment
|
|
|
|
target="_dialog"}}
|
|
|
|
{{/if}}
|
|
|
|
{{:linkbutton
|
|
|
|
label="Entrée"
|
|
|
|
shape="plus"
|
|
|
|
href="mouvements/entrees/repertorie.html?key=%s&prop=1"|args:$equipment
|
|
|
|
target="_dialog"}}
|
|
|
|
{{:linkbutton
|
|
|
|
label="Mouvements"
|
|
|
|
href="%shistorique.html?key=%s&prop=1"|args:$module.url:$equipment
|
|
|
|
shape="table"}}
|
|
|
|
{{:linkbutton
|
|
|
|
label="Modifier"
|
|
|
|
href="%smodifier_materiel.html?key=%s&prop=1"|args:$module.url:$equipment
|
|
|
|
shape="edit"
|
|
|
|
target="_dialog"}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/list}}
|
|
|
|
{{else}}
|
|
|
|
<p class="block alert">Aucun matériel.</p>
|
2023-11-17 11:15:26 +01:00
|
|
|
{{/if}}
|