Compare commits
3 Commits
ea0fd3b1a2
...
498e24e7ed
Author | SHA1 | Date | |
---|---|---|---|
498e24e7ed | |||
dc314dcb3d | |||
8305433f5b |
@ -7,14 +7,20 @@
|
||||
|
||||
<ul>
|
||||
<li {{if $current == 'index'}} class="current"{{/if}}><a href="{{$module.url}}index.html">Inventaire</a></li>
|
||||
{{if $current == 'mouvements'}}<li class="current"><a>Mouvements</a></li>{{/if}}
|
||||
<li {{if $current == 'config'}} class="current"{{/if}}><a href="{{$module.url}}categories/index.html">Configuration</a></li>
|
||||
</ul>
|
||||
|
||||
{{if $current == 'index'}}
|
||||
<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>
|
||||
</ul>
|
||||
{{if $subcurrent == 'mouvements'}}
|
||||
<ul class="sub">
|
||||
<li class="title"><strong>{{$eqpmt}} ({{$category}})</strong></li>
|
||||
<li class="current"><a>Mouvements</a></li>
|
||||
</ul>
|
||||
{{/if}}
|
||||
{{elseif $current == 'config'}}
|
||||
<ul class="sub" >
|
||||
<li {{if $subcurrent == 'categories'}} class="current"{{/if}}><a href="{{$module.url}}categories/index.html">Catégories</a></li>
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{if ! $dialog}}
|
||||
{{:include file="./_nav.html" current="mouvements"}}
|
||||
{{:include file="./_nav.html" current="index" subcurrent="mouvements" eqpmt=$equipment.designation category=$category.name}}
|
||||
{{/if}}
|
||||
|
||||
{{* récupérer la config des entrées/sorties *}}
|
||||
@ -76,8 +76,11 @@
|
||||
{{/foreach}}
|
||||
|
||||
{{* lister tous les mouvements du matériel passé en paramètre *}}
|
||||
<h2>Mouvements de {{$equipment.designation}} ({{$category.name}})</h2>
|
||||
<h3>Matériel qui {{if $_GET.prop}}appartient{{else}}n'appartient pas{{/if}} à l'association</h3>
|
||||
{{if $_GET.prop}}
|
||||
<h3>Matériel propriété de l'association</h3>
|
||||
{{else}}
|
||||
<h3>Matériel temporairement dans l'association</h3>
|
||||
{{/if}}
|
||||
|
||||
{{#list
|
||||
type="movement"
|
||||
|
169
inventaire.html
169
inventaire.html
@ -1,9 +1,9 @@
|
||||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{*
|
||||
inventaire des entrées/sorties des matériels permanants de l'association
|
||||
inventaire des entrées/sorties des matériels permanents de l'association
|
||||
paramètres
|
||||
- category_keys
|
||||
- category_keys : catégories dont on veut faire l'inventaire
|
||||
*}}
|
||||
|
||||
{{* Extraire et compiler les infos de la base *}}
|
||||
@ -22,106 +22,91 @@
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{* TODO Sélecteur catégories *}}
|
||||
<fieldset class="shortFormRight">
|
||||
{{* 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><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>
|
||||
|
||||
<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>
|
||||
{{: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}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
@ -27,77 +27,82 @@
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{* TODO 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>
|
||||
{{#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_non_prop}}
|
||||
<h2>Matériels dont l'association n'est pas propriétaire</h2>
|
||||
<h2>Matériels temporairement dans l'association</h2>
|
||||
|
||||
<fieldset>
|
||||
{{* itérer sur les catégories *}}
|
||||
{{#foreach from=$cumul_mvt key="cat_key" item="cat_elem"}}
|
||||
{{#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
|
||||
}}
|
||||
|
||||
{{* 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}}
|
||||
{{: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=qte from="equipments.%s.nonproprio"|args:$equipment}}
|
||||
|
||||
<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">
|
||||
{{if $eqpmt.nonproprio > 0}}
|
||||
{{:linkbutton
|
||||
label="Retour"
|
||||
href="mouvements/sorties/emprunte.html?key=%s&prop=0"|args:$eqpmt_key
|
||||
shape="history"
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
{{:linkbutton
|
||||
label="Entrée"
|
||||
shape="plus"
|
||||
href="mouvements/entrees/repertorie.html?key=%s&prop=0"|args:$eqpmt_key
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Mouvements"
|
||||
href="%shistorique.html?key=%s&prop=0"|args:$module.url:$eqpmt_key
|
||||
shape="table"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="modifier_materiel.html?key=%s&prop=0"|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>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</fieldset>
|
||||
{{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}}
|
||||
{{: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}}
|
||||
{{/if}}
|
||||
|
Loading…
Reference in New Issue
Block a user