Filtrage inventaire par catégorie
This commit is contained in:
parent
ea0fd3b1a2
commit
8305433f5b
162
inventaire.html
162
inventaire.html
@ -23,105 +23,91 @@
|
||||
{{/foreach}}
|
||||
|
||||
{{* TODO Sélecteur catégories *}}
|
||||
<fieldset class="shortFormRight">
|
||||
<fieldset class="shortForm" style="width: 30%;">
|
||||
<legend>Filtrer par catégorie</legend>
|
||||
<nav class="dropdown">
|
||||
<ul>
|
||||
<li><a></a></li>
|
||||
<li><a href=""><strong>Audiovisuel</strong></a></li>
|
||||
<li><a href=""><strong>Informatique</strong></a></li>
|
||||
<li><a href=""><strong>Mobilier</strong></a></li>
|
||||
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?">Choisir une catégorie</a></li>
|
||||
{{#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}}
|
||||
</ul>
|
||||
</nav>
|
||||
</fieldset>
|
||||
|
||||
{{if $mat_prop}}
|
||||
<h2>Matériels dont l'association est propriétaire</h2>
|
||||
<fieldset>
|
||||
{{* itérer sur les catégories *}}
|
||||
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
||||
<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 'Sortie' ;
|
||||
"" AS 'Dispo'
|
||||
"
|
||||
type="movement"
|
||||
group="$$.equipment"
|
||||
direction="input"
|
||||
order=2
|
||||
}}
|
||||
|
||||
{{* 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}}
|
||||
{{:assign var=cat_key from="equipments.%s.category"|args:$equipment}}
|
||||
{{if $_GET.cat_key != null && $_GET.cat_key != $cat_key}}
|
||||
{{:continue}}
|
||||
{{/if}}
|
||||
|
||||
{{if $present}}
|
||||
<h3>{{$cat_elem.name}}</h3>
|
||||
{{: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*}}
|
||||
<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}}
|
||||
{{:linkbutton
|
||||
label="Retour"
|
||||
href="mouvements/entrees/retour.html?key=%s&prop=1"|args:$equipment
|
||||
shape="history"
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
{{if $dispo > 0}}
|
||||
{{:linkbutton
|
||||
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}}
|
||||
|
||||
<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">
|
||||
{{if $exterieur > 0}}
|
||||
{{:linkbutton
|
||||
label="Retour"
|
||||
href="mouvements/entrees/retour.html?key=%s&prop=1"|args:$eqpmt_key
|
||||
shape="history"
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
{{if $dispo > 0}}
|
||||
{{:linkbutton
|
||||
label="Sortie"
|
||||
shape="plus"
|
||||
href="mouvements/sorties/stock_disponible.html?key=%s&prop=1"|args:$eqpmt_key
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
{{:linkbutton
|
||||
label="Entrée"
|
||||
shape="plus"
|
||||
href="mouvements/entrees/repertorie.html?key=%s&prop=1"|args:$eqpmt_key
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Mouvements"
|
||||
href="%shistorique.html?key=%s&prop=1"|args:$module.url:$eqpmt_key
|
||||
shape="table"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="%smodifier_materiel.html?key=%s&prop=1"|args:$module.url:$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>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</fieldset>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
Loading…
Reference in New Issue
Block a user