From 18d9ad9699a20722c8ff0568a1a2715a108fae3c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Wed, 22 Oct 2025 17:31:13 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20pr=C3=A9sentation=20inventa?= =?UTF-8?q?ire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- equipment_history.html | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/equipment_history.html b/equipment_history.html index 9685b1b..7f5c096 100644 --- a/equipment_history.html +++ b/equipment_history.html @@ -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"}} {{/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 @@ {{$dispo}} {{:link href="/admin/users/details.php?id=%s"|args:$user label="%s"|args:$col8}} {{$col9}} - {{if $nb_files > 0}}{{:tag label="%s"|args:$nb_files}}{{:icon shape="attach"}}{{/if}} + {{if $nb_files > 0}}{{:icon shape="attach"}}{{/if}} + {{if $transactions|count > 0}}{{:icon shape="money"}}{{/if}} {{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 @@ {{/if}} {{/list}} - + {{if $dispo_final === 0}} + Il n'y a aucun matériel disponible, il n'est donc pas possible d'effectuer une sortie + {{/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}} {{$date|date_short}} {{$col2}} @@ -288,13 +299,14 @@ {{$amount}} {{$stock}} {{$col6}} + {{if $nb_files > 0}}{{:icon shape="attach"}}{{/if}} + {{if $transactions|count > 0}}{{:icon shape="money"}}{{/if}} {{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"}}