diff --git a/global_history.html b/global_history.html index a6ef606..726075e 100644 --- a/global_history.html +++ b/global_history.html @@ -32,6 +32,17 @@ }} +{{* condition de filtrage *}} +{{if $_GET.cat_key != null}} + {{:assign condition="(SELECT key + FROM @TABLE AS cat + WHERE cat.key = (SELECT $$.category + FROM @TABLE AS mat + WHERE mat.key = @TABLE.$$.equipment)) = '%s'"|args:$_GET.cat_key}} +{{else}} + {{:assign condition=1}} +{{/if}} + {{* lister tous les mouvements *}} {{#list type="movement" @@ -52,17 +63,11 @@ END as 'Stockage'; $$.comment AS 'Commentaire' "|args:$config.user_fields.name_sql + where="%s"|args:$condition order=1 + max=50 desc=true }} - {{* filtrer selon la catégorie *}} - {{#load key=$equipment}} - {{:assign cat_key=$category}} - {{/load}} - {{if $_GET.cat_key != null && $cat_key != $_GET.cat_key}} - {{:continue}} - {{/if}} - {{:assign var="op_label" from="config.%s_nature.%s.label"|args:$direction:$operation}}