Dissocier dans l'inventaire les matériels propriété de l'asso ou non

This commit is contained in:
Jean-Christophe Engel 2024-10-18 17:15:56 +02:00
parent 5e5c470a24
commit 7575cc8a71
4 changed files with 57 additions and 20 deletions

View file

@ -10,25 +10,60 @@
{{/load}}
{{:admin_header title="Historique des mouvements de %s (%s)"|args:$equipment.designation:$category.name current="module_equipment"}}
{{* récupérer la config des entrées/sorties *}}
{{:include file="./_get_config.html" keep="config"}}
{{* déterminer les type de mouvements selon l'affection du matériel *}}
{{#foreach from=$config.input_nature key=mvt item=type_mvt}}
{{if $_GET.prop}}
{{* matériel propriété de l'asso *}}
{{if $type_mvt != 'temporaire'}}
{{:assign var="input_types." value=$mvt}}
{{/if}}
{{else}}
{{* matériel non propriété de l'asso *}}
{{if $type_mvt == 'temporaire'}}
{{:assign var="input_types." value=$mvt}}
{{/if}}
{{/if}}
{{/foreach}}
{{#foreach from=$config.output_nature key=mvt item=type_mvt}}
{{if $_GET.prop}}
{{* matériel propriété de l'asso *}}
{{if $type_mvt != 'retour'}}
{{:assign var="output_types." value=$mvt}}
{{/if}}
{{else}}
{{* matériel non propriété de l'asso *}}
{{if $type_mvt == 'retour'}}
{{:assign var="output_types." value=$mvt}}
{{/if}}
{{/if}}
{{/foreach}}
{{* lister tous les mouvements du matériel passé en paramètre *}}
{{#list
type="movement"
select="$$.date AS 'Date';
CASE $$.direction WHEN 'input' THEN 'Entrée' WHEN 'output' THEN 'Sortie' END AS 'Mvt';
CASE $$.direction WHEN 'input' THEN $$.input_nature WHEN 'output' THEN $$.output_nature END AS 'Type';
CASE $$.direction WHEN 'input' THEN $$.input_nature WHEN 'output' THEN $$.output_nature END AS 'Type';
$$.amount AS 'Nombre';
$$.comment AS 'Commentaire'"
equipment=$equipment_key
order=1
}}
<tr>
<td>{{$date|date_short}}</td>
<td>{{$col2}}</td>
<td>{{$col3}}</td>
<td>{{$amount}}</td>
<td>{{$comment}}</td>
<td></td>
</tr>
{{if $direction === "input" && $input_nature|in:$input_types ||
$direction === "output" && $output_nature|in:$output_types
}}
<tr>
<td>{{$date|date_short}}</td>
<td>{{$col2}}</td>
<td>{{$col3}}</td>
<td>{{$amount}}</td>
<td>{{$comment}}</td>
<td></td>
</tr>
{{/if}}
{{/list}}
{{:admin_footer}}