diff --git a/_get_config.html b/_get_config.html
index 07ef418..0ebc002 100644
--- a/_get_config.html
+++ b/_get_config.html
@@ -26,9 +26,3 @@
{{/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 213bcc9..ce8cffc 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,22 +120,8 @@
{{$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="Historique"
+ label="Mouvements"
href="equipment_history.html?key=%s&prop=1"|args:$key
shape="table"}}
{{:linkbutton
diff --git a/_nav.html b/_nav.html
index 10a41d0..c615e3d 100644
--- a/_nav.html
+++ b/_nav.html
@@ -3,13 +3,29 @@
diff --git a/archives.html b/archives.html
index efb1a22..5525aab 100644
--- a/archives.html
+++ b/archives.html
@@ -66,11 +66,11 @@
}}
|
- | {{$name}} |
+ {{:link href="equipment_history.html?key=%s&prop=1¤t=archives"|args:$key label=$name}} |
{{$col2}} |
{{:linkbutton
- label="Historique"
+ label="Mouvements"
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 8395b2f..1f9213c 100644
--- a/config.schema.json
+++ b/config.schema.json
@@ -36,6 +36,11 @@
"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 ba11eec..7034c04 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 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}}
+ {{* 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}}
{{/if}}
{{:save
@@ -30,7 +30,7 @@
diff --git a/default.json b/default.json
index b9906b7..ab06a2c 100644
--- a/default.json
+++ b/default.json
@@ -26,13 +26,19 @@
{
"key" : "c9ba00d9-26ee-448b-9f02-73e479ec2980",
"label" : "Prêt",
- "type" : "temporaire"
+ "type" : "temporaire",
+ "fee" : "gratuit"
+ },
+ {
+ "key" : "5c6c20bf-53e9-49dc-bcd6-e3cac23a6786",
+ "label" : "Location",
+ "type" : "temporaire",
+ "fee" : "payant"
},
{
"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 83c0860..5db0fb6 100644
--- a/equipment_history.html
+++ b/equipment_history.html
@@ -31,25 +31,6 @@
{{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"}}
@@ -248,6 +229,29 @@
{{: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"
@@ -275,6 +268,7 @@
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}}
@@ -322,12 +316,19 @@
| {{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:$selected_prop
+ href="movements/output_return.html?key=%s&prop=%s"|args:$key:$prop
shape="reset"
target="_dialog"}}
{{/if}}
@@ -337,14 +338,14 @@
{{if $temp_in != null && $temp_in > 0}}
{{:linkbutton
label="Retour"
- href="movements/input_return.html?key=%s&prop=%s"|args:$key:$selected_prop
+ href="movements/input_return.html?key=%s&prop=%s"|args:$key:$prop
shape="reset"
target="_dialog"}}
{{/if}}
{{/if}}
{{:linkbutton
label="Détails"
- href="movements/movement_details.html?key=%s&prop=%s&from=eh"|args:$key:$selected_prop
+ href="movements/movement_details.html?key=%s&prop=%s&from=eh"|args:$key:$prop
shape="eye"
}}
{{/if}}
@@ -352,10 +353,6 @@
|
{{/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 740bf3b..d05fab9 100644
--- a/index.html
+++ b/index.html
@@ -14,6 +14,9 @@
{{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é
@@ -28,9 +31,6 @@
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 a7ff7de..92c4ee1 100644
--- a/loan_history.html
+++ b/loan_history.html
@@ -99,10 +99,6 @@
}}
-
-
{{:assign premier=true}}
{{#select
users.nom AS nom,
diff --git a/loan_movements.html b/loan_movements.html
index 4a3f859..cf9fcda 100644
--- a/loan_movements.html
+++ b/loan_movements.html
@@ -104,10 +104,6 @@
}}
-
-
{{* lister les mouvements *}}
{{:assign premier=true}}
{{#select * FROM
diff --git a/member_loan.html b/member_loan.html
index 9f40061..28f7278 100644
--- a/member_loan.html
+++ b/member_loan.html
@@ -42,10 +42,6 @@
{{: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
@@ -90,12 +86,20 @@
{{$materiel}} |
{{else}}
- Aucun mouvement.
+ {{if $label == "prêt"}}
+ Aucun {{$label}} en cours.
+ {{elseif $label == "location"}}
+ Aucune {{$label}} en cours.
+ {{/if}}
{{/select}}
{{else}}
- Aucun mouvement.
+ {{if $label == "prêt"}}
+ Aucun {{$label}} en cours.
+ {{elseif $label == "location"}}
+ Aucune {{$label}} en cours.
+ {{/if}}
{{/if}}
{{:admin_footer}}
diff --git a/movements/add_new_equipment.html b/movements/add_new_equipment.html
index 30614d6..456cfdd 100644
--- a/movements/add_new_equipment.html
+++ b/movements/add_new_equipment.html
@@ -150,7 +150,7 @@