Mutualisation inventaire général et par catégorie
This commit is contained in:
parent
77fd548eff
commit
cd9abd4674
@ -15,44 +15,7 @@
|
|||||||
</header>
|
</header>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* afficher les matériels de la catégorie sélectionnée avec le stock, les entrées et les sorties *}}
|
{{:assign var="categories." value=$_GET.key}}
|
||||||
<section class="categories">
|
{{:include file="/%s/inventaire.html"|args:$module.name}}
|
||||||
|
|
||||||
{{#list
|
|
||||||
select="$$.designation AS 'Désignation'; '' AS 'Stock' ; '' AS 'Sortie' ; '' AS 'Disponible'"
|
|
||||||
type="equipment"
|
|
||||||
category=$_GET.key
|
|
||||||
order=1}}
|
|
||||||
|
|
||||||
{{:assign equipment_key=$key}}
|
|
||||||
{{:assign var="stock" value=0}}
|
|
||||||
{{:assign var="sortie" value=0}}
|
|
||||||
|
|
||||||
{{* récupérer les mouvements du matériel courant *}}
|
|
||||||
{{#load
|
|
||||||
type="movement"
|
|
||||||
equipment=$equipment_key
|
|
||||||
assign="movement"}}
|
|
||||||
|
|
||||||
{{if $movement.direction === 'entrée'}}
|
|
||||||
{{:assign stock="%d+%d"|math:$stock:$movement.amount}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign sortie="%d+%d"|math:$sortie:$movement.amount}}
|
|
||||||
{{/if}}
|
|
||||||
{{/load}}
|
|
||||||
|
|
||||||
{{:assign dispo="%d-%d"|math:$stock:$sortie}}
|
|
||||||
<tr>
|
|
||||||
<td>{{$designation}}</td>
|
|
||||||
<td>{{$stock}}</td>
|
|
||||||
<td>{{$sortie}}</td>
|
|
||||||
<td>{{$dispo}}</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
{{else}}
|
|
||||||
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
|
||||||
{{/list}}
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
221
index.html
221
index.html
@ -3,219 +3,14 @@
|
|||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{:include file="/%s/_nav.html"|args:$module.name current="index"}}
|
{{:include file="/%s/_nav.html"|args:$module.name current="index"}}
|
||||||
|
|
||||||
<section class="inventaire">
|
{{* liste des catégories *}}
|
||||||
|
{{#select
|
||||||
|
key
|
||||||
|
FROM module_data_equipment as cat
|
||||||
|
WHERE json_extract(cat.document, '$.type') = 'category'}}
|
||||||
|
{{:assign var="categories." value=$key}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
{{* Extraire et compiler les infos de la base *}}
|
{{:include file="./inventaire.html" print_cat_name=true}}
|
||||||
|
|
||||||
{{#select
|
|
||||||
json_extract(mvt.document, '$.date') as 'date',
|
|
||||||
eqpmt.key as 'eqpmt_key',
|
|
||||||
json_extract(eqpmt.document, '$.designation') as 'designation',
|
|
||||||
cat.key as 'cat_key',
|
|
||||||
json_extract(cat.document, '$.name') as 'category',
|
|
||||||
mvt.key as 'mvt_key',
|
|
||||||
json_extract(mvt.document, '$.direction') as 'direction',
|
|
||||||
CASE json_extract(mvt.document, '$.direction')
|
|
||||||
WHEN 'entrée' THEN json_extract(mvt.document, '$.inputNature')
|
|
||||||
WHEN 'sortie' THEN json_extract(mvt.document, '$.outputNature')
|
|
||||||
END
|
|
||||||
AS 'operation',
|
|
||||||
json_extract(mvt.document, '$.amount') AS 'nombre'
|
|
||||||
FROM module_data_equipment as eqpmt
|
|
||||||
INNER JOIN module_data_equipment as cat
|
|
||||||
ON json_extract(eqpmt.document, '$.category') = cat.key
|
|
||||||
INNER JOIN module_data_equipment as mvt
|
|
||||||
ON json_extract(mvt.document, '$.equipment') = eqpmt.key
|
|
||||||
WHERE json_extract(eqpmt.document, '$.type') = "equipment"
|
|
||||||
ORDER BY
|
|
||||||
json_extract(cat.document, '$.name'),
|
|
||||||
json_extract(eqpmt.document, '$.designation'),
|
|
||||||
json_extract(mvt.document, '$.date');
|
|
||||||
}}
|
|
||||||
|
|
||||||
{{:assign
|
|
||||||
var="equipments.%s.name"|args:$cat_key
|
|
||||||
value=$category}}
|
|
||||||
{{:assign
|
|
||||||
var="equipments.%s.eqpmt.%s.designation"|args:$cat_key:$eqpmt_key
|
|
||||||
value=$designation}}
|
|
||||||
|
|
||||||
{{* matériel propriété de l'asso en stock *}}
|
|
||||||
{{:assign
|
|
||||||
var="stock"
|
|
||||||
from="equipments.%s.eqpmt.%s.stock"|args:$cat_key:$eqpmt_key}}
|
|
||||||
{{if $stock === null}}
|
|
||||||
{{:assign stock=0}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* matériel propriété de l'asso à l'extérieur *}}
|
|
||||||
{{:assign
|
|
||||||
var="exterieur"
|
|
||||||
from="equipments.%s.eqpmt.%s.exterieur"|args:$cat_key:$eqpmt_key}}
|
|
||||||
{{if $exterieur === null}}
|
|
||||||
{{:assign exterieur=0}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* matériel non propriété de l'asso *}}
|
|
||||||
{{:assign
|
|
||||||
var="nonproprio"
|
|
||||||
from="equipments.%s.eqpmt.%s.nonproprio"|args:$cat_key:$eqpmt_key}}
|
|
||||||
{{if $nonproprio === null}}
|
|
||||||
{{:assign nonproprio=0}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{if $direction === 'entrée'}}
|
|
||||||
{{* chercher le type d'entrée parmi les types de la config *}}
|
|
||||||
{{#foreach from=$module.config.inputNature item="elem"}}
|
|
||||||
{{if $operation == $elem.label}}
|
|
||||||
{{if $elem.type == 'définitif'}}
|
|
||||||
{{:assign stock="%d+%d"|math:$stock:$nombre}}
|
|
||||||
{{:assign
|
|
||||||
var="equipments.%s.eqpmt.%s.stock"|args:$cat_key:$eqpmt_key
|
|
||||||
from=stock}}
|
|
||||||
{{elseif $elem.type == 'retour'}}
|
|
||||||
{{:assign exterieur="%d-%d"|math:$exterieur:$nombre}}
|
|
||||||
{{:assign
|
|
||||||
var="equipments.%s.eqpmt.%s.exterieur"|args:$cat_key:$eqpmt_key
|
|
||||||
from=exterieur}}
|
|
||||||
{{elseif $elem.type == 'temporaire'}}
|
|
||||||
{{:assign nonproprio="%d+%d"|math:$nonproprio:$nombre}}
|
|
||||||
{{:assign
|
|
||||||
var="equipments.%s.eqpmt.%s.nonproprio"|args:$cat_key:$eqpmt_key
|
|
||||||
from=nonproprio}}
|
|
||||||
{{/if}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{elseif $direction === 'sortie'}}
|
|
||||||
{{* chercher le type de sortie parmi les types de la config *}}
|
|
||||||
{{#foreach from=$module.config.outputNature item="elem"}}
|
|
||||||
{{if $operation == $elem.label}}
|
|
||||||
{{if $elem.type == 'définitif'}}
|
|
||||||
{{:assign stock="%d-%d"|math:$stock:$nombre}}
|
|
||||||
{{:assign
|
|
||||||
var="equipments.%s.eqpmt.%s.stock"|args:$cat_key:$eqpmt_key
|
|
||||||
from=stock}}
|
|
||||||
{{elseif $elem.type == 'temporaire'}}
|
|
||||||
{{:assign exterieur="%d+%d"|math:$exterieur:$nombre}}
|
|
||||||
{{:assign
|
|
||||||
var="equipments.%s.eqpmt.%s.exterieur"|args:$cat_key:$eqpmt_key
|
|
||||||
from=exterieur}}
|
|
||||||
{{elseif $elem.type == 'retour'}}
|
|
||||||
{{:assign nonproprio="%d-%d"|math:nonproprio:$nombre}}
|
|
||||||
{{:assign
|
|
||||||
var="equipments.%s.eqpmt.%s.nonproprio"|args:$cat_key:$eqpmt_key
|
|
||||||
from=nonproprio}}
|
|
||||||
{{/if}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{/if}}
|
|
||||||
{{/select}}
|
|
||||||
|
|
||||||
{{* Afficher les résultats *}}
|
|
||||||
|
|
||||||
<h2 class="ruler">Matériels dont l'association est propriétaire</h2>
|
|
||||||
|
|
||||||
{{* itérer sur les catégories *}}
|
|
||||||
{{#foreach from=$equipments key="cat_key" item="category"}}
|
|
||||||
|
|
||||||
{{* vérifier s'il y a des matériels dans cette catégorie *}}
|
|
||||||
{{:assign present=false}}
|
|
||||||
{{#foreach from=$category.eqpmt key="eqpmt_key" item="eqpmt"}}
|
|
||||||
{{if $eqpmt.stock !== null && $eqpmt.stock !== 0}}
|
|
||||||
{{:assign present=true}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
{{if $present}}
|
|
||||||
<h3>{{$category.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=$category.eqpmt key="eqpmt_key" item="eqpmt"}}
|
|
||||||
|
|
||||||
{{:assign keys=$eqpmt|keys}}
|
|
||||||
{{if "stock"|in:$keys && $eqpmt.stock !== 0}}
|
|
||||||
{{:assign dispo="%d-%d"|math:$eqpmt.stock:$eqpmt.exterieur}}
|
|
||||||
<tr>
|
|
||||||
<td>{{$eqpmt.designation}}</td>
|
|
||||||
<td>{{$eqpmt.stock}}</td>
|
|
||||||
<td>{{if $eqpmt.exterieur == null}}0{{else}}{{$eqpmt.exterieur}}{{/if}}</td>
|
|
||||||
<td>{{$dispo}}</td>
|
|
||||||
<td class="actions">
|
|
||||||
{{:linkbutton label="Historique des mouvements" href="historique.html?key=%s"|args:$eqpmt_key shape="table" 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}}
|
|
||||||
|
|
||||||
<h2 class="ruler">Matériels dont l'association n'est pas propriétaire</h2>
|
|
||||||
|
|
||||||
{{* itérer sur les catégories *}}
|
|
||||||
{{#foreach from=$equipments key="cat_key" item="category"}}
|
|
||||||
|
|
||||||
{{* vérifier s'il y a des matériels dans cette catégorie *}}
|
|
||||||
{{:assign present=false}}
|
|
||||||
{{#foreach from=$category.eqpmt key="eqpmt_key" item="eqpmt"}}
|
|
||||||
{{if $eqpmt.nonproprio !== null && $eqpmt.nonproprio !== 0}}
|
|
||||||
{{:assign present=true}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
{{if $present}}
|
|
||||||
<h3>{{$category.name}}</h3>
|
|
||||||
|
|
||||||
<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=$category.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">
|
|
||||||
{{:linkbutton label="Historique des mouvements" href="historique.html?key=%s"|args:$eqpmt_key shape="table" 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}}
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
242
inventaire.html
Normal file
242
inventaire.html
Normal file
@ -0,0 +1,242 @@
|
|||||||
|
{{* inventaire des entrées/sorties des matériels des catégories de la variable $categories *}}
|
||||||
|
|
||||||
|
{{:assign base_path="/m/%s"|args:$module.name}}
|
||||||
|
|
||||||
|
{{* Extraire et compiler les infos de la base *}}
|
||||||
|
{{#select
|
||||||
|
json_extract(mvt.document, '$.date') as 'date',
|
||||||
|
eqpmt.key as 'eqpmt_key',
|
||||||
|
json_extract(eqpmt.document, '$.designation') as 'designation',
|
||||||
|
cat.key as 'cat_key',
|
||||||
|
json_extract(cat.document, '$.name') as 'category',
|
||||||
|
mvt.key as 'mvt_key',
|
||||||
|
json_extract(mvt.document, '$.direction') as 'direction',
|
||||||
|
CASE json_extract(mvt.document, '$.direction')
|
||||||
|
WHEN 'entrée' THEN json_extract(mvt.document, '$.inputNature')
|
||||||
|
WHEN 'sortie' THEN json_extract(mvt.document, '$.outputNature')
|
||||||
|
END
|
||||||
|
AS 'operation',
|
||||||
|
json_extract(mvt.document, '$.amount') AS 'nombre'
|
||||||
|
FROM module_data_equipment as eqpmt
|
||||||
|
INNER JOIN module_data_equipment as cat
|
||||||
|
ON json_extract(eqpmt.document, '$.category') = cat.key
|
||||||
|
INNER JOIN module_data_equipment as mvt
|
||||||
|
ON json_extract(mvt.document, '$.equipment') = eqpmt.key
|
||||||
|
WHERE json_extract(eqpmt.document, '$.type') = "equipment"
|
||||||
|
AND !categories
|
||||||
|
ORDER BY
|
||||||
|
json_extract(cat.document, '$.name'),
|
||||||
|
json_extract(eqpmt.document, '$.designation'),
|
||||||
|
json_extract(mvt.document, '$.date');
|
||||||
|
!categories='cat_key'|sql_where:'IN':$categories
|
||||||
|
}}
|
||||||
|
|
||||||
|
{{:assign
|
||||||
|
var="equipments.%s.name"|args:$cat_key
|
||||||
|
value=$category}}
|
||||||
|
{{:assign
|
||||||
|
var="equipments.%s.eqpmt.%s.designation"|args:$cat_key:$eqpmt_key
|
||||||
|
value=$designation}}
|
||||||
|
|
||||||
|
{{* matériel propriété de l'asso en stock *}}
|
||||||
|
{{:assign
|
||||||
|
var="stock"
|
||||||
|
from="equipments.%s.eqpmt.%s.stock"|args:$cat_key:$eqpmt_key}}
|
||||||
|
{{if $stock === null}}
|
||||||
|
{{:assign stock=0}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{* matériel propriété de l'asso à l'extérieur *}}
|
||||||
|
{{:assign
|
||||||
|
var="exterieur"
|
||||||
|
from="equipments.%s.eqpmt.%s.exterieur"|args:$cat_key:$eqpmt_key}}
|
||||||
|
{{if $exterieur === null}}
|
||||||
|
{{:assign exterieur=0}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{* matériel non propriété de l'asso *}}
|
||||||
|
{{:assign
|
||||||
|
var="nonproprio"
|
||||||
|
from="equipments.%s.eqpmt.%s.nonproprio"|args:$cat_key:$eqpmt_key}}
|
||||||
|
{{if $nonproprio === null}}
|
||||||
|
{{:assign nonproprio=0}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{if $direction === 'entrée'}}
|
||||||
|
{{* chercher le type d'entrée parmi les types de la config *}}
|
||||||
|
{{#foreach from=$module.config.inputNature item="elem"}}
|
||||||
|
{{if $operation == $elem.label}}
|
||||||
|
{{if $elem.type == 'définitif'}}
|
||||||
|
{{:assign stock="%d+%d"|math:$stock:$nombre}}
|
||||||
|
{{:assign
|
||||||
|
var="equipments.%s.eqpmt.%s.stock"|args:$cat_key:$eqpmt_key
|
||||||
|
from=stock}}
|
||||||
|
{{elseif $elem.type == 'retour'}}
|
||||||
|
{{:assign exterieur="%d-%d"|math:$exterieur:$nombre}}
|
||||||
|
{{:assign
|
||||||
|
var="equipments.%s.eqpmt.%s.exterieur"|args:$cat_key:$eqpmt_key
|
||||||
|
from=exterieur}}
|
||||||
|
{{elseif $elem.type == 'temporaire'}}
|
||||||
|
{{:assign nonproprio="%d+%d"|math:$nonproprio:$nombre}}
|
||||||
|
{{:assign
|
||||||
|
var="equipments.%s.eqpmt.%s.nonproprio"|args:$cat_key:$eqpmt_key
|
||||||
|
from=nonproprio}}
|
||||||
|
{{/if}}
|
||||||
|
{{:break}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
{{elseif $direction === 'sortie'}}
|
||||||
|
{{* chercher le type de sortie parmi les types de la config *}}
|
||||||
|
{{#foreach from=$module.config.outputNature item="elem"}}
|
||||||
|
{{if $operation == $elem.label}}
|
||||||
|
{{if $elem.type == 'définitif'}}
|
||||||
|
{{:assign stock="%d-%d"|math:$stock:$nombre}}
|
||||||
|
{{:assign
|
||||||
|
var="equipments.%s.eqpmt.%s.stock"|args:$cat_key:$eqpmt_key
|
||||||
|
from=stock}}
|
||||||
|
{{elseif $elem.type == 'temporaire'}}
|
||||||
|
{{:assign exterieur="%d+%d"|math:$exterieur:$nombre}}
|
||||||
|
{{:assign
|
||||||
|
var="equipments.%s.eqpmt.%s.exterieur"|args:$cat_key:$eqpmt_key
|
||||||
|
from=exterieur}}
|
||||||
|
{{elseif $elem.type == 'retour'}}
|
||||||
|
{{:assign nonproprio="%d-%d"|math:nonproprio:$nombre}}
|
||||||
|
{{:assign
|
||||||
|
var="equipments.%s.eqpmt.%s.nonproprio"|args:$cat_key:$eqpmt_key
|
||||||
|
from=nonproprio}}
|
||||||
|
{{/if}}
|
||||||
|
{{:break}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
{{/if}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
|
{{* Afficher les résultats *}}
|
||||||
|
{{if $equipments === null}}
|
||||||
|
{{if $categories|count == 1}}
|
||||||
|
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
||||||
|
{{else}}
|
||||||
|
<p class="block alert">Il n'y a aucun matériel dans ces catégories.</p>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
|
||||||
|
<section class="inventaire">
|
||||||
|
<h2 class="ruler">Matériels dont l'association est propriétaire</h2>
|
||||||
|
|
||||||
|
{{* itérer sur les catégories *}}
|
||||||
|
{{#foreach from=$equipments key="cat_key" item="category"}}
|
||||||
|
|
||||||
|
{{* vérifier s'il y a des matériels dans cette catégorie *}}
|
||||||
|
{{:assign present=false}}
|
||||||
|
{{#foreach from=$category.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||||
|
{{if $eqpmt.stock !== null && $eqpmt.stock !== 0}}
|
||||||
|
{{:assign present=true}}
|
||||||
|
{{:break}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
|
||||||
|
{{if $print_cat_name}}
|
||||||
|
<h3>{{$category.name}}</h3>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{if $present}}
|
||||||
|
<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=$category.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||||
|
|
||||||
|
{{:assign keys=$eqpmt|keys}}
|
||||||
|
{{if "stock"|in:$keys && $eqpmt.stock !== 0}}
|
||||||
|
{{:assign dispo="%d-%d"|math:$eqpmt.stock:$eqpmt.exterieur}}
|
||||||
|
<tr>
|
||||||
|
<td>{{$eqpmt.designation}}</td>
|
||||||
|
<td>{{$eqpmt.stock}}</td>
|
||||||
|
<td>{{if $eqpmt.exterieur == null}}0{{else}}{{$eqpmt.exterieur}}{{/if}}</td>
|
||||||
|
<td>{{$dispo}}</td>
|
||||||
|
<td class="actions">
|
||||||
|
{{:linkbutton
|
||||||
|
label="Historique des mouvements"
|
||||||
|
href="%s/historique.html?key=%s"|args:$base_path:$eqpmt_key
|
||||||
|
shape="table"
|
||||||
|
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>
|
||||||
|
{{else}}
|
||||||
|
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
|
||||||
|
<h2 class="ruler">Matériels dont l'association n'est pas propriétaire</h2>
|
||||||
|
|
||||||
|
{{* itérer sur les catégories *}}
|
||||||
|
{{#foreach from=$equipments key="cat_key" item="category"}}
|
||||||
|
|
||||||
|
{{* vérifier s'il y a des matériels dans cette catégorie *}}
|
||||||
|
{{:assign present=false}}
|
||||||
|
{{#foreach from=$category.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||||
|
{{if $eqpmt.nonproprio !== null && $eqpmt.nonproprio !== 0}}
|
||||||
|
{{:assign present=true}}
|
||||||
|
{{:break}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
|
||||||
|
{{if $print_cat_name}}
|
||||||
|
<h3>{{$category.name}}</h3>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{if $present}}
|
||||||
|
<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=$category.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">
|
||||||
|
{{:linkbutton
|
||||||
|
label="Historique des mouvements"
|
||||||
|
href="%s/historique.html?key=%s"|args:$base_path:$eqpmt_key
|
||||||
|
shape="table"
|
||||||
|
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>
|
||||||
|
{{else}}
|
||||||
|
<p class="block alert">Il n'y a aucun matériel dans cette catégorie.</p>
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
</section>
|
||||||
|
{{/if}}
|
Loading…
Reference in New Issue
Block a user