correction erreur modification mouvement
This commit is contained in:
parent
467a094b14
commit
638855e6fc
3 changed files with 148 additions and 136 deletions
|
|
@ -75,12 +75,14 @@
|
|||
{{:error message="Impossible de saisir une date dans le futur (%s)"|args:$_POST.date}}
|
||||
{{/if}}
|
||||
|
||||
{{if $mvt_new.direction != "output" && $_POST.user != null}}
|
||||
{{if $mvt_new.direction == "input" && $_POST.user != null}}
|
||||
{{:error message="Un membre ne peut être associé qu'à une sortie"}}
|
||||
{{/if}}
|
||||
|
||||
{{if $_POST.user|count > 1}}
|
||||
{{:error message="Un membre au plus peut être associé à une sortie"}}
|
||||
{{/if}}
|
||||
|
||||
{{#foreach from=$_POST.user key="id" item="name"}}
|
||||
{{:assign var="user.id" value=$id}}
|
||||
{{:assign var="user.name" value=$name}}
|
||||
|
|
@ -115,8 +117,13 @@
|
|||
{{:assign var="movements_new." from=mvt_new}}
|
||||
{{:assign insere=true}}
|
||||
{{elseif $mvt_new.direction == "output" && $type_mvt == "temporaire"}}
|
||||
{{:assign var="movements_new." from=mvt_new}}
|
||||
{{:assign insere=true}}
|
||||
{{if $movement.direction == "input"}}
|
||||
{{:assign var="type_mvt_crt" from="config.input_nature.%s.type"|args::$movement.operation}}
|
||||
{{if $type_mvt_crt == "retour"}}
|
||||
{{:assign var="movements_new." from=mvt_new}}
|
||||
{{:assign insere=true}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
@ -160,33 +167,33 @@
|
|||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{:save
|
||||
key=$equipment.key
|
||||
validate_schema="../equipment.schema.json"
|
||||
type="equipment"
|
||||
category=$equipment.category
|
||||
name=$equipment.name
|
||||
status="available"
|
||||
stock=$equipment.stock
|
||||
out=$equipment.out
|
||||
notowned=$equipment.notowned
|
||||
}}
|
||||
{{* vérification réussie : enregistrer le mouvement modifié *}}
|
||||
{{:assign mvt_key=""|uuid}}
|
||||
{{:save
|
||||
key=$mvt_key
|
||||
validate_schema="movement.schema.json"
|
||||
type="movement"
|
||||
direction=$mvt_new.direction
|
||||
operation=$_POST.operation
|
||||
amount=$mvt_new.amount|intval
|
||||
equipment=$eqpmt_key
|
||||
date=$mvt_new.date
|
||||
comment=$mvt_new.comment
|
||||
user=$user.id
|
||||
}}
|
||||
{{:redirect force="../historique.html?ok=1&key=%s&prop=%s&msg=copie"|args:$eqpmt_key:$prop}}
|
||||
{{/if}}
|
||||
{{:save
|
||||
key=$equipment.key
|
||||
validate_schema="../equipment.schema.json"
|
||||
type="equipment"
|
||||
category=$equipment.category
|
||||
name=$equipment.name
|
||||
status="available"
|
||||
stock=$equipment.stock
|
||||
out=$equipment.out
|
||||
notowned=$equipment.notowned
|
||||
}}
|
||||
{{* vérification réussie : enregistrer le nouveau mouvement *}}
|
||||
{{:assign mvt_key=""|uuid}}
|
||||
{{:save
|
||||
key=$mvt_key
|
||||
validate_schema="movement.schema.json"
|
||||
type="movement"
|
||||
direction=$mvt_new.direction
|
||||
operation=$_POST.operation
|
||||
amount=$mvt_new.amount|intval
|
||||
equipment=$eqpmt_key
|
||||
date=$mvt_new.date
|
||||
comment=$mvt_new.comment
|
||||
user=$user.id
|
||||
storage=$_POST.storage
|
||||
}}
|
||||
{{:redirect force="../historique.html?ok=1&key=%s&prop=%s&msg=copie"|args:$eqpmt_key:$prop}}
|
||||
{{/form}}
|
||||
|
||||
{{:admin_header title="Dupliquer un mouvement" current="module_equipment"}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue