diff --git a/mouvements/modifier_mouvement.html b/mouvements/modifier_mouvement.html
index 58b52d2..f48bc4a 100644
--- a/mouvements/modifier_mouvement.html
+++ b/mouvements/modifier_mouvement.html
@@ -69,26 +69,15 @@
en l'insérant à sa place par date croissante
*}}
{{:assign insere=false}}
- {{#select
- id, key,
- json_extract(document, '$.type') as 'type',
- json_extract(document, '$.direction') as 'direction',
- json_extract(document, '$.input_nature') as 'input_nature',
- json_extract(document, '$.output_nature') as 'output_nature',
- json_extract(document, '$.amount') as 'amount',
- json_extract(document, '$.equipment') as 'equipment',
- json_extract(document, '$.date') as 'date',
- json_extract(document, '$.comment') as 'comment'
- FROM module_data_equipment
- WHERE
- json_extract(document, '$.type') = 'movement'
+
+ {{#load
+ where="
+ $$.type = 'movement'
AND
- (json_extract(document, '$.equipment') = :old_eqpmt_key
- OR
- json_extract(document, '$.equipment') = :new_eqpmt_key)
- ORDER BY json_extract(document, '$.date');
+ ($$.equipment = :old_eqpmt_key OR $$.equipment = :new_eqpmt_key)"
:old_eqpmt_key=$key_eqpmt_init
:new_eqpmt_key=$_POST.equipment
+ order="$$.date"
assign="movement"
}}
{{if $key != $key_mvt}}
@@ -98,7 +87,7 @@
{{/if}}
{{:assign var=movements_modif." from=movement}}
{{/if}}
- {{/select}}
+ {{/load}}
{{if ! $insere}}
{{:assign var=movements_modif." from=mvt_modif}}
{{/if}}