Correction erreur retour d'entrée temporaire
This commit is contained in:
parent
638855e6fc
commit
99ed711eb7
@ -3,7 +3,7 @@
|
|||||||
{{*
|
{{*
|
||||||
Enregistrer un retour d'entrée temporaire
|
Enregistrer un retour d'entrée temporaire
|
||||||
paramètres :
|
paramètres :
|
||||||
- key : clé du mouvement
|
- key : clé de l'entrée temporaire
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* infos du mouvement *}}
|
{{* infos du mouvement *}}
|
||||||
@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
{{* préparer le nouveau mouvement *}}
|
{{* préparer le nouveau mouvement *}}
|
||||||
{{:assign var="mvt_new.key" value=""|uuid}}
|
{{:assign var="mvt_new.key" value=""|uuid}}
|
||||||
{{:assign var="mvt_new.direction" value="input"}}
|
{{:assign var="mvt_new.direction" value="output"}}
|
||||||
{{:assign var="mvt_new.date" value=$_POST.date|parse_date}}
|
{{:assign var="mvt_new.date" value=$_POST.date|parse_date}}
|
||||||
{{:assign var="mvt_new.operation" value=$_POST.operation}}
|
{{:assign var="mvt_new.operation" value=$_POST.operation}}
|
||||||
{{:assign var="mvt_new.amount" value=$_POST.amount}}
|
{{:assign var="mvt_new.amount" value=$_POST.amount}}
|
||||||
@ -111,16 +111,18 @@
|
|||||||
keep="erreur, pb"
|
keep="erreur, pb"
|
||||||
movements=$movements_new
|
movements=$movements_new
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{if $erreur}}
|
{{if $erreur}}
|
||||||
<p class="block error">Impossible d'enregistrer ce mouvement.
|
{{:assign message="Impossible d'enregistrer ce mouvement."}}
|
||||||
{{if $pb.mvt.key != $mvt_new.key}}
|
{{if $pb.mvt.key != $mvt_new.key}}
|
||||||
{{:assign var="err_mvt_label" from="config.input_nature.%s.label"|args:$pb.mvt.operation}}
|
{{:assign var="err_mvt_label" from="config.output_nature.%s.label"|args:$pb.mvt.operation}}
|
||||||
<br />Mouvement incompatible avec
|
{{:assign date_pb=$pb.mvt.date|date_short}}
|
||||||
« {{$err_mvt_label}} » : « {{$equipment.name}} (qté : {{$pb.mvt.amount}})
|
{{:assign var=message2 value=" Mouvement incompatible avec « %s » : « %s (qté : %s) en date du %s »."|args:$err_mvt_label:$equipment.name:$pb.mvt.amount:$date_pb}}
|
||||||
en date du {{$pb.mvt.date|date_short}} ».
|
{{:assign message=$message|cat:$message2}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</p>
|
{{:error message=$message}}
|
||||||
{{else}}
|
{{/if}}
|
||||||
|
|
||||||
{{* calculer la nouvelle quantité du matériel *}}
|
{{* calculer la nouvelle quantité du matériel *}}
|
||||||
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$_POST.operation}}
|
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$_POST.operation}}
|
||||||
{{:assign var="equipment.notowned" value="%d-%d"|math:$equipment.notowned:$_POST.amount|intval}}
|
{{:assign var="equipment.notowned" value="%d-%d"|math:$equipment.notowned:$_POST.amount|intval}}
|
||||||
@ -160,7 +162,6 @@
|
|||||||
return=$mvt_key
|
return=$mvt_key
|
||||||
}}
|
}}
|
||||||
{{:redirect force="../historique.html?ok=1&key=%s&prop=0&msg=retour"|args:$mvt_new.equipment}}
|
{{:redirect force="../historique.html?ok=1&key=%s&prop=0&msg=retour"|args:$mvt_new.equipment}}
|
||||||
{{/if}}
|
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:admin_header title="Retour de matériel" custom_css="./../../style.css" current="module_equipment"}}
|
{{:admin_header title="Retour de matériel" custom_css="./../../style.css" current="module_equipment"}}
|
||||||
|
Loading…
Reference in New Issue
Block a user