Mutualisation calcul des entrées/sorties à une date donnée
This commit is contained in:
parent
2376a2d648
commit
0b356b6617
134
_calcul_dispo.html
Normal file
134
_calcul_dispo.html
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
{{*
|
||||||
|
Calcul des entrées/sorties de matériels à une date donnée
|
||||||
|
paramètres :
|
||||||
|
- liste de catégories
|
||||||
|
- date
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{* liste des catégories *}}
|
||||||
|
{{if $categories === null}}
|
||||||
|
{{#select
|
||||||
|
key
|
||||||
|
FROM module_data_equipment as cat
|
||||||
|
WHERE json_extract(cat.document, '$.type') = 'category'}}
|
||||||
|
{{:assign var="categories." value=$key}}
|
||||||
|
{{/select}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{* date *}}
|
||||||
|
{{if $date === null}}
|
||||||
|
{{:assign date=$now|date:"Y-m-d"}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{* :debug date=$date *}}
|
||||||
|
|
||||||
|
{{* 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
|
||||||
|
AND json_extract(mvt.document, '$.date') <= :date
|
||||||
|
ORDER BY
|
||||||
|
json_extract(cat.document, '$.name'),
|
||||||
|
json_extract(eqpmt.document, '$.designation'),
|
||||||
|
json_extract(mvt.document, '$.date');
|
||||||
|
!categories='cat_key'|sql_where:'IN':$categories
|
||||||
|
:date=$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}}
|
@ -3,14 +3,6 @@
|
|||||||
{{* 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"}}
|
||||||
|
|
||||||
{{* 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}}
|
|
||||||
|
|
||||||
{{:include file="./inventaire.html" print_cat_name=true}}
|
{{:include file="./inventaire.html" print_cat_name=true}}
|
||||||
|
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
111
inventaire.html
111
inventaire.html
@ -1,115 +1,7 @@
|
|||||||
{{* inventaire des entrées/sorties des matériels des catégories de la variable $categories *}}
|
{{* 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 *}}
|
{{* Extraire et compiler les infos de la base *}}
|
||||||
{{#select
|
{{:include file="./_calcul_dispo.html" keep="equipments"}}
|
||||||
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 *}}
|
{{* Afficher les résultats *}}
|
||||||
{{if $equipments === null}}
|
{{if $equipments === null}}
|
||||||
@ -152,6 +44,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
|
{{:assign base_path="/m/%s"|args:$module.name}}
|
||||||
{{* itérer sur les matériels de la catégorie *}}
|
{{* itérer sur les matériels de la catégorie *}}
|
||||||
{{#foreach from=$category.eqpmt key="eqpmt_key" item="eqpmt"}}
|
{{#foreach from=$category.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||||
|
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
{{* cumuler les entrées et les sorties de ce matériel *}}
|
|
||||||
{{:assign var="dispo" value=0}}
|
|
||||||
{{#load type="movement" where="$$.equipment = :eqpmt_key" :eqpmt_key=$equipment.key assign="movement"}}
|
|
||||||
{{if $movement.direction === 'entrée'}}
|
|
||||||
{{:assign dispo="%d+%d"|math:$dispo:$movement.amount}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign dispo="%d-%d"|math:$dispo:$movement.amount}}
|
|
||||||
{{/if}}
|
|
||||||
{{/load}}
|
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
{{* types de sorties *}}
|
{{* types de sorties *}}
|
||||||
{{#foreach from=$module.config.outputNature item="elem"}}
|
{{#foreach from=$module.config.outputNature item="elem"}}
|
||||||
{{:assign var='types_sorties.' value="%s"|args:$elem.label}}
|
{{:assign var='types_sorties.' value="%s"|args:$elem.label}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
@ -19,48 +19,24 @@
|
|||||||
{{* récupérer les infos du matériel *}}
|
{{* récupérer les infos du matériel *}}
|
||||||
{{#load type="equipment" key=$_POST.equipment assign="equipment"}}
|
{{#load type="equipment" key=$_POST.equipment assign="equipment"}}
|
||||||
{{:assign designation=$equipment.designation}}
|
{{:assign designation=$equipment.designation}}
|
||||||
|
{{:assign var="categories." value=$equipment.category}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
{{:assign date=$_POST.date|parse_date}}
|
||||||
|
|
||||||
|
{{* Extraire et compiler les infos de la base *}}
|
||||||
|
{{:include file="/%s/_calcul_dispo.html"|args:$module.name keep="equipments"}}
|
||||||
|
|
||||||
{{* déterminer la quantité disponible de ce matériel à la date donnée *}}
|
{{* déterminer la quantité disponible de ce matériel à la date donnée *}}
|
||||||
{{:assign var="dispo" value=0}}
|
{{:assign var=stock from="equipments.%s.eqpmt.%s.stock"|args:$equipment.category:$_POST.equipment}}
|
||||||
{{#load
|
{{:assign var=exterieur from="equipments.%s.eqpmt.%s.exterieur"|args:$equipment.category:$_POST.equipment}}
|
||||||
type="movement"
|
{{:assign dispo="%d-%d"|math:$stock:$exterieur}}
|
||||||
where="$$.equipment = :eqpmt_key AND $$.date <= :date"
|
|
||||||
:eqpmt_key=$equipment.key
|
|
||||||
:date=$_POST.date|parse_date
|
|
||||||
assign="movement"
|
|
||||||
}}
|
|
||||||
{{if $movement.direction === 'entrée'}}
|
|
||||||
{{* chercher le type d'entrée parmi les types de la config *}}
|
|
||||||
{{#foreach from=$module.config.inputNature item="elem"}}
|
|
||||||
{{if $movement.inputNature == $elem.label}}
|
|
||||||
{{if $elem.type == 'définitif' || $elem.type == 'retour'}}
|
|
||||||
{{:assign dispo="%d+%d"|math:$dispo:$movement.amount}}
|
|
||||||
{{/if}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{else}}
|
|
||||||
{{* chercher le type d'entrée parmi les types de la config *}}
|
|
||||||
{{#foreach from=$module.config.outputNature item="elem"}}
|
|
||||||
{{if $movement.outputNature == $elem.label}}
|
|
||||||
{{if $elem.type == 'définitif' || $elem.type == 'temporaire'}}
|
|
||||||
{{:assign dispo="%d-%d"|math:$dispo:$movement.amount}}
|
|
||||||
{{/if}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{/if}}
|
|
||||||
{{else}}
|
|
||||||
{{:error message="Erreur : il n'y a aucun mouvement pour le matériel « %s » avant la date du %s."|args:$equipment.designation:$_POST.date}}
|
|
||||||
{{/load}}
|
|
||||||
|
|
||||||
{{if $_POST.quantite|intval > $dispo}}
|
{{if $_POST.quantite|intval > $dispo}}
|
||||||
{{:error message="Erreur : la quantité indiquée (%s) est supérieure à celle disponible (%d) à la date du %s"|args:$_POST.quantite:$dispo:$_POST.date}}
|
{{:error message="Erreur : la quantité indiquée (%s) est supérieure à celle disponible (%d) à la date du %s"|args:$_POST.quantite:$dispo:$_POST.date}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* Enregistrer le mouvement *}}
|
{{* Enregistrer le mouvement *}}
|
||||||
|
|
||||||
{{:assign mvt_key=""|uuid}}
|
{{:assign mvt_key=""|uuid}}
|
||||||
{{:assign var="operation" from="types_sorties.%d|args:$_POST.type_operation}}
|
{{:assign var="operation" from="types_sorties.%d|args:$_POST.type_operation}}
|
||||||
{{:save
|
{{:save
|
||||||
@ -79,59 +55,21 @@
|
|||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{* itérer sur les catégories *}}
|
{{* Extraire et compiler les infos de la base *}}
|
||||||
{{#load type="category" assign="category" order="$$.name"}}
|
{{:include file="/%s/_calcul_dispo.html"|args:$module.name keep="equipments"}}
|
||||||
{{:assign nom_cat=$category.name}}
|
|
||||||
|
|
||||||
{{* lister les matériels de la catégorie *}}
|
{{* calculer les disponibilités *}}
|
||||||
{{#load type="equipment" where="$$.category = :key" :key=$category.key assign="equipment" order="$$.designation"}}
|
{{#foreach from=$equipments key="cat_key" item="category"}}
|
||||||
{{:assign designation=$equipment.designation}}
|
{{#foreach from=$category.eqpmt key="eqpmt_key" item="eqpmt"}}
|
||||||
|
{{:assign dispo="%d-%d"|math:$eqpmt.stock:$eqpmt.exterieur}}
|
||||||
{{* déterminer la quantité disponible de ce matériel,
|
{{:assign
|
||||||
ie propriété de l'asso et pas en prêt à la date du jour *}}
|
var="disponibilites.%s.%s"|args:$category.name:$eqpmt_key
|
||||||
{{:assign var="dispo" value=0}}
|
value="%s (dispo : %d)"|args:$eqpmt.designation:$dispo
|
||||||
{{#load
|
|
||||||
type="movement"
|
|
||||||
where="$$.equipment = :eqpmt_key AND $$.date <= :date"
|
|
||||||
:eqpmt_key=$equipment.key
|
|
||||||
:date=$now|date:"Y-m-d"
|
|
||||||
assign="movement"
|
|
||||||
}}
|
}}
|
||||||
|
{{/foreach}}
|
||||||
{{if $movement.direction === 'entrée'}}
|
{{/foreach}}
|
||||||
{{* chercher le type d'entrée parmi les types de la config *}}
|
|
||||||
{{#foreach from=$module.config.inputNature item="elem"}}
|
|
||||||
{{if $movement.inputNature == $elem.label}}
|
|
||||||
{{if $elem.type == 'définitif' || $elem.type == 'retour'}}
|
|
||||||
{{:assign dispo="%d+%d"|math:$dispo:$movement.amount}}
|
|
||||||
{{/if}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{else}}
|
|
||||||
{{* chercher le type d'entrée parmi les types de la config *}}
|
|
||||||
{{#foreach from=$module.config.outputNature item="elem"}}
|
|
||||||
{{if $movement.outputNature == $elem.label}}
|
|
||||||
{{if $elem.type == 'définitif' || $elem.type == 'temporaire'}}
|
|
||||||
{{:assign dispo="%d-%d"|math:$dispo:$movement.amount}}
|
|
||||||
{{/if}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{/if}}
|
|
||||||
{{else}}
|
|
||||||
<p class="block alert">Il n'y a aucun movement dans cette période.</p>
|
|
||||||
{{/load}}
|
|
||||||
|
|
||||||
{{if $dispo > 0}}
|
|
||||||
{{:assign var="equipments.%s.%s"|args:$nom_cat:$equipment.key value="%s (dispo : %d)"|args:$designation:$dispo}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{/load}}
|
|
||||||
{{/load}}
|
|
||||||
|
|
||||||
{{* formulaire de sortie de matériel *}}
|
{{* formulaire de sortie de matériel *}}
|
||||||
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
|
|
||||||
<fieldset class="sortie">
|
<fieldset class="sortie">
|
||||||
@ -142,7 +80,7 @@
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Matériel</legend>
|
<legend>Matériel</legend>
|
||||||
<p><span class="alert">La quantité disponible est celle à la date du jour</span></p>
|
<p><span class="alert">La quantité disponible est celle à la date du jour</span></p>
|
||||||
{{:input type="select_groups" name="equipment" label="Matériel" required=true options=$equipments onchange="fixerValeurMax('f_equipment', 'f_quantite')"}}
|
{{:input type="select_groups" name="equipment" label="Matériel" required=true options=$disponibilites onchange="fixerValeurMax('f_equipment', 'f_quantite')"}}
|
||||||
{{:input type="textarea" name="remarques" label="Remarques" cols="40" rows="3" required=false}}
|
{{:input type="textarea" name="remarques" label="Remarques" cols="40" rows="3" required=false}}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
Loading…
Reference in New Issue
Block a user