equipment/mouvements/sorties/_calcul_dispo.html

10 lines
424 B
HTML

{{* cumuler les entrées et les sorties de ce matériel *}}
{{:assign var="dispo" value=0}}
{{#load type="movement" where="$$.equipment = :eqpmt_key" :eqpmt_key=$equipment.key assign="movement"}}
{{if $movement.direction === 'entrée'}}
{{:assign dispo="%d+%d"|math:$dispo:$movement.amount}}
{{else}}
{{:assign dispo="%d-%d"|math:$dispo:$movement.amount}}
{{/if}}
{{/load}}