refonte config types ES
This commit is contained in:
parent
b19904b05b
commit
08ff1f82fd
16 changed files with 133 additions and 208 deletions
|
|
@ -14,9 +14,9 @@
|
|||
{{:include file="../../_get_config.html" keep="config"}}
|
||||
|
||||
{{* types de sorties *}}
|
||||
{{#foreach from=$config.output_nature key="label" item="type"}}
|
||||
{{#foreach from=$config.output_nature key=key}}
|
||||
{{if $type == 'retour'}}
|
||||
{{:assign var='output_labels.' value="%s"|args:$label}}
|
||||
{{:assign var="output_labels.%s"|args:$key value=$label}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
|
|
@ -47,8 +47,7 @@
|
|||
{{/if}}
|
||||
|
||||
{{* traiter le mouvement courant *}}
|
||||
{{:assign var="mvt_nature" from="mvt.%s_nature"|args:$mvt.direction}}
|
||||
{{:assign var="type_mvt" from="config.%s_nature.%s"|args:$mvt.direction:$mvt_nature}}
|
||||
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt.direction:$mvt.operation}}
|
||||
|
||||
{{if $mvt.direction === 'input'}}
|
||||
{{if $type_mvt == 'définitif'}}
|
||||
|
|
@ -86,13 +85,12 @@
|
|||
|
||||
{{* Enregistrer le mouvement *}}
|
||||
{{:assign mvt_key=""|uuid}}
|
||||
{{:assign var="operation" from="output_labels.%d|args:$_POST.type_operation}}
|
||||
{{:save
|
||||
key=$mvt_key
|
||||
validate_schema="../movement.schema.json"
|
||||
type="movement"
|
||||
direction="output"
|
||||
output_nature=$operation
|
||||
operation=$_POST.operation
|
||||
amount=$_POST.quantite|intval
|
||||
equipment=$equipment.key
|
||||
date=$_POST.date|parse_date
|
||||
|
|
@ -130,7 +128,7 @@
|
|||
<fieldset class="sortie">
|
||||
<legend>Ajouter une sortie d'un matériel présent temporairement</legend>
|
||||
<dl>
|
||||
{{:input type="select" name="type_operation" label="Type" required=true options=$output_labels|sort}}
|
||||
{{:input type="select" name="operation" label="Type" required=true options=$output_labels|sort}}
|
||||
{{:input type="date" name="date" label="Date de sortie" required=true default=$now|date_short}}
|
||||
{{:input type="number" name="quantite" label="Quantité" required=true default=$present min=1 max=$present}}
|
||||
{{:input type="textarea" name="remarques" label="Remarques" cols="40" rows="3" required=false}}
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@
|
|||
{{:include file="../../_get_config.html" keep="config"}}
|
||||
|
||||
{{* types de sorties *}}
|
||||
{{#foreach from=$config.output_nature key="label" item="type"}}
|
||||
{{#foreach from=$config.output_nature key=key}}
|
||||
{{if $type != 'retour'}}
|
||||
{{:assign var='output_labels.' value="%s"|args:$label}}
|
||||
{{:assign var="output_labels.%s"|args:$key value=$label}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
|
|
@ -33,13 +33,11 @@
|
|||
|
||||
{{* lister tous les mouvements du matériel *}}
|
||||
{{#load type="movement" where="$$.equipment = '%s'"|args:$_GET.key assign="mvt" order="$$.date ASC"}}
|
||||
|
||||
{{* traiter le nouveau mouvement *}}
|
||||
{{if ! $insere && $mvt.date > $_POST.date|parse_date}}
|
||||
{{:assign insere=true}}
|
||||
{{:assign dispo_old="%d-%d"|math:$stock:$exterieur}}
|
||||
{{:assign var="operation" from="output_labels.%s|args:$_POST.type_operation}}
|
||||
{{:assign var="type_mvt" from="config.output_nature.%s"|args:$operation}}
|
||||
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$_POST.operation}}
|
||||
|
||||
{{if $type_mvt == 'définitif'}}
|
||||
{{:assign stock="%d-%d"|math:$stock:$_POST.quantite}}
|
||||
|
|
@ -55,8 +53,7 @@
|
|||
{{/if}}
|
||||
|
||||
{{* traiter le mouvement courant *}}
|
||||
{{:assign var="mvt_nature" from="mvt.%s_nature"|args:$mvt.direction}}
|
||||
{{:assign var="type_mvt" from="config.%s_nature.%s"|args:$mvt.direction:$mvt_nature}}
|
||||
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt.direction:$mvt.operation}}
|
||||
|
||||
{{if $mvt.direction === 'input'}}
|
||||
{{if $type_mvt == 'définitif'}}
|
||||
|
|
@ -85,8 +82,7 @@
|
|||
{{/load}}
|
||||
{{if ! $insere}}
|
||||
{{:assign dispo_old="%d-%d"|math:$stock:$exterieur}}
|
||||
{{:assign var="operation" from="output_labels.%s|args:$_POST.type_operation}}
|
||||
{{:assign var="type_mvt" from="config.output_nature.%s"|args:$operation}}
|
||||
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$_POST.operation}}
|
||||
|
||||
{{if $type_mvt == 'définitif'}}
|
||||
{{:assign stock="%d-%d"|math:$stock:$_POST.quantite}}
|
||||
|
|
@ -103,13 +99,12 @@
|
|||
|
||||
{{* Enregistrer le mouvement *}}
|
||||
{{:assign mvt_key=""|uuid}}
|
||||
{{:assign var="operation" from="output_labels.%d|args:$_POST.type_operation}}
|
||||
{{:save
|
||||
key=$mvt_key
|
||||
validate_schema="../movement.schema.json"
|
||||
type="movement"
|
||||
direction="output"
|
||||
output_nature=$operation
|
||||
operation=$_POST.operation
|
||||
amount=$_POST.quantite|intval
|
||||
equipment=$equipment.key
|
||||
date=$_POST.date|parse_date
|
||||
|
|
@ -150,7 +145,7 @@
|
|||
<fieldset class="sortie">
|
||||
<legend>Ajouter une sortie</legend>
|
||||
<dl>
|
||||
{{:input type="select" name="type_operation" label="Type" required=true options=$output_labels|sort}}
|
||||
{{:input type="select" name="operation" label="Type" required=true options=$output_labels|sort}}
|
||||
{{:input type="date" name="date" label="Date de sortie" required=true default=$now|date_short}}
|
||||
{{:input type="number" name="quantite" label="Quantité" required=true default=$dispo min=1 max=$dispo}}
|
||||
{{:input type="textarea" name="remarques" label="Remarques" cols="40" rows="3" required=false}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue