Amélioration présentation inventaire

This commit is contained in:
Jean-Christophe Engel 2025-10-22 17:31:13 +02:00
parent 2285c44a32
commit 18d9ad9699

View file

@ -113,20 +113,20 @@
{{:assign nonproprio="%d-%d"|math:$nonproprio:$amount}}
{{/if}}
{{/if}}
{{:assign dispo="%d-%d"|math:$stock:$exterieur}}
{{:assign dispo_final="%d-%d"|math:$stock:$exterieur}}
{{:assign var="quantites.%s.stock"|args:$id value=$stock}}
{{:assign var="quantites.%s.exterieur"|args:$id value=$exterieur}}
{{:assign var="quantites.%s.dispo"|args:$id value=$dispo}}
{{:assign var="quantites.%s.dispo"|args:$id value=$dispo_final}}
{{:assign var="quantites.%s.nonproprio"|args:$id value=$nonproprio}}
{{/load}}
{{if $current != "archives"}}
<nav class="tabs">
<aside>
{{if $_GET.prop && $equipment.stock > 0}}
{{:linkbutton label="Sortie" title="Enregistrer une sortie de ce matériel" shape="minus" href="movements/output_equipment.html?key=%s"|args:$_GET.key target="_dialog"}}
{{if $_GET.prop && $dispo_final > 0}}
{{:linkbutton label="Sortie" shape="minus" href="movements/output_equipment.html?key=%s"|args:$_GET.key target="_dialog"}}
{{/if}}
{{:linkbutton label="Entrée" title="Enregistrer une entrée de ce matériel" shape="plus" href="movements/input_equipment.html?key=%s"|args:$_GET.key target="_dialog"}}
{{:linkbutton label="Entrée" shape="plus" href="movements/input_equipment.html?key=%s"|args:$_GET.key target="_dialog"}}
</aside>
</nav>
{{/if}}
@ -177,7 +177,8 @@
THEN (SELECT $$.name FROM @TABLE as storage WHERE storage.key = @TABLE.$$.storage)
ELSE ''
END AS 'Stockage';
'' AS 'Doc'
'' AS 'Documents';
$$.transactions AS 'Écritures'
"|args:$config.user_fields.name_sql
equipment=$equipment_key
order=1
@ -207,7 +208,8 @@
<td class="num nosort">{{$dispo}}</td>
<td>{{:link href="/admin/users/details.php?id=%s"|args:$user label="%s"|args:$col8}}</td>
<td>{{$col9}}</td>
<td class="num nosort">{{if $nb_files > 0}}{{:tag label="%s"|args:$nb_files}}{{:icon shape="attach"}}{{/if}}</td>
<td class="num nosort">{{if $nb_files > 0}}{{:icon shape="attach"}}{{/if}}</td>
<td class="num">{{if $transactions|count > 0}}{{:icon shape="money"}}{{/if}}</td>
<td class="actions">
{{if $current != "archives"}}
{{if $direction == "output" && $type_mvt == "temporaire"}}
@ -215,7 +217,6 @@
{{if $temp_ext != null && $temp_ext > 0}}
{{:linkbutton
label="Retour"
title="Enregistrer un retour de sortie temporaire"
href="movements/output_return.html?key=%s&prop=%s"|args:$key:$_GET.prop
shape="reset"
target="_dialog"}}
@ -231,7 +232,9 @@
</tr>
{{/if}}
{{/list}}
{{if $dispo_final === 0}}
<span class="help">Il n'y a aucun matériel disponible, il n'est donc pas possible d'effectuer une sortie</span>
{{/if}}
{{else}}
{{* calculer la quantité présente temporairement de chaque matériel *}}
{{#foreach from=$config.input_nature key=key}}
@ -269,7 +272,9 @@
CASE WHEN $$.storage NOT NULL
THEN (SELECT $$.name FROM @TABLE as storage WHERE storage.key = @TABLE.$$.storage)
ELSE ''
END as 'Stockage'
END as 'Stockage';
'' AS 'Documents';
$$.transactions AS 'Écritures'
"
equipment=$equipment_key
order=1
@ -281,6 +286,12 @@
$direction === "output"&& $op_label|in:$output_types
}}
{{:assign var="stock" from="quantites.%s.nonproprio"|args:$id}}
{{:assign file_path="%s/%s/"|args:$module.storage_root:$key}}
{{:assign file_path=$file_path|cat:"%"}}
{{#select count(*) AS nb FROM files WHERE path LIKE :file_path ; :file_path=$file_path}}
{{:assign nb_files=$nb}}
{{/select}}
<tr>
<td>{{$date|date_short}}</td>
<td>{{$col2}}</td>
@ -288,13 +299,14 @@
<td class="num">{{$amount}}</td>
<td class="num nosort">{{$stock}}</td>
<td>{{$col6}}</td>
<td class="num nosort">{{if $nb_files > 0}}{{:icon shape="attach"}}{{/if}}</td>
<td class="num">{{if $transactions|count > 0}}{{:icon shape="money"}}{{/if}}</td>
<td class="actions">
{{if $direction == "input" && $type_mvt == "temporaire"}}
{{:assign var="temp_in" from="present.%s"|args:$key}}
{{if $temp_in != null && $temp_in > 0}}
{{:linkbutton
label="Retour"
title="Enregistrer un retour d'entrée temporaire"
href="movements/input_return.html?key=%s&prop=%s"|args:$key:$_GET.prop
shape="reset"
target="_dialog"}}