Compare commits

...

2 Commits

5 changed files with 162 additions and 158 deletions

View File

@ -1,21 +1,21 @@
<nav class="tabs">
{{if $current == 'index'}}
{{if $current == 'inventaire'}}
<aside>
{{:linkbutton label="Ajouter un nouveau matériel" shape="plus" href="mouvements/ajouter_entree.html" target="_dialog"}}
</aside>
{{/if}}
<ul>
<li {{if $current == 'index'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Inventaire</a></li>
<li {{if $current == 'inventaire'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Inventaire</a></li>
<li {{if $current == 'config'}} class="current"{{/if}}><a href="{{$module.url}}categories/index.html">Configuration</a></li>
</ul>
{{if $current == 'index'}}
{{if $current == 'inventaire'}}
<ul class="sub">
<li {{if $subcurrent == 'proprio'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Matériel permanent</a></li>
<li {{if $subcurrent == 'nonproprio'}} class="current"{{/if}}><a href="{{$module.url}}inventaire_nonprop.html">Matériel temporaire</a></li>
<li {{if $subcurrent == 'proprio'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Matériels permanents</a></li>
<li {{if $subcurrent == 'nonproprio'}} class="current"{{/if}}><a href="{{$module.url}}inventaire_nonprop.html">Matériels temporaires</a></li>
</ul>
{{if $subcurrent == 'mouvements'}}
{{if $subsubcurrent == 'mouvements'}}
<ul class="sub">
<li class="title"><strong>{{$eqpmt}} ({{$category}})</strong></li>
<li class="current"><a>Mouvements</a></li>

View File

@ -39,9 +39,12 @@
{{/if}}
{{* barre de navigation *}}
{{if ! $dialog}}
{{:include file="./_nav.html" current="index" subcurrent="mouvements" eqpmt=$equipment.designation category=$category.name}}
{{if $_GET.prop == 1}}
{{:assign proprio="proprio"}}
{{else}}
{{:assign proprio="nonproprio"}}
{{/if}}
{{:include file="./_nav.html" current="inventaire" subcurrent=$proprio subsubcurrent="mouvements" eqpmt=$equipment.designation category=$category.name}}
{{* récupérer la config des entrées/sorties *}}
{{:include file="./_get_config.html" keep="config"}}

View File

@ -3,7 +3,7 @@
{{:admin_header title="Gestion des matériels" custom_css=$custom_css current="module_equipment"}}
{{* barre de navigation *}}
{{:include file="_nav.html" current="index" subcurrent="proprio"}}
{{:include file="_nav.html" current="inventaire" subcurrent="proprio"}}
{{if $_GET.ok}}
{{if $_GET.msg == "ajout" }}

View File

@ -1,7 +1,7 @@
{{* -*- brindille -*- *}}
{{*
inventaire des entrées/sorties des matériels permanents de l'association
inventaire des entrées/sorties des matériels permanents
paramètres
- category_keys : catégories dont on veut faire l'inventaire
*}}
@ -9,18 +9,16 @@
{{* 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}}
{{* Vérifier s'il y a au moins un matériel propriété de l'asso *}}
{{:assign mat_prop=false}}
{{#foreach from=$equipments key=key item=eqpmt}}
{{if $eqpmt|has_key:"stock"}}
{{:assign mat_prop=true}}
{{:break}}
{{/if}}
{{/foreach}}
{{* Vérifier s'il y a au moins un matériel propriété de l'asso *}}
{{:assign mat_prop=false}}
{{#foreach from=$equipments key=key item=eqpmt}}
{{if $eqpmt|has_key:"stock"}}
{{:assign mat_prop=true}}
{{:break}}
{{/if}}
{{/foreach}}
{{if $mat_prop}}
{{* Sélecteur catégories *}}
<fieldset class="shortForm" style="width: 30%;">
@ -28,7 +26,7 @@
<nav class="dropdown">
<ul>
<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"}}
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
<a href="?cat_key={{$key}}">
@ -40,73 +38,78 @@
</nav>
</fieldset>
{{if $mat_prop}}
<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
}}
<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 'Sorti' ;
"" AS 'Dispo'
"
type="movement"
group="$$.equipment"
direction="input"
order=2
}}
{{: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_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 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}}
{{: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*}}
{{if $stock == null}}
{{:continue}}
{{/if}}
<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="Entrée"
shape="plus"
href="mouvements/entrees/repertorie.html?key=%s&prop=1"|args:$equipment
target="_dialog"}}
label="Retour"
href="mouvements/entrees/retour.html?key=%s&prop=1"|args:$equipment
shape="history"
target="_dialog"}}
{{/if}}
{{if $dispo > 0}}
{{: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}}
{{/if}}
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}}
{{else}}
<p class="block alert">Aucun matériel.</p>
{{/if}}

View File

@ -9,31 +9,29 @@
{{:admin_header title="Gestion des matériels" custom_css=$custom_css current="module_equipment"}}
{{* 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 *}}
{{: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}}
{{* Vérifier s'il y a au moins un matériel non propriété de l'asso *}}
{{:assign mat_non_prop=false}}
{{#foreach from=$equipments key=key item=eqpmt}}
{{if $eqpmt|has_key:"nonproprio"}}
{{:assign mat_non_prop=true}}
{{:break}}
{{/if}}
{{/foreach}}
{{* Vérifier s'il y a au moins un matériel non propriété de l'asso *}}
{{:assign mat_non_prop=false}}
{{#foreach from=$equipments key=key item=eqpmt}}
{{if $eqpmt|has_key:"nonproprio"}}
{{: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%;">
<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="?">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"}}
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
<a href="?cat_key={{$key}}">
@ -45,64 +43,64 @@
</nav>
</fieldset>
{{if $mat_non_prop}}
<h2>Matériels temporairement dans l'association</h2>
<h2>Matériels temporairement dans 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 'Quantité'
"
type="movement"
group="$$.equipment"
direction="input"
order=2
}}
{{#list
select="
$$.date AS 'Date' ;
(SELECT $$.designation
FROM @TABLE AS b
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
"" as 'Catégorie' ;
"" AS 'Quantité'
"
type="movement"
group="$$.equipment"
direction="input"
order=2
}}
{{: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_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=qte from="equipments.%s.nonproprio"|args:$equipment}}
{{:assign var=cat_name from="cumul_mvt.%s.name"|args:$cat_key}}
{{:assign var=qte from="equipments.%s.nonproprio"|args:$equipment}}
{{if $qte == null}}
{{:continue}}
{{/if}}
<tr>
<td>{{$date|date_short}}</td>
<td>{{$col2}}</td>
<td>{{$cat_name}}</td>
<td>{{$qte}}</td>
<td class="actions">
{{if $qte > 0}}
{{:linkbutton
label="Retour"
href="mouvements/sorties/emprunte.html?key=%s&prop=0"|args:$equipment
shape="history"
target="_dialog"}}
{{/if}}
{{if $qte == null}}
{{:continue}}
{{/if}}
<tr>
<td>{{$date|date_short}}</td>
<td>{{$col2}}</td>
<td>{{$cat_name}}</td>
<td>{{$qte}}</td>
<td class="actions">
{{if $qte > 0}}
{{:linkbutton
label="Entrée"
shape="plus"
href="mouvements/entrees/repertorie.html?key=%s&prop=0"|args:$equipment
target="_dialog"}}
{{:linkbutton
label="Mouvements"
href="%shistorique.html?key=%s&prop=0"|args:$module.url:$equipment
shape="table"}}
{{:linkbutton
label="Modifier"
href="modifier_materiel.html?key=%s&prop=0"|args:$equipment
shape="edit"
target="_dialog"}}
</td>
</tr>
{{/list}}
{{/if}}
label="Retour"
href="mouvements/sorties/emprunte.html?key=%s&prop=0"|args:$equipment
shape="history"
target="_dialog"}}
{{/if}}
{{:linkbutton
label="Entrée"
shape="plus"
href="mouvements/entrees/repertorie.html?key=%s&prop=0"|args:$equipment
target="_dialog"}}
{{:linkbutton
label="Mouvements"
href="%shistorique.html?key=%s&prop=0"|args:$module.url:$equipment
shape="table"}}
{{:linkbutton
label="Modifier"
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}}