Simplification calcul dispo et config par défaut
This commit is contained in:
parent
d7f7ec9423
commit
af9dbf2b22
14 changed files with 260 additions and 304 deletions
|
|
@ -29,33 +29,27 @@
|
|||
{{#load
|
||||
type="movement"
|
||||
where="$$.equipment = :key" :key=$key_eqpmt_suppr
|
||||
assign="movement"
|
||||
assign="mvt"
|
||||
order="$$.date"}}
|
||||
|
||||
{{* déterminer le type de mouvement *}}
|
||||
{{:assign var="mvt_nature" from="mvt.%s_nature"|args:$mvt.direction}}
|
||||
{{:assign var="type_mvt" from="config.%s_nature.%s"|args:$mvt.direction:$mvt_nature}}
|
||||
|
||||
{{if $key != $_GET.key}}
|
||||
{{* ce n'est pas le mouvement à supprimer : cumuler les entrées/sorties *}}
|
||||
{{if $movement.direction == 'input'}}
|
||||
{{* chercher le type d'entrée parmi les types de la config *}}
|
||||
{{#foreach from=$config.input_nature item="elem"}}
|
||||
{{if $movement.input_nature == $elem.label}}
|
||||
{{if $elem.type == 'temporaire'}}
|
||||
{{:assign nonprop="%d+%d"|math:$nonprop:$movement.amount}}
|
||||
{{else}}
|
||||
{{:assign dispo="%d+%d"|math:$dispo:$movement.amount}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{elseif $movement.direction == 'output'}}
|
||||
{{* chercher le type de sortie parmi les types de la config *}}
|
||||
{{#foreach from=$config.output_nature item="elem"}}
|
||||
{{if $movement.output_nature == $elem.label}}
|
||||
{{if $elem.type == 'retour'}}
|
||||
{{:assign nonprop="%d-%d"|math:$nonprop:$movement.amount}}
|
||||
{{else}}
|
||||
{{:assign dispo="%d-%d"|math:$dispo:$movement.amount}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{if $mvt.direction == 'input'}}
|
||||
{{if $type_mvt == 'temporaire'}}
|
||||
{{:assign nonprop="%d+%d"|math:$nonprop:$mvt.amount}}
|
||||
{{else}}
|
||||
{{:assign dispo="%d+%d"|math:$dispo:$mvt.amount}}
|
||||
{{/if}}
|
||||
{{elseif $mvt.direction == 'output'}}
|
||||
{{if $type_mvt == 'retour'}}
|
||||
{{:assign nonprop="%d-%d"|math:$nonprop:$mvt.amount}}
|
||||
{{else}}
|
||||
{{:assign dispo="%d-%d"|math:$dispo:$mvt.amount}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{* problème ? *}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue