Réorganisation module
This commit is contained in:
parent
84fb29c15d
commit
553cbdf978
21 changed files with 718 additions and 201 deletions
262
inventaire.html
262
inventaire.html
|
|
@ -2,10 +2,15 @@
|
|||
|
||||
{{* inventaire des entrées/sorties des matériels des catégories de la variable category_keys *}}
|
||||
|
||||
<fieldset>
|
||||
{{:linkbutton label="Ajouter un nouveau matériel" shape="plus" href="mouvements/ajouter_entree.html" target="_dialog"}}
|
||||
</fieldset>
|
||||
|
||||
{{* Extraire et compiler les infos de la base *}}
|
||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
||||
|
||||
{{* Afficher les résultats *}}
|
||||
|
||||
{{if $equipments === null}}
|
||||
<p class="block alert">Aucun matériel.</p>
|
||||
{{else}}
|
||||
|
|
@ -13,147 +18,150 @@
|
|||
<summary>
|
||||
<h2>Matériels dont l'association est propriétaire</h2>
|
||||
</summary>
|
||||
<fieldset>
|
||||
|
||||
{{* itérer sur les catégories *}}
|
||||
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
||||
{{* itérer sur les catégories *}}
|
||||
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
||||
|
||||
{{* 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}}
|
||||
{{/if}}
|
||||
|
||||
{{if $present}}
|
||||
{{if $print_cat_name}}
|
||||
<details class="inventaire" open="open">
|
||||
<summary>
|
||||
<h3>{{$cat_elem.name}}</h3>
|
||||
{{/if}}
|
||||
</summary>
|
||||
|
||||
<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>
|
||||
|
||||
{{* 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}}
|
||||
{{* 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}}
|
||||
<tr>
|
||||
<td>{{$eqpmt.designation}}</td>
|
||||
<td>{{$eqpmt.stock}}</td>
|
||||
<td>{{$exterieur}}</td>
|
||||
<td>{{$dispo}}</td>
|
||||
<td class="actions">
|
||||
{{:linkbutton
|
||||
label="Mouvements"
|
||||
href="%shistorique.html?key=%s&prop=1"|args:$module.url:$eqpmt_key
|
||||
shape="table"
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="%smodifier_materiel.html?key=%s"|args:$module.url:$eqpmt_key
|
||||
shape="edit"
|
||||
target="_dialog"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
||||
{{if $present}}
|
||||
{{if $print_cat_name}}
|
||||
<details class="inventaire" open="open">
|
||||
<summary>
|
||||
<h3>{{$cat_elem.name}}</h3>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
</details>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</summary>
|
||||
|
||||
<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>
|
||||
|
||||
{{* 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">
|
||||
{{:linkbutton
|
||||
label="Mouvements"
|
||||
href="historique.html?key=%s&prop=1"|args:$eqpmt_key
|
||||
shape="table"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="modifier_materiel.html?key=%s"|args:$eqpmt_key
|
||||
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>
|
||||
|
||||
<details class="inventaire" open="open">
|
||||
<summary>
|
||||
<h2>Matériels dont l'association n'est pas propriétaire</h2>
|
||||
</summary>
|
||||
<fieldset>
|
||||
|
||||
{{* itérer sur les catégories *}}
|
||||
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
||||
{{* itérer sur les catégories *}}
|
||||
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
||||
|
||||
{{* 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}}
|
||||
|
||||
{{if $present}}
|
||||
{{if $print_cat_name}}
|
||||
<details class="inventaire" open="open">
|
||||
<summary>
|
||||
<h3>{{$cat_elem.name}}</h3>
|
||||
{{* 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}}
|
||||
</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">
|
||||
{{:linkbutton
|
||||
label="Mouvements"
|
||||
href="%shistorique.html?key=%s"|args:$module.url:$eqpmt_key
|
||||
shape="table"
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="%smodifier_materiel.html?key=%s"|args:$module.url:$eqpmt_key
|
||||
shape="edit"
|
||||
target="_dialog"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{if $present}}
|
||||
{{if $print_cat_name}}
|
||||
<details class="inventaire" open="open">
|
||||
<summary>
|
||||
<h3>{{$cat_elem.name}}</h3>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
</details>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</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">
|
||||
{{:linkbutton
|
||||
label="Mouvements"
|
||||
href="historique.html?key=%s"|args:$eqpmt_key
|
||||
shape="table"
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="modifier_materiel.html?key=%s"|args:$eqpmt_key
|
||||
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}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue