amélioration affichage erreur
This commit is contained in:
parent
99ed711eb7
commit
96251821da
2 changed files with 76 additions and 77 deletions
|
|
@ -141,31 +141,30 @@
|
|||
}}
|
||||
{{if $erreur}}
|
||||
{{:assign var="mvt_label" from="%s_labels.%s"|args:$mvt_new.direction:$mvt_new.operation}}
|
||||
<p class="block error">
|
||||
Impossible d'enregistrer ce mouvement : « {{$mvt_label}}
|
||||
de {{$equipment.name}} (qté : {{$mvt_new.amount}}) à la date du {{$mvt_new.date|date_short}} »
|
||||
</p>
|
||||
{{else}}
|
||||
{{* calculer la nouvelle quantité du matériel *}}
|
||||
{{if $mvt_new.direction == "input"}}
|
||||
{{:assign var="type_mvt" from="config.input_nature.%s.type"|args:$_POST.operation}}
|
||||
{{if $type_mvt == 'définitif'}}
|
||||
{{:assign var="equipment.stock" value="%d+%d"|math:$equipment.stock:$_POST.amount|intval}}
|
||||
{{elseif $type_mvt == 'temporaire'}}
|
||||
{{:assign var="equipment.notowned" value="%d+%d"|math:$equipment.notowned:$_POST.amount|intval}}
|
||||
{{elseif $type_mvt == 'retour'}}
|
||||
{{:assign var="equipment.out" value="%d-%d"|math:$equipment.out:$_POST.amount|intval}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$_POST.operation}}
|
||||
{{if $type_mvt == 'définitif'}}
|
||||
{{:assign var="equipment.stock" value="%d-%d"|math:$equipment.stock:$_POST.amount|intval}}
|
||||
{{elseif $type_mvt == 'temporaire'}}
|
||||
{{:assign var="equipment.out" value="%d+%d"|math:$equipment.out:$_POST.amount|intval}}
|
||||
{{elseif $type_mvt == 'retour'}}
|
||||
{{:assign var="equipment.notowned" value="%d-%d"|math:$equipment.notowned:$_POST.amount|intval}}
|
||||
{{/if}}
|
||||
{{:assign new_date=$mvt_new.date|date_short}}
|
||||
{{:error message="Impossible d'enregistrer ce mouvement : « %s de %s (qté : %s) à la date du %s »"|args:$mvt_label:$equipment.name:$mvt_new.amount:$new_date}}
|
||||
{{/if}}
|
||||
|
||||
{{* calculer la nouvelle quantité du matériel *}}
|
||||
{{if $mvt_new.direction == "input"}}
|
||||
{{:assign var="type_mvt" from="config.input_nature.%s.type"|args:$_POST.operation}}
|
||||
{{if $type_mvt == 'définitif'}}
|
||||
{{:assign var="equipment.stock" value="%d+%d"|math:$equipment.stock:$_POST.amount|intval}}
|
||||
{{elseif $type_mvt == 'temporaire'}}
|
||||
{{:assign var="equipment.notowned" value="%d+%d"|math:$equipment.notowned:$_POST.amount|intval}}
|
||||
{{elseif $type_mvt == 'retour'}}
|
||||
{{:assign var="equipment.out" value="%d-%d"|math:$equipment.out:$_POST.amount|intval}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$_POST.operation}}
|
||||
{{if $type_mvt == 'définitif'}}
|
||||
{{:assign var="equipment.stock" value="%d-%d"|math:$equipment.stock:$_POST.amount|intval}}
|
||||
{{elseif $type_mvt == 'temporaire'}}
|
||||
{{:assign var="equipment.out" value="%d+%d"|math:$equipment.out:$_POST.amount|intval}}
|
||||
{{elseif $type_mvt == 'retour'}}
|
||||
{{:assign var="equipment.notowned" value="%d-%d"|math:$equipment.notowned:$_POST.amount|intval}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{:save
|
||||
key=$equipment.key
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue