diff --git a/_get_config.html b/_get_config.html
index 0ebc002..07ef418 100644
--- a/_get_config.html
+++ b/_get_config.html
@@ -26,3 +26,9 @@
{{/foreach}}
{{/if}}
{{/foreach}}
+
+{{if $module.config.loan_duration != null}}
+ {{:assign loan_duration=$module.config.loan_duration}}
+{{else}}
+ {{:assign loan_duration=$config_defaut.loan_duration}}
+{{/if}}
diff --git a/_inventory.html b/_inventory.html
index ce8cffc..213bcc9 100644
--- a/_inventory.html
+++ b/_inventory.html
@@ -112,7 +112,7 @@
{{else}}
{{:assign prop="&prop=%s"|args:$selected_prop}}
{{/if}}
-
{{:link href="equipment_history.html?key=%s&prop=%s"|args:$key:$selected_prop label=$name}} |
+ {{:link href="equipment_history.html?key=%s&prop=%s"|args:$key:$selected_prop" label=$name}} |
{{$cat_name}} |
{{$stock}} |
{{$col4}} |
@@ -120,8 +120,22 @@
{{$out}} |
{{$col7}} |
+{{*
+ {{if $col7 > 0}}
+ {{:linkbutton
+ label="Sortie"
+ shape="minus"
+ href="movements/output_equipment.html?key=%s"|args:$key
+ target="_dialog"}}
+ {{/if}}
+ {{:linkbutton
+ label="Entrée"
+ shape="plus"
+ href="movements/input_equipment.html?key=%s"|args:$key
+ target="_dialog"}}
+*}}
{{:linkbutton
- label="Mouvements"
+ label="Historique"
href="equipment_history.html?key=%s&prop=1"|args:$key
shape="table"}}
{{:linkbutton
diff --git a/_nav.html b/_nav.html
index c615e3d..10a41d0 100644
--- a/_nav.html
+++ b/_nav.html
@@ -3,29 +3,13 @@
diff --git a/archives.html b/archives.html
index 5525aab..efb1a22 100644
--- a/archives.html
+++ b/archives.html
@@ -66,11 +66,11 @@
}}
|
- | {{:link href="equipment_history.html?key=%s&prop=1¤t=archives"|args:$key label=$name}} |
+ {{$name}} |
{{$col2}} |
{{:linkbutton
- label="Mouvements"
+ label="Historique"
href="equipment_history.html?key=%s&prop=1¤t=archives"|args:$key
shape="table"}}
{{:linkbutton
diff --git a/config.schema.json b/config.schema.json
index 1f9213c..8395b2f 100644
--- a/config.schema.json
+++ b/config.schema.json
@@ -36,11 +36,6 @@
"type" : {
"type" : "string",
"enum" : ["définitif", "temporaire", "retour"]
- },
- "fee" : {
- "description" : "tarif sortie temporaire",
- "type" : ["string", "null"],
- "enum" : ["gratuit", "payant"]
}
}
}
diff --git a/config/misc.html b/config/misc.html
index 7034c04..ba11eec 100644
--- a/config/misc.html
+++ b/config/misc.html
@@ -3,9 +3,9 @@
{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
{{#form on="save"}}
- {{* vérifier la validité de la durée saisie *}}
- {{if $_POST.loan_duration < 0}}
- {{:error message="Durée (%s) erronée ; doit être >= 0"|args:$_POST.loan_duration}}
+ {{* vérifier la valisité de la durée saisie *}}
+ {{if $_POST.loan_duration <= 0}}
+ {{:error message="Durée (%s) erronée ; doit être > 0"|args:$_POST.loan_duration}}
{{/if}}
{{:save
@@ -30,7 +30,7 @@
diff --git a/default.json b/default.json
index ab06a2c..b9906b7 100644
--- a/default.json
+++ b/default.json
@@ -26,19 +26,13 @@
{
"key" : "c9ba00d9-26ee-448b-9f02-73e479ec2980",
"label" : "Prêt",
- "type" : "temporaire",
- "fee" : "gratuit"
- },
- {
- "key" : "5c6c20bf-53e9-49dc-bcd6-e3cac23a6786",
- "label" : "Location",
- "type" : "temporaire",
- "fee" : "payant"
+ "type" : "temporaire"
},
{
"key" : "fefefa51-1a85-46ca-ab78-b594b10390ff",
"label" : "Retour de Location/Emprunt",
"type" : "retour"
}
- ]
+ ],
+ "loan_duration" : "30"
}
diff --git a/equipment_history.html b/equipment_history.html
index 5db0fb6..83c0860 100644
--- a/equipment_history.html
+++ b/equipment_history.html
@@ -31,6 +31,25 @@
{{else}}
{{:assign current="inventaire"}}
{{/if}}
+{{:include file="./_nav.html" current=$current subcurrent="historique" eqpmt=$equipment.name category=$category.name}}
+
+{{if $_GET.ok}}
+ {{if $_GET.msg == "modification"}}
+ Modification enregistrée
+ {{elseif $_GET.msg == "copie"}}
+ Mouvement copié
+ {{elseif $_GET.msg == "retour"}}
+ Retour enregistré
+ {{elseif $_GET.msg == "suppression"}}
+ Mouvement supprimé
+ {{else}}
+ Mouvement enregistré
+ {{/if}}
+{{elseif $_GET.err}}
+ {{if $_GET.msg == "suppression"}}
+ Ce mouvement ne peut être supprimé
+ {{/if}}
+{{/if}}
{{* récupérer la config des entrées/sorties *}}
{{:include file="./_get_config.html" keep="config"}}
@@ -229,29 +248,6 @@
{{:assign var="prop_options." value="1" label="Matériels propriété de l'association" href="?key=%s&prop=1"|args:$_GET.key}}
{{:assign var="prop_options." value="0" label="Matériels NON propriété de l'association" href="?key=%s&prop=0"|args:$_GET.key}}
-{{if $dispo_final > 0 && $selected_prop == null || $selected_prop}}
- {{:assign sortie="sortie"}}
-{{/if}}
-{{:include file="./_nav.html" current=$current subcurrent="mouvements" eqpmt=$equipment.name category=$category.name sortie=$sortie key=$_GET.key}}
-
-{{if $_GET.ok}}
- {{if $_GET.msg == "modification"}}
- Modification enregistrée
- {{elseif $_GET.msg == "copie"}}
- Mouvement copié
- {{elseif $_GET.msg == "retour"}}
- Retour enregistré
- {{elseif $_GET.msg == "suppression"}}
- Mouvement supprimé
- {{else}}
- Mouvement enregistré
- {{/if}}
-{{elseif $_GET.err}}
- {{if $_GET.msg == "suppression"}}
- Ce mouvement ne peut être supprimé
- {{/if}}
-{{/if}}
-
+{{if $current != "archives"}}
+
+{{/if}}
+
{{* lister les mouvements du matériel passé en paramètre *}}
{{#list
type="movement"
@@ -268,7 +275,6 @@
where="%s"|args:$prop_condition
equipment=$equipment_key
order=1
- desc=true
}}
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$direction:$operation}}
{{:assign var="op_label" from="config.%s_nature.%s.label"|args:$direction:$operation}}
@@ -316,19 +322,12 @@
| {{if $transactions|count > 0}}{{"Oui"}}{{/if}} |
{{if $current != "archives"}}
- {{if $direction == "output" && $type_mvt == "retour"}}
- {{:assign prop = 0}}
- {{elseif $direction == "input" && $type_mvt == "temporaire"}}
- {{:assign prop = 0}}
- {{else}}
- {{:assign prop = 1}}
- {{/if}}
{{if $direction == "output" && $type_mvt == "temporaire"}}
{{:assign var="temp_ext" from="reste.%s"|args:$key}}
{{if $temp_ext != null && $temp_ext > 0}}
{{:linkbutton
label="Retour"
- href="movements/output_return.html?key=%s&prop=%s"|args:$key:$prop
+ href="movements/output_return.html?key=%s&prop=%s"|args:$key:$selected_prop
shape="reset"
target="_dialog"}}
{{/if}}
@@ -338,14 +337,14 @@
{{if $temp_in != null && $temp_in > 0}}
{{:linkbutton
label="Retour"
- href="movements/input_return.html?key=%s&prop=%s"|args:$key:$prop
+ href="movements/input_return.html?key=%s&prop=%s"|args:$key:$selected_prop
shape="reset"
target="_dialog"}}
{{/if}}
{{/if}}
{{:linkbutton
label="Détails"
- href="movements/movement_details.html?key=%s&prop=%s&from=eh"|args:$key:$prop
+ href="movements/movement_details.html?key=%s&prop=%s&from=eh"|args:$key:$selected_prop
shape="eye"
}}
{{/if}}
@@ -353,6 +352,10 @@
|
{{/list}}
+{{if $dispo_final == 0 && $stock > 0 && $current != "archives"}}
+ Il n'y a aucun matériel disponible, il n'est donc pas possible d'effectuer une sortie
+{{/if}}
+
{{:admin_footer}}
diff --git a/index.html b/index.html
index d05fab9..740bf3b 100644
--- a/index.html
+++ b/index.html
@@ -14,9 +14,6 @@
{{else}}
{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
- {{#load type="category" count=true limit=1 assign="result"}}{{/load}}
- {{:include file="_nav.html" current="inventaire" cat="%d"|args:$result.count subcurrent="stock"}}
-
{{if $_GET.ok}}
{{if $_GET.msg == "ajout" }}
Ajout effectué
@@ -31,6 +28,9 @@
Modification refusée
{{/if}}
+ {{#load type="category" count=true limit=1 assign="result"}}{{/load}}
+ {{:include file="_nav.html" current="inventaire" cat="%d"|args:$result.count subcurrent="stock"}}
+
{{if $result.count == 0}}
Il n'y a aucune catégorie : vous devez en ajouter.
{{else}}
diff --git a/loan_history.html b/loan_history.html
index 92c4ee1..a7ff7de 100644
--- a/loan_history.html
+++ b/loan_history.html
@@ -99,6 +99,10 @@
}}
+
+
{{:assign premier=true}}
{{#select
users.nom AS nom,
diff --git a/loan_movements.html b/loan_movements.html
index cf9fcda..4a3f859 100644
--- a/loan_movements.html
+++ b/loan_movements.html
@@ -104,6 +104,10 @@
}}
+
+
{{* lister les mouvements *}}
{{:assign premier=true}}
{{#select * FROM
diff --git a/member_loan.html b/member_loan.html
index 28f7278..9f40061 100644
--- a/member_loan.html
+++ b/member_loan.html
@@ -42,6 +42,10 @@
{{:assign out_keys=$out_keys|implode:","}}
{{:assign out_keys="("|cat:$out_keys|cat:")"}}
+
+
{{:assign premier=true}}
{{#select
nom, user, GROUP_CONCAT(mat_name, ", ") AS materiel, SUM(remain) AS quantite
@@ -86,20 +90,12 @@
{{$materiel}} |
{{else}}
- {{if $label == "prêt"}}
- Aucun {{$label}} en cours.
- {{elseif $label == "location"}}
- Aucune {{$label}} en cours.
- {{/if}}
+ Aucun mouvement.
{{/select}}
{{else}}
- {{if $label == "prêt"}}
- Aucun {{$label}} en cours.
- {{elseif $label == "location"}}
- Aucune {{$label}} en cours.
- {{/if}}
+ Aucun mouvement.
{{/if}}
{{:admin_footer}}
diff --git a/movements/add_new_equipment.html b/movements/add_new_equipment.html
index 456cfdd..30614d6 100644
--- a/movements/add_new_equipment.html
+++ b/movements/add_new_equipment.html
@@ -150,7 +150,7 @@