Amélioration condition filtrage compatible pagination

This commit is contained in:
Jean-Christophe Engel 2025-04-24 10:15:30 +02:00
parent 96251821da
commit 4736cce759

View File

@ -32,6 +32,17 @@
}}
</fieldset>
{{* 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}}
<tr>
<td>{{$date|date_short}}</td>