Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Jean-Christophe Engel | 4bba00f8e5 |
|
@ -7,7 +7,7 @@
|
|||
{{/if}}
|
||||
{{:admin_header title="Modifier une %s"|args:$msg_direction current="module_equipment"}}
|
||||
|
||||
{{:assign direction=$_GET.direction}}
|
||||
{{:assign direction_mvt=$_GET.direction}}
|
||||
{{:assign key_mvt=$_GET.key}}
|
||||
|
||||
{{* récupérer les infos du mouvement à modifier *}}
|
||||
|
@ -16,7 +16,7 @@
|
|||
{{:error message="Aucune %s avec la clé %s"|args:$msg_direction:$key_mvt}}
|
||||
{{/load}}
|
||||
|
||||
{{if $direction == "input"}}
|
||||
{{if $direction_mvt == "input"}}
|
||||
{{:assign input_init=$mvt_modif.input_nature}}
|
||||
{{:assign url="entrees/index.html"}}
|
||||
{{else}}
|
||||
|
@ -37,7 +37,7 @@
|
|||
{{* récupérer la config des entrées/sorties *}}
|
||||
{{:include file="../_get_config.html" keep="config"}}
|
||||
|
||||
{{if $direction == "input"}}
|
||||
{{if $direction_mvt == "input"}}
|
||||
{{* types d'entrées *}}
|
||||
{{#foreach from=$config.input_nature key="label" item="type"}}
|
||||
{{:assign var="input_labels.%s"|args:$label value="%s"|args:$label}}
|
||||
|
@ -60,7 +60,7 @@
|
|||
*}}
|
||||
{{#form on="change"}}
|
||||
{{* préparer le mouvement modifié *}}
|
||||
{{if $direction == "input"}}
|
||||
{{if $direction_mvt == "input"}}
|
||||
{{:assign var="mvt_modif.input_nature" from="input_labels.%s"|args:$_POST.type_operation}}
|
||||
{{else}}
|
||||
{{:assign var="mvt_modif.output_nature" from="output_labels.%s"|args:$_POST.type_operation}}
|
||||
|
@ -86,7 +86,10 @@
|
|||
assign="movement"
|
||||
}}
|
||||
{{if $key != $key_mvt}}
|
||||
{{if $date > $mvt_modif.date && ! $insere}}
|
||||
{{if $direction_mvt == "input" && ! $insere && $date >= $mvt_modif.date}}
|
||||
{{:assign var="movements_modif." from=mvt_modif}}
|
||||
{{:assign insere=true}}
|
||||
{{elseif $direction_mvt == "output" && ! $insere && $date > $mvt_modif.date}}
|
||||
{{:assign var="movements_modif." from=mvt_modif}}
|
||||
{{:assign insere=true}}
|
||||
{{/if}}
|
||||
|
@ -119,7 +122,7 @@
|
|||
{{if $erreur}}
|
||||
<p class="block error">
|
||||
Modification demandée impossible :
|
||||
{{if $direction == "input"}}
|
||||
{{if $direction_mvt == "input"}}
|
||||
« {{$input_init}} de {{$eqpmt_init.designation}} (qté : {{$amount_init}}) en date du {{$date_init}} » vers
|
||||
« {{$mvt_modif.input_nature}} de {{$eqpmt.designation}} (qté : {{$mvt_modif.amount}}) à la date du {{$mvt_modif.date|date_short}} »
|
||||
{{else}}
|
||||
|
@ -133,7 +136,7 @@
|
|||
key=$key_mvt
|
||||
validate_schema="./movement.schema.json"
|
||||
type="movement"
|
||||
direction=$direction
|
||||
direction=$direction_mvt
|
||||
input_nature=$mvt_modif.input_nature
|
||||
output_nature=$mvt_modif.output_nature
|
||||
amount=$mvt_modif.amount|intval
|
||||
|
@ -162,7 +165,7 @@
|
|||
<form method="post" action="">
|
||||
|
||||
<fieldset class="entree">
|
||||
{{if $direction == "input"}}
|
||||
{{if $direction_mvt == "input"}}
|
||||
<legend>Modifier l'entrée « {{$input_init}} {{$eqpmt_init.designation}} ({{$amount_init}}) en date du {{$date_init}} »</legend>
|
||||
<dl>
|
||||
{{:input type="select" name="type_operation" label="Type" required=true options=$input_labels default=$type_defaut}}
|
||||
|
|
Loading…
Reference in New Issue