2024-03-26 17:58:24 +01:00
|
|
|
{{* -*- brindille -*- *}}
|
|
|
|
|
2023-12-07 20:30:32 +01:00
|
|
|
{{* inventaire des entrées/sorties des matériels des catégories de la variable category_keys *}}
|
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
|
|
|
|
|
|
|
{{* Afficher les résultats *}}
|
2024-03-26 17:58:24 +01:00
|
|
|
{{if $equipments === null}}
|
2024-10-24 10:15:56 +02:00
|
|
|
<p class="block alert">Aucun matériel.</p>
|
2023-11-17 11:15:26 +01:00
|
|
|
{{else}}
|
2024-10-29 14:56:05 +01:00
|
|
|
{{* Vérifier s'il y a au moins un matériel propriété ou non de l'asso *}}
|
|
|
|
{{:assign mat_prop=false}}
|
|
|
|
{{:assign mat_non_prop=false}}
|
|
|
|
{{#foreach from=$equipments key=key item=eqpmt}}
|
|
|
|
{{if $eqpmt|has_key:"stock"}}
|
|
|
|
{{:assign mat_prop=true}}
|
|
|
|
{{/if}}
|
|
|
|
{{if $eqpmt|has_key:"nonproprio"}}
|
|
|
|
{{:assign mat_non_prop=true}}
|
|
|
|
{{/if}}
|
|
|
|
{{/foreach}}
|
2023-12-06 09:59:11 +01:00
|
|
|
|
2024-10-29 14:56:05 +01:00
|
|
|
{{if $mat_prop}}
|
|
|
|
<details class="inventaire" open="open">
|
|
|
|
<summary>
|
|
|
|
<h2>Matériels dont l'association est propriétaire</h2>
|
|
|
|
</summary>
|
2023-12-07 17:33:49 +01:00
|
|
|
|
2024-10-29 14:56:05 +01:00
|
|
|
<fieldset>
|
|
|
|
{{* itérer sur les catégories *}}
|
|
|
|
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
2024-10-28 09:53:29 +01:00
|
|
|
|
2024-10-29 14:56:05 +01:00
|
|
|
{{* vérifier s'il y a des matériels dans cette catégorie *}}
|
|
|
|
{{:assign present=false}}
|
|
|
|
{{if $cat_elem|keys|has:"eqpmt"}}
|
|
|
|
{{#foreach from=$cat_elem.eqpmt key="eqpmt_key" item="eqpmt"}}
|
|
|
|
{{if $eqpmt.stock !== null && $eqpmt.stock !== 0}}
|
|
|
|
{{:assign present=true}}
|
|
|
|
{{:break}}
|
|
|
|
{{/if}}
|
|
|
|
{{/foreach}}
|
2024-10-24 10:15:56 +02:00
|
|
|
{{/if}}
|
2024-10-28 09:53:29 +01:00
|
|
|
|
2024-10-29 14:56:05 +01:00
|
|
|
{{if $present}}
|
2024-11-08 19:49:23 +01:00
|
|
|
{{*if $print_cat_name*}}
|
2024-10-29 14:56:05 +01:00
|
|
|
<details class="inventaire" open="open">
|
|
|
|
<summary>
|
|
|
|
<h3>{{$cat_elem.name}}</h3>
|
2024-11-08 19:49:23 +01:00
|
|
|
{{*/if*}}
|
2024-10-29 14:56:05 +01:00
|
|
|
</summary>
|
2023-12-06 09:59:11 +01:00
|
|
|
|
2024-10-29 14:56:05 +01:00
|
|
|
<table class="list">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Désignation</th>
|
|
|
|
<th>Stock</th>
|
|
|
|
<th>Sortie</th>
|
|
|
|
<th>Disponible</th>
|
|
|
|
<th class="actions"></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2023-12-06 09:59:11 +01:00
|
|
|
|
2024-10-29 14:56:05 +01:00
|
|
|
{{* 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 "stock"|in:$keys}} {{* && $eqpmt.stock !== 0}}*}}
|
|
|
|
{{if "exterieur"|in:$keys}}
|
|
|
|
{{:assign dispo="%d-%d"|math:$eqpmt.stock:$eqpmt.exterieur}}
|
|
|
|
{{:assign exterieur=$eqpmt.exterieur}}
|
|
|
|
{{else}}
|
|
|
|
{{:assign dispo=$eqpmt.stock}}
|
|
|
|
{{:assign exterieur=0}}
|
|
|
|
{{/if}}
|
|
|
|
<tr>
|
|
|
|
<td>{{$eqpmt.designation}}</td>
|
|
|
|
<td>{{$eqpmt.stock}}</td>
|
|
|
|
<td>{{$exterieur}}</td>
|
|
|
|
<td>{{$dispo}}</td>
|
|
|
|
<td class="actions">
|
2024-11-09 09:58:50 +01:00
|
|
|
{{if $dispo > 0}}
|
|
|
|
{{:linkbutton
|
|
|
|
label="Sortie"
|
|
|
|
shape="plus"
|
|
|
|
href="mouvements/sorties/stock_disponible.html?key=%s&prop=1"|args:$eqpmt_key
|
|
|
|
target="_dialog"}}
|
|
|
|
{{/if}}
|
2024-11-08 19:49:23 +01:00
|
|
|
{{:linkbutton
|
2024-11-09 09:58:50 +01:00
|
|
|
label="Entrée"
|
2024-11-08 19:49:23 +01:00
|
|
|
shape="plus"
|
2024-11-09 09:58:50 +01:00
|
|
|
href="mouvements/entrees/repertorie.html?key=%s&prop=1"|args:$eqpmt_key
|
2024-11-08 19:49:23 +01:00
|
|
|
target="_dialog"}}
|
2024-10-29 14:56:05 +01:00
|
|
|
{{:linkbutton
|
|
|
|
label="Mouvements"
|
|
|
|
href="%shistorique.html?key=%s&prop=1"|args:$module.url:$eqpmt_key
|
|
|
|
shape="table"}}
|
|
|
|
{{:linkbutton
|
|
|
|
label="Modifier"
|
2024-11-09 09:58:50 +01:00
|
|
|
href="%smodifier_materiel.html?key=%s&prop=1"|args:$module.url:$eqpmt_key
|
2024-10-29 14:56:05 +01:00
|
|
|
shape="edit"
|
|
|
|
target="_dialog"}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/if}}
|
|
|
|
{{else}}
|
|
|
|
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
|
|
|
{{/foreach}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</details>
|
|
|
|
{{/if}}
|
|
|
|
{{/foreach}}
|
|
|
|
</fieldset>
|
|
|
|
</details>
|
|
|
|
{{/if}}
|
2023-12-07 17:33:49 +01:00
|
|
|
|
2024-10-29 14:56:05 +01:00
|
|
|
{{if $mat_non_prop}}
|
|
|
|
<details class="inventaire" open="open">
|
|
|
|
<summary>
|
|
|
|
<h2>Matériels dont l'association n'est pas propriétaire</h2>
|
|
|
|
</summary>
|
2024-10-28 09:53:29 +01:00
|
|
|
|
2024-10-29 14:56:05 +01:00
|
|
|
<fieldset>
|
|
|
|
{{* itérer sur les catégories *}}
|
|
|
|
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
2024-10-28 09:53:29 +01:00
|
|
|
|
2024-10-29 14:56:05 +01:00
|
|
|
{{* vérifier s'il y a des matériels dans cette catégorie *}}
|
|
|
|
{{:assign present=false}}
|
|
|
|
{{if $cat_elem|keys|has:"eqpmt"}}
|
|
|
|
{{#foreach from=$cat_elem.eqpmt key="eqpmt_key" item="eqpmt"}}
|
|
|
|
{{if $eqpmt.nonproprio !== null && $eqpmt.nonproprio !== 0}}
|
|
|
|
{{:assign present=true}}
|
|
|
|
{{:break}}
|
|
|
|
{{/if}}
|
|
|
|
{{/foreach}}
|
|
|
|
{{/if}}
|
2024-10-28 09:53:29 +01:00
|
|
|
|
2024-10-29 14:56:05 +01:00
|
|
|
{{if $present}}
|
2024-11-08 19:49:23 +01:00
|
|
|
{{*if $print_cat_name*}}
|
2024-10-29 14:56:05 +01:00
|
|
|
<details class="inventaire" open="open">
|
|
|
|
<summary>
|
|
|
|
<h3>{{$cat_elem.name}}</h3>
|
2024-11-08 19:49:23 +01:00
|
|
|
{{*/if*}}
|
2024-10-29 14:56:05 +01:00
|
|
|
</summary>
|
|
|
|
|
|
|
|
<table class="list">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Désignation</th>
|
|
|
|
<th>Quantité</th>
|
|
|
|
<th class="actions"></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
{{* 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}}
|
|
|
|
<tr>
|
|
|
|
<td>{{$eqpmt.designation}}</td>
|
|
|
|
<td>{{$eqpmt.nonproprio}}</td>
|
|
|
|
<td class="actions">
|
2024-11-09 09:58:50 +01:00
|
|
|
{{if $eqpmt.nonproprio > 0}}
|
|
|
|
{{:linkbutton
|
|
|
|
label="Retour"
|
|
|
|
href="mouvements/sorties/emprunte.html?key=%s&prop=0"|args:$mvt_key
|
|
|
|
shape="history"
|
|
|
|
target="_dialog"}}
|
|
|
|
{{/if}}
|
2024-11-08 19:49:23 +01:00
|
|
|
{{:linkbutton
|
2024-11-09 09:58:50 +01:00
|
|
|
label="Entrée"
|
2024-11-08 19:49:23 +01:00
|
|
|
shape="plus"
|
2024-11-09 09:58:50 +01:00
|
|
|
href="mouvements/entrees/repertorie.html?key=%s&prop=0"|args:$eqpmt_key
|
2024-11-08 19:49:23 +01:00
|
|
|
target="_dialog"}}
|
2024-10-29 14:56:05 +01:00
|
|
|
{{:linkbutton
|
|
|
|
label="Mouvements"
|
2024-11-09 09:58:50 +01:00
|
|
|
href="historique.html?key=%s&prop=0"|args:$eqpmt_key
|
2024-10-29 14:56:05 +01:00
|
|
|
shape="table"
|
|
|
|
target="_dialog"}}
|
|
|
|
{{:linkbutton
|
|
|
|
label="Modifier"
|
2024-11-09 09:58:50 +01:00
|
|
|
href="modifier_materiel.html?key=%s&prop=0"|args:$eqpmt_key
|
2024-10-29 14:56:05 +01:00
|
|
|
shape="edit"
|
|
|
|
target="_dialog"}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/if}}
|
|
|
|
{{else}}
|
|
|
|
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
|
|
|
{{/foreach}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</details>
|
|
|
|
{{/if}}
|
|
|
|
{{/foreach}}
|
|
|
|
</fieldset>
|
|
|
|
</details>
|
|
|
|
{{/if}}
|
2023-11-17 11:15:26 +01:00
|
|
|
{{/if}}
|