From ec249b78ee31a0d32b8d8aba04d6b36923ce1b4a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Mon, 19 May 2025 14:16:06 +0200 Subject: [PATCH] =?UTF-8?q?Modification=20condition=20archivage=20mat?= =?UTF-8?q?=C3=A9riel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _inventory.html | 2 +- modify_equipment.html | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/_inventory.html b/_inventory.html index 4c2a8aa..1a84d48 100644 --- a/_inventory.html +++ b/_inventory.html @@ -77,7 +77,7 @@ shape="table"}} {{:linkbutton label="Modifier" - href="modify_equipment.html?key=%s&prop=1&stock=%s"|args:$key:$col3 + href="modify_equipment.html?key=%s&prop=1"|args:$key shape="edit" target="_dialog"}} diff --git a/modify_equipment.html b/modify_equipment.html index 10c0ce2..d36c78b 100644 --- a/modify_equipment.html +++ b/modify_equipment.html @@ -3,7 +3,7 @@ {{* Paramètres : - key : clé du matériel à modifier - - prop : =1 si matériel propriété de l'association + - prop : =1 si matériel propriété de l'association, 0 sinon *}} {{:assign equipment_key=$_GET.key|trim}} @@ -17,9 +17,11 @@ {{#form on="save"}} {{if $_POST.archive == 1}} - {{* vérifier si le stock est nul *}} - {{if $_GET.stock != 0}} + {{* vérifier les qunatités *}} + {{if $_GET.prop == 1 && $equipment.stock != 0}} {{:error message="L'archivage n'est possible que si le stock est nul !"}} + {{elseif $_GET.prop == 0 && $equipment.notowned != 0}} + {{:error message="L'archivage n'est possible que s'il n'y a plus de matériel présent temporairement"}} {{/if}} {{* archiver le matériel *}} {{:save