Correction inexactitude
This commit is contained in:
parent
e4e717dfb1
commit
e692cf0b2c
1 changed files with 29 additions and 31 deletions
|
|
@ -16,21 +16,6 @@
|
|||
|
||||
{{* récupérer la config des entrées/sorties *}}
|
||||
{{:include file="../_get_config.html" keep="config, directions"}}
|
||||
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt_new.direction:$mvt_new.operation}}
|
||||
|
||||
{{if $mvt_new.direction == "input"}}
|
||||
{{if $type_mvt == "temporaire"}}
|
||||
{{:assign prop=0}}
|
||||
{{else}}
|
||||
{{:assign prop=1}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{if $type_mvt == "retour"}}
|
||||
{{:assign prop=0}}
|
||||
{{else}}
|
||||
{{:assign prop=1}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{* infos pour affichage *}}
|
||||
{{:assign var="op_label" from="config.%s_nature.%s.label"|args:$mvt_new.direction:$mvt_new.operation}}
|
||||
|
|
@ -45,16 +30,6 @@
|
|||
{{:error message="Aucun matériel avec la clé « %s »"|args:$eqpmt_key}}
|
||||
{{/load}}
|
||||
|
||||
{{#foreach from=$directions key="direction"}}
|
||||
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
|
||||
{{#foreach from=$nature key="key"}}
|
||||
{{if $type_mvt != "retour" && $type != "retour" ||
|
||||
$type_mvt == "retour" && $type == "retour"}}
|
||||
{{:assign var="%s_labels.%s"|args:$direction:$key value=$label}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/foreach}}
|
||||
|
||||
{{*
|
||||
-------------------- Traiter la saisie --------------------
|
||||
*}}
|
||||
|
|
@ -86,6 +61,7 @@
|
|||
{{:assign var="mvt_new.amount" value=$_POST.amount}}
|
||||
{{:assign var="mvt_new.date" value=$_POST.date|parse_date}}
|
||||
{{:assign var="mvt_new.comment" value=$_POST.comment}}
|
||||
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt_new.direction:$mvt_new.operation}}
|
||||
|
||||
{{if $_POST.return_date != null}}
|
||||
{{:assign return_date=$_POST.return_date|parse_date}}
|
||||
|
|
@ -103,10 +79,7 @@
|
|||
*}}
|
||||
{{:assign insere=false}}
|
||||
{{#load
|
||||
where="
|
||||
$$.type = 'movement'
|
||||
AND
|
||||
$$.equipment = :eqpmt_key"
|
||||
where="$$.type = 'movement' AND $$.equipment = :eqpmt_key"
|
||||
:eqpmt_key=$eqpmt_key
|
||||
order="$$.date"
|
||||
assign="movement"
|
||||
|
|
@ -240,6 +213,20 @@
|
|||
{{:assign suffix="movements"}}
|
||||
{{/if}}
|
||||
|
||||
{{if $mvt_new.direction == "input"}}
|
||||
{{if $type_mvt == "temporaire"}}
|
||||
{{:assign prop=0}}
|
||||
{{else}}
|
||||
{{:assign prop=1}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{if $type_mvt == "retour"}}
|
||||
{{:assign prop=0}}
|
||||
{{else}}
|
||||
{{:assign prop=1}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{if $_GET.from == "eh"}}
|
||||
{{:redirect force="../equipment_history.html?ok=1&key=%s&prop=%s&msg=modification"|args:$eqpmt_key:$prop}}
|
||||
{{elseif $suffix == null}}
|
||||
|
|
@ -254,7 +241,6 @@
|
|||
{{else}}
|
||||
{{:assign mvt_label="sortie"}}
|
||||
{{/if}}
|
||||
|
||||
{{:admin_header title="Modifier une %s"|args:$mvt_label custom_css="./../style.css" current="module_equipment"}}
|
||||
{{:form_errors}}
|
||||
|
||||
|
|
@ -264,6 +250,18 @@
|
|||
|
||||
{{#load key=$equipment.category assign="category"}}{{/load}}
|
||||
|
||||
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt_new.direction:$mvt_new.operation}}
|
||||
{{#foreach from=$directions key="direction"}}
|
||||
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
|
||||
{{#foreach from=$nature key="key"}}
|
||||
{{if $type_mvt != "retour" && $type != "retour" ||
|
||||
$type_mvt == "retour" && $type == "retour"}}
|
||||
{{:assign var="%s_labels.%s"|args:$direction:$key value=$label}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/foreach}}
|
||||
|
||||
|
||||
{{if $mvt_new.user != null}}
|
||||
{{#select id, !name as nom FROM users WHERE id=:id; !name=$config.user_fields.name_sql :id=$mvt_new.user}}
|
||||
{{:assign var="user.%s"|args:$id value=$nom}}
|
||||
|
|
@ -309,7 +307,7 @@
|
|||
<fieldset class="entree">
|
||||
<legend>Autres informations</legend>
|
||||
<dl>
|
||||
{{if $prop == 1 && $mvt_new.direction == "output"}}
|
||||
{{if $mvt_new.direction == "output" && $type_mvt != "retour"}}
|
||||
{{:input
|
||||
type="list"
|
||||
name="user"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue