Distinguer matériel de stock nul et matériel non présent

This commit is contained in:
Jean-Christophe Engel 2025-04-04 11:07:41 +02:00
parent f8e5d43888
commit c681b47e7f
5 changed files with 58 additions and 24 deletions

View file

@ -87,6 +87,7 @@
- insérer le mvt modifié à sa place par date croissante
*}}
{{:assign insere=false}}
{{:assign entree_def=false}}
{{#load
where="
$$.type = 'movement'
@ -172,6 +173,24 @@
{{/if}}
{{/if}}
{{if $equipment.stock == 0}}
{{* vérifier s'il y a au moins une entrée définitive *}}
{{#foreach from=$config.input_nature key=key}}
{{if $type == 'définitif'}}
{{:assign var="input_types." value=$key}}
{{/if}}
{{/foreach}}
{{#foreach from=$movements_new}}
{{if $operation|in:$input_types}}
{{:assign entree_def=true}}
{{:break}}
{{/if}}
{{/foreach}}
{{if ! $entree_def}}
{{:assign var="equipment.stock" value=null}}
{{/if}}
{{/if}}
{{:save
key=$equipment.key
validate_schema="../equipment.schema.json"