inventaire : amélioration cas 0 matériel
This commit is contained in:
parent
58c9de9870
commit
4d0bcc1bdd
161
inventaire.html
161
inventaire.html
@ -1,7 +1,7 @@
|
|||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
inventaire des entrées/sorties des matériels permanents de l'association
|
inventaire des entrées/sorties des matériels permanents
|
||||||
paramètres
|
paramètres
|
||||||
- category_keys : catégories dont on veut faire l'inventaire
|
- category_keys : catégories dont on veut faire l'inventaire
|
||||||
*}}
|
*}}
|
||||||
@ -9,18 +9,16 @@
|
|||||||
{{* Extraire et compiler les infos de la base *}}
|
{{* Extraire et compiler les infos de la base *}}
|
||||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
||||||
|
|
||||||
{{* Afficher les résultats *}}
|
{{* Vérifier s'il y a au moins un matériel propriété de l'asso *}}
|
||||||
{{if $equipments === null}}
|
{{:assign mat_prop=false}}
|
||||||
<p class="block alert">Aucun matériel.</p>
|
{{#foreach from=$equipments key=key item=eqpmt}}
|
||||||
{{else}}
|
{{if $eqpmt|has_key:"stock"}}
|
||||||
{{* Vérifier s'il y a au moins un matériel propriété de l'asso *}}
|
{{:assign mat_prop=true}}
|
||||||
{{:assign mat_prop=false}}
|
{{:break}}
|
||||||
{{#foreach from=$equipments key=key item=eqpmt}}
|
{{/if}}
|
||||||
{{if $eqpmt|has_key:"stock"}}
|
{{/foreach}}
|
||||||
{{:assign mat_prop=true}}
|
|
||||||
{{:break}}
|
{{if $mat_prop}}
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
{{* Sélecteur catégories *}}
|
{{* Sélecteur catégories *}}
|
||||||
<fieldset class="shortForm" style="width: 30%;">
|
<fieldset class="shortForm" style="width: 30%;">
|
||||||
@ -28,7 +26,7 @@
|
|||||||
<nav class="dropdown">
|
<nav class="dropdown">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a></a></li>
|
<li><a></a></li>
|
||||||
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?">Choisir une catégorie</a></li>
|
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?">Toutes les catégories</a></li>
|
||||||
{{#load type="category" assign="category"}}
|
{{#load type="category" assign="category"}}
|
||||||
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
|
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
|
||||||
<a href="?cat_key={{$key}}">
|
<a href="?cat_key={{$key}}">
|
||||||
@ -40,73 +38,78 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
{{if $mat_prop}}
|
<h2>Matériels propriété de l'association</h2>
|
||||||
<h2>Matériels propriété de l'association</h2>
|
{{#list
|
||||||
{{#list
|
select="
|
||||||
select="
|
$$.date AS 'Date' ;
|
||||||
$$.date AS 'Date' ;
|
(SELECT $$.designation
|
||||||
(SELECT $$.designation
|
FROM @TABLE AS b
|
||||||
FROM @TABLE AS b
|
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
|
||||||
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
|
"" as 'Catégorie' ;
|
||||||
"" as 'Catégorie' ;
|
"" AS 'Stock' ;
|
||||||
"" AS 'Stock' ;
|
"" AS 'Sorti' ;
|
||||||
"" AS 'Sortie' ;
|
"" AS 'Dispo'
|
||||||
"" AS 'Dispo'
|
"
|
||||||
"
|
type="movement"
|
||||||
type="movement"
|
group="$$.equipment"
|
||||||
group="$$.equipment"
|
direction="input"
|
||||||
direction="input"
|
order=2
|
||||||
order=2
|
}}
|
||||||
}}
|
|
||||||
|
|
||||||
{{:assign var=cat_key from="equipments.%s.category"|args:$equipment}}
|
{{:assign var=cat_key from="equipments.%s.category"|args:$equipment}}
|
||||||
{{if $_GET.cat_key != null && $_GET.cat_key != $cat_key}}
|
{{if $_GET.cat_key != null && $_GET.cat_key != $cat_key}}
|
||||||
{{:continue}}
|
{{:continue}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:assign var=cat_name from="cumul_mvt.%s.name"|args:$cat_key}}
|
{{:assign var=cat_name from="cumul_mvt.%s.name"|args:$cat_key}}
|
||||||
{{:assign var=stock from="equipments.%s.stock"|args:$equipment}}
|
{{:assign var=stock from="equipments.%s.stock"|args:$equipment}}
|
||||||
{{:assign var=exterieur from="equipments.%s.exterieur"|args:$equipment}}
|
{{:assign var=exterieur from="equipments.%s.exterieur"|args:$equipment}}
|
||||||
{{:assign dispo="%d-%d"|math:$stock:$exterieur}}
|
{{:assign dispo="%d-%d"|math:$stock:$exterieur}}
|
||||||
{{*:debug stock=$stock exterieur=$exterieur dispo=$dispo*}}
|
{{*:debug stock=$stock exterieur=$exterieur dispo=$dispo*}}
|
||||||
<tr>
|
|
||||||
<td>{{$date|date_short}}</td>
|
{{if $stock == null}}
|
||||||
<td>{{$col2}}</td>
|
{{:continue}}
|
||||||
<td>{{$cat_name}}</td>
|
{{/if}}
|
||||||
<td>{{$stock}}</td>
|
|
||||||
<td>{{if $exterieur == null}}0{{else}}{{$exterieur}}{{/if}}</td>
|
<tr>
|
||||||
<td>{{$dispo}}</td>
|
<td>{{$date|date_short}}</td>
|
||||||
<td class="actions">
|
<td>{{$col2}}</td>
|
||||||
{{if $exterieur > 0}}
|
<td>{{$cat_name}}</td>
|
||||||
{{:linkbutton
|
<td>{{$stock}}</td>
|
||||||
label="Retour"
|
<td>{{if $exterieur == null}}0{{else}}{{$exterieur}}{{/if}}</td>
|
||||||
href="mouvements/entrees/retour.html?key=%s&prop=1"|args:$equipment
|
<td>{{$dispo}}</td>
|
||||||
shape="history"
|
<td class="actions">
|
||||||
target="_dialog"}}
|
{{if $exterieur > 0}}
|
||||||
{{/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
|
{{:linkbutton
|
||||||
label="Entrée"
|
label="Retour"
|
||||||
shape="plus"
|
href="mouvements/entrees/retour.html?key=%s&prop=1"|args:$equipment
|
||||||
href="mouvements/entrees/repertorie.html?key=%s&prop=1"|args:$equipment
|
shape="history"
|
||||||
target="_dialog"}}
|
target="_dialog"}}
|
||||||
|
{{/if}}
|
||||||
|
{{if $dispo > 0}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Mouvements"
|
label="Sortie"
|
||||||
href="%shistorique.html?key=%s&prop=1"|args:$module.url:$equipment
|
shape="plus"
|
||||||
shape="table"}}
|
href="mouvements/sorties/stock_disponible.html?key=%s&prop=1"|args:$equipment
|
||||||
{{:linkbutton
|
target="_dialog"}}
|
||||||
label="Modifier"
|
{{/if}}
|
||||||
href="%smodifier_materiel.html?key=%s&prop=1"|args:$module.url:$equipment
|
{{:linkbutton
|
||||||
shape="edit"
|
label="Entrée"
|
||||||
target="_dialog"}}
|
shape="plus"
|
||||||
</td>
|
href="mouvements/entrees/repertorie.html?key=%s&prop=1"|args:$equipment
|
||||||
</tr>
|
target="_dialog"}}
|
||||||
{{/list}}
|
{{:linkbutton
|
||||||
{{/if}}
|
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>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -9,31 +9,29 @@
|
|||||||
{{:admin_header title="Gestion des matériels" custom_css=$custom_css current="module_equipment"}}
|
{{:admin_header title="Gestion des matériels" custom_css=$custom_css current="module_equipment"}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{:include file="_nav.html" current="index" subcurrent="nonproprio"}}
|
{{:include file="_nav.html" current="inventaire" subcurrent="nonproprio"}}
|
||||||
|
|
||||||
{{* Extraire et compiler les infos de la base *}}
|
{{* Extraire et compiler les infos de la base *}}
|
||||||
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
{{:include file="./_calcul_dispo.html" keep="cumul_mvt,category_keys,equipments"}}
|
||||||
|
|
||||||
{{* Afficher les résultats *}}
|
{{* Vérifier s'il y a au moins un matériel non propriété de l'asso *}}
|
||||||
{{if $equipments === null}}
|
{{:assign mat_non_prop=false}}
|
||||||
<p class="block alert">Aucun matériel.</p>
|
{{#foreach from=$equipments key=key item=eqpmt}}
|
||||||
{{else}}
|
{{if $eqpmt|has_key:"nonproprio"}}
|
||||||
{{* Vérifier s'il y a au moins un matériel non propriété de l'asso *}}
|
{{:assign mat_non_prop=true}}
|
||||||
{{:assign mat_non_prop=false}}
|
{{:break}}
|
||||||
{{#foreach from=$equipments key=key item=eqpmt}}
|
{{/if}}
|
||||||
{{if $eqpmt|has_key:"nonproprio"}}
|
{{/foreach}}
|
||||||
{{:assign mat_non_prop=true}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
{{* TODO Sélecteur catégories *}}
|
{{if $mat_non_prop}}
|
||||||
|
|
||||||
|
{{* Sélecteur catégories *}}
|
||||||
<fieldset class="shortForm" style="width: 30%;">
|
<fieldset class="shortForm" style="width: 30%;">
|
||||||
<legend>Filtrer par catégorie</legend>
|
<legend>Filtrer par catégorie</legend>
|
||||||
<nav class="dropdown">
|
<nav class="dropdown">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a></a></li>
|
<li><a></a></li>
|
||||||
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?">Choisir une catégorie</a></li>
|
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?">Toutes les catégories</a></li>
|
||||||
{{#load type="category" assign="category"}}
|
{{#load type="category" assign="category"}}
|
||||||
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
|
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
|
||||||
<a href="?cat_key={{$key}}">
|
<a href="?cat_key={{$key}}">
|
||||||
@ -45,64 +43,64 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
{{if $mat_non_prop}}
|
<h2>Matériels temporairement dans l'association</h2>
|
||||||
<h2>Matériels temporairement dans l'association</h2>
|
|
||||||
|
|
||||||
{{#list
|
{{#list
|
||||||
select="
|
select="
|
||||||
$$.date AS 'Date' ;
|
$$.date AS 'Date' ;
|
||||||
(SELECT $$.designation
|
(SELECT $$.designation
|
||||||
FROM @TABLE AS b
|
FROM @TABLE AS b
|
||||||
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
|
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
|
||||||
"" as 'Catégorie' ;
|
"" as 'Catégorie' ;
|
||||||
"" AS 'Quantité'
|
"" AS 'Quantité'
|
||||||
"
|
"
|
||||||
type="movement"
|
type="movement"
|
||||||
group="$$.equipment"
|
group="$$.equipment"
|
||||||
direction="input"
|
direction="input"
|
||||||
order=2
|
order=2
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{:assign var=cat_key from="equipments.%s.category"|args:$equipment}}
|
{{:assign var=cat_key from="equipments.%s.category"|args:$equipment}}
|
||||||
{{if $_GET.cat_key != null && $_GET.cat_key != $cat_key}}
|
{{if $_GET.cat_key != null && $_GET.cat_key != $cat_key}}
|
||||||
{{:continue}}
|
{{:continue}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:assign var=cat_name from="cumul_mvt.%s.name"|args:$cat_key}}
|
{{:assign var=cat_name from="cumul_mvt.%s.name"|args:$cat_key}}
|
||||||
{{:assign var=qte from="equipments.%s.nonproprio"|args:$equipment}}
|
{{:assign var=qte from="equipments.%s.nonproprio"|args:$equipment}}
|
||||||
|
|
||||||
{{if $qte == null}}
|
{{if $qte == null}}
|
||||||
{{:continue}}
|
{{:continue}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{$date|date_short}}</td>
|
<td>{{$date|date_short}}</td>
|
||||||
<td>{{$col2}}</td>
|
<td>{{$col2}}</td>
|
||||||
<td>{{$cat_name}}</td>
|
<td>{{$cat_name}}</td>
|
||||||
<td>{{$qte}}</td>
|
<td>{{$qte}}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{{if $qte > 0}}
|
{{if $qte > 0}}
|
||||||
{{:linkbutton
|
|
||||||
label="Retour"
|
|
||||||
href="mouvements/sorties/emprunte.html?key=%s&prop=0"|args:$equipment
|
|
||||||
shape="history"
|
|
||||||
target="_dialog"}}
|
|
||||||
{{/if}}
|
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Entrée"
|
label="Retour"
|
||||||
shape="plus"
|
href="mouvements/sorties/emprunte.html?key=%s&prop=0"|args:$equipment
|
||||||
href="mouvements/entrees/repertorie.html?key=%s&prop=0"|args:$equipment
|
shape="history"
|
||||||
target="_dialog"}}
|
target="_dialog"}}
|
||||||
{{:linkbutton
|
{{/if}}
|
||||||
label="Mouvements"
|
{{:linkbutton
|
||||||
href="%shistorique.html?key=%s&prop=0"|args:$module.url:$equipment
|
label="Entrée"
|
||||||
shape="table"}}
|
shape="plus"
|
||||||
{{:linkbutton
|
href="mouvements/entrees/repertorie.html?key=%s&prop=0"|args:$equipment
|
||||||
label="Modifier"
|
target="_dialog"}}
|
||||||
href="modifier_materiel.html?key=%s&prop=0"|args:$equipment
|
{{:linkbutton
|
||||||
shape="edit"
|
label="Mouvements"
|
||||||
target="_dialog"}}
|
href="%shistorique.html?key=%s&prop=0"|args:$module.url:$equipment
|
||||||
</td>
|
shape="table"}}
|
||||||
</tr>
|
{{:linkbutton
|
||||||
{{/list}}
|
label="Modifier"
|
||||||
{{/if}}
|
href="modifier_materiel.html?key=%s&prop=0"|args:$equipment
|
||||||
|
shape="edit"
|
||||||
|
target="_dialog"}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/list}}
|
||||||
|
{{else}}
|
||||||
|
<p class="block alert">Aucun matériel.</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
Loading…
Reference in New Issue
Block a user