suppression référence à la table du module dans mouvements/modifier_mouvement.html

This commit is contained in:
Jean-Christophe Engel 2023-12-06 10:46:00 +01:00
parent db497af1f3
commit d19c4ce3fd

View File

@ -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}}