Simplification calcul dispo
This commit is contained in:
parent
74ee34104f
commit
7364deda87
5 changed files with 106 additions and 120 deletions
|
|
@ -2,12 +2,28 @@
|
|||
|
||||
{{*
|
||||
inventaire des entrées/sorties des matériels permanents
|
||||
paramètres
|
||||
- category_keys : catégories dont on veut faire l'inventaire
|
||||
*}}
|
||||
|
||||
{{* Extraire et compiler les infos de la base *}}
|
||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,equipments"}}
|
||||
{{:include file="./_calcul_dispo.html" keep="categories,equipments"}}
|
||||
|
||||
{{* Sélecteur catégories *}}
|
||||
<fieldset class="shortForm" style="width: 30%;">
|
||||
<legend>Filtrer par catégorie</legend>
|
||||
<nav class="dropdown">
|
||||
<ul>
|
||||
<li><a></a></li>
|
||||
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?prop=1">Toutes les catégories</a></li>
|
||||
{{#foreach from=$categories key=key item=name}}
|
||||
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
|
||||
<a href="?cat_key={{$key}}&prop=1">
|
||||
<strong>{{$name}}</strong>
|
||||
</a>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</nav>
|
||||
</fieldset>
|
||||
|
||||
{{* Vérifier s'il y a au moins un matériel propriété de l'asso *}}
|
||||
{{:assign mat_present=false}}
|
||||
|
|
@ -20,50 +36,29 @@
|
|||
|
||||
{{if $mat_present}}
|
||||
|
||||
{{* Sélecteur catégories *}}
|
||||
<fieldset class="shortForm" style="width: 30%;">
|
||||
<legend>Filtrer par catégorie</legend>
|
||||
<nav class="dropdown">
|
||||
<ul>
|
||||
<li><a></a></li>
|
||||
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?prop=1">Toutes les catégories</a></li>
|
||||
{{#load type="category" assign="category" order="$$.name"}}
|
||||
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
|
||||
<a href="?cat_key={{$key}}&prop=1">
|
||||
<strong>{{$category.name}}</strong>
|
||||
</a>
|
||||
</li>
|
||||
{{/load}}
|
||||
</ul>
|
||||
</nav>
|
||||
</fieldset>
|
||||
|
||||
<h2>Matériels propriété de l'association</h2>
|
||||
|
||||
{{#list
|
||||
select="
|
||||
(SELECT $$.designation
|
||||
FROM @TABLE AS b
|
||||
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
|
||||
"" as 'Catégorie' ;
|
||||
$$.designation AS 'Matériel' ;
|
||||
"" AS 'Catégorie' ;
|
||||
"" AS 'Stock' ;
|
||||
"" AS 'Sorti' ;
|
||||
"" AS 'Dispo'
|
||||
"
|
||||
type="movement"
|
||||
group="$$.equipment"
|
||||
direction="input"
|
||||
type="equipment"
|
||||
order=1
|
||||
}}
|
||||
{{:assign var=eqpmt_key value=$key}}
|
||||
{{:assign var=cat_key value=$category}}
|
||||
{{:assign var=cat_name from=categories.%s|args:$cat_key}}
|
||||
|
||||
{{:assign var=cat_key from="equipments.%s.category"|args:$equipment}}
|
||||
{{if $_GET.cat_key != null && $_GET.cat_key != $cat_key}}
|
||||
{{:continue}}
|
||||
{{/if}}
|
||||
|
||||
{{: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 var=stock from="equipments.%s.stock"|args:$eqpmt_key}}
|
||||
{{:assign var=exterieur from="equipments.%s.exterieur"|args:$eqpmt_key}}
|
||||
{{:assign dispo="%d-%d"|math:$stock:$exterieur}}
|
||||
|
||||
{{if $stock == null}}
|
||||
|
|
@ -71,7 +66,7 @@
|
|||
{{/if}}
|
||||
|
||||
<tr>
|
||||
<td>{{$col1}}</td>
|
||||
<td>{{$designation}}</td>
|
||||
<td>{{$cat_name}}</td>
|
||||
<td>{{$stock}}</td>
|
||||
<td>{{if $exterieur == null}}0{{else}}{{$exterieur}}{{/if}}</td>
|
||||
|
|
@ -80,7 +75,7 @@
|
|||
{{if $exterieur > 0}}
|
||||
{{:linkbutton
|
||||
label="Retour"
|
||||
href="mouvements/entrees/retour.html?key=%s"|args:$equipment
|
||||
href="mouvements/entrees/retour.html?key=%s"|args:$eqpmt_key
|
||||
shape="history"
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
|
|
@ -88,21 +83,21 @@
|
|||
{{:linkbutton
|
||||
label="Sortie"
|
||||
shape="plus"
|
||||
href="mouvements/sorties/stock_disponible.html?key=%s"|args:$equipment
|
||||
href="mouvements/sorties/stock_disponible.html?key=%s"|args:$eqpmt_key
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
{{:linkbutton
|
||||
label="Entrée"
|
||||
shape="plus"
|
||||
href="mouvements/entrees/repertorie.html?key=%s"|args:$equipment
|
||||
href="mouvements/entrees/repertorie.html?key=%s"|args:$eqpmt_key
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Mouvements"
|
||||
href="historique.html?key=%s&prop=1"|args:$equipment
|
||||
href="historique.html?key=%s&prop=1"|args:$eqpmt_key
|
||||
shape="table"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="modifier_materiel.html?key=%s&prop=1"|args:$equipment
|
||||
href="modifier_materiel.html?key=%s&prop=1"|args:$eqpmt_key
|
||||
shape="edit"
|
||||
target="_dialog"}}
|
||||
</td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue