diff --git a/README.md b/README.md
index 16a0479..d6e356b 100644
--- a/README.md
+++ b/README.md
@@ -3,12 +3,8 @@
Ce module permet de gérer les matériels de l'association: stock,
entrées, sorties, classés par catégorie.
-Un matériel peut entrer dans l'association :
-- temporairement (location, emprunt, ...)
-- définitivement (achat, ...)
-
-Dans les deux cas, il est possible de lui associer une écriture de la
-compta ou un fichier.
+Un matériel peut entrer temporairement (location, emprunt, ...) ou
+définitivement dans l'association (achat, ...).
Un matériel appartenant à l'association peut sortir :
- temporairement (prêt, ...) : il est possible de lui associer un lieu
diff --git a/_get_config.html b/_get_config.html
index 119a20b..8f36df8 100644
--- a/_get_config.html
+++ b/_get_config.html
@@ -1,8 +1,9 @@
{{* -*- brindille -*- *}}
{{*
- Récupérer la config
- résultat : config_defaut, directions, config.input_nature et config.output_nature
+ Récupérer soit la config enregistrée, soit la config par défaut
+ @param : default = true si config par défaut
+ résultat : config.input_nature et config.output_nature
*}}
{{* config par défaut *}}
@@ -14,7 +15,7 @@
{{#foreach from=$directions key="direction"}}
{{:assign var="nature" from="module.config.%s_nature"|args:$direction}}
- {{if $nature != null}}
+ {{if $nature != null && ! $default}}
{{#foreach from=$nature item="elem"}}
{{:assign var="item" label=$label type=$type}}
{{:assign var="config.%s_nature.%s"|args:$direction:$key value=$item}}
@@ -28,9 +29,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 b74bdbb..326070c 100644
--- a/_inventory.html
+++ b/_inventory.html
@@ -71,10 +71,6 @@
shape="plus"
href="movements/input_equipment.html?key=%s"|args:$key
target="_dialog"}}
- {{:linkbutton
- label="Historique"
- href="equipment_history.html?key=%s&prop=1"|args:$key
- shape="table"}}
{{:linkbutton
label="Modifier"
href="modify_equipment.html?key=%s&prop=1"|args:$key
@@ -88,10 +84,7 @@
diff --git a/_nav.html b/_nav.html
index 8ea688e..4e69986 100644
--- a/_nav.html
+++ b/_nav.html
@@ -29,11 +29,6 @@
Historique — {{$eqpmt}} ({{$category}})
{{/if}}
- {{elseif $current == 'historique'}}
-
{{elseif $current == 'archives'}}
{{if $subsubcurrent == 'historique'}}
{{/if}}
diff --git a/_temp_inventory.html b/_temp_inventory.html
index df4f8aa..f1fd997 100644
--- a/_temp_inventory.html
+++ b/_temp_inventory.html
@@ -60,10 +60,6 @@
shape="plus"
href="movements/input_equipment.html?key=%s"|args:$key
target="_dialog"}}
- {{:linkbutton
- label="Historique"
- href="equipment_history.html?key=%s&prop=0"|args:$key
- shape="table"}}
{{:linkbutton
label="Modifier"
href="modify_equipment.html?key=%s&prop=0"|args:$key
diff --git a/archives.html b/archives.html
index 261673c..087ac1c 100644
--- a/archives.html
+++ b/archives.html
@@ -1,7 +1,5 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
{{:admin_header title="Matériels archivés" current="module_equipment"}}
{{:include file="_nav.html" current="archives"}}
@@ -29,10 +27,6 @@
}}
-
-
{{* filtrer selon la catégorie *}}
{{if $_GET.cat_key == null}}
{{:assign condition="1"}}
diff --git a/categories/add_category.html b/categories/add_category.html
index 0fe45c8..20691ae 100644
--- a/categories/add_category.html
+++ b/categories/add_category.html
@@ -1,6 +1,9 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
+{{* barre de navigation *}}
+{{if ! $dialog}}
+ {{:include file="../_nav.html" current="config" subcurrent="categories"}}
+{{/if}}
{{* Traiter l'envoi du formulaire *}}
{{#form on="save"}}
@@ -22,11 +25,6 @@
{{/form}}
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
-{{* barre de navigation *}}
-{{if ! $dialog}}
- {{:include file="../_nav.html" current="config" subcurrent="categories"}}
-{{/if}}
-
{{:form_errors}}
{{* formulaire d'ajout de catégorie *}}
diff --git a/categories/delete_category.html b/categories/delete_category.html
index 7838f41..203bb60 100644
--- a/categories/delete_category.html
+++ b/categories/delete_category.html
@@ -1,7 +1,5 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
{{#load key=$_GET.key assign="category"}}
{{else}}
{{:error message="Catégorie introuvable"}}
@@ -9,7 +7,7 @@
{{#form on="delete"}}
{{* Vérifier s'il reste des matériels dans cette catégorie *}}
- {{#load type="equipment" category=$_GET.key limit="1"}}
+ {{#load type="equipment" category=$_GET.key assign="equipment"}}
{{:redirect force="./index.html?err=1&msg=suppression"}}
{{else}}
{{* supprimer la catégorie sélectionnée*}}
diff --git a/categories/index.html b/categories/index.html
index d021953..aac2a00 100644
--- a/categories/index.html
+++ b/categories/index.html
@@ -1,7 +1,5 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
{{:admin_header title="Configuration" current="module_equipment"}}
{{* barre de navigation *}}
@@ -29,17 +27,15 @@
{{:assign category_key=$key}}
{{* voir s'il y a des matériels dans cette catégorie *}}
{{:assign materiel_present=true}}
- {{#load type="equipment" where="$$.category = :category_key" :category_key=$category_key limit=1}}
+ {{#load type="equipment" where="$$.category = :category_key" :category_key=$category_key}}
{{else}}
{{:assign materiel_present=false}}
{{/load}}
| {{$name}} |
- {{if ! $materiel_present}}
- {{:linkbutton label="Supprimer" href="delete_category.html?key=%s"|args:$key shape="delete" target="_dialog"}}
- {{/if}}
{{:linkbutton label="Modifier" href="modify_category.html?key=%s"|args:$key shape="edit" target="_dialog"}}
+ {{:linkbutton label="Supprimer" href="delete_category.html?key=%s"|args:$key shape="delete" target="_dialog"}}
|
{{else}}
diff --git a/categories/modify_category.html b/categories/modify_category.html
index 0819a78..9d2d315 100644
--- a/categories/modify_category.html
+++ b/categories/modify_category.html
@@ -1,7 +1,5 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
{{#load key=$_GET.key assign="category"}}
{{else}}
{{:error message="Catégorie introuvable"}}
diff --git a/config.html b/config.html
index 9927c5e..d7661ab 100644
--- a/config.html
+++ b/config.html
@@ -1,7 +1,5 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
{{:admin_header title="Configuration" current="module_equipment"}}
{{* barre de navigation *}}
diff --git a/config/add_movement_type.html b/config/add_movement_type.html
index 06881dc..bb7d64b 100644
--- a/config/add_movement_type.html
+++ b/config/add_movement_type.html
@@ -1,24 +1,27 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
{{*
paramètres :
- dir : input ou output
*}}
+{{* barre de navigation *}}
+{{if ! $dialog}}
+ {{:include file="../_nav.html" current="config" subcurrent="typesES"}}
+{{/if}}
+
{{* Traiter l'envoi du formulaire *}}
-{{* lecture config *}}
-{{:include file="../_get_config.html" keep="config, directions, config_defaut"}}
+{{* lecture config par défaut *}}
+{{:include file="../_get_config.html" keep="config, directions" default=true}}
{{#form on="save"}}
- {{* vérifier s'il existe un libellé de même nom dans la même direction *}}
+ {{* vérifier s'il existe un type de mouvement de même nom *}}
{{#foreach from=$directions key="direction"}}
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
{{#foreach from=$nature key="key"}}
{{:assign var="fields" from="_POST.%s_fields"|args:$_GET.dir}}
- {{if $_GET.dir == $direction && $label|trim|tolower == $fields.label|trim|tolower}}
+ {{if $label|trim|tolower == $fields.label|trim|tolower}}
{{:error message="Ce libellé est déjà présent"}}
{{/if}}
{{:assign var="%s_nature.key"|args:$direction value=$key}}
@@ -36,6 +39,7 @@
{{:assign var="%s_nature.type"|args:$direction from="_POST.%s_fields.type"|args:$direction}}
{{:assign var="%s_natures."|args:$direction from="%s_nature"|args:$direction}}
{{/if}}
+
{{/foreach}}
{{:save
@@ -48,16 +52,11 @@
{{/form}}
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
-{{* barre de navigation *}}
-{{if ! $dialog}}
- {{:include file="../_nav.html" current="config" subcurrent="typesES"}}
-{{/if}}
-
{{:form_errors}}
{{if $_GET.dir == 'input'}}
{{* types d'entrées *}}
- {{#foreach from=$config_defaut.inputs}}
+ {{#foreach from=$config.input_nature}}
{{:assign var='input_types.%s'|args:$type value=$type}}
{{/foreach}}
{{else}}
{{* types de sorties *}}
- {{#foreach from=$config_defaut.outputs}}
+ {{#foreach from=$config.output_nature}}
{{:assign var='output_types.%s'|args:$type value=$type}}
{{/foreach}}
diff --git a/config/delete_movement_type.html b/config/delete_movement_type.html
index 4f0ddaa..9e889ab 100644
--- a/config/delete_movement_type.html
+++ b/config/delete_movement_type.html
@@ -1,13 +1,15 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
{{*
paramètres :
- dir : input ou output
- op_key : clé du type de mouvement à supprimer
*}}
+{{* barre de navigation *}}
+{{if ! $dialog}}
+ {{:include file="../_nav.html" current="config" subcurrent="typesES"}}
+{{/if}}
{{* lecture config (défaut ou enregistrée) *}}
{{:include file="../_get_config.html" keep="config, directions"}}
@@ -35,10 +37,6 @@
{{/form}}
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
-{{* barre de navigation *}}
-{{if ! $dialog}}
- {{:include file="../_nav.html" current="config" subcurrent="typesES"}}
-{{/if}}
{{:form_errors}}
{{:assign var="mvt_label" from="config.%s_nature.%s.label"|args:$_GET.dir:$_GET.op_key}}
diff --git a/config/misc.html b/config/misc.html
deleted file mode 100644
index d49ef65..0000000
--- a/config/misc.html
+++ /dev/null
@@ -1,36 +0,0 @@
-{{* -*- brindille -*- *}}
-
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
-{{:admin_header title="Configuration" current="module_equipment"}}
-
-{{#form on="save"}}
- {{:save
- key="config"
- loan_duration=$_POST.loan_duration
- }}
-{{/form}}
-
-{{* barre de navigation *}}
-{{:include file="../_nav.html" current="config" subcurrent="divers"}}
-
-{{if $_GET.ok}}
- Configuration enregistrée.
-{{/if}}
-
-{{* lecture config (défaut ou enregistrée) *}}
-{{:include file="../_get_config.html" keep="loan_duration"}}
-
-
-{{:admin_footer}}
diff --git a/config/modify_movement_type.html b/config/modify_movement_type.html
index 89d9970..b5210c3 100644
--- a/config/modify_movement_type.html
+++ b/config/modify_movement_type.html
@@ -1,13 +1,16 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
{{*
paramètres :
- dir : input ou output
- op_key : clé du type de mouvement dont on veut modifier le libellé
*}}
+{{* barre de navigation *}}
+{{if ! $dialog}}
+ {{:include file="../_nav.html" current="config" subcurrent="typesES"}}
+{{/if}}
+
{{* lecture config (défaut ou enregistrée) *}}
{{:include file="../_get_config.html" keep="config, directions"}}
@@ -40,12 +43,7 @@
{{/form}}
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
-{{* barre de navigation *}}
-{{if ! $dialog}}
- {{:include file="../_nav.html" current="config" subcurrent="typesES"}}
-{{/if}}
{{:form_errors}}
-
{{:assign var="default_label" from="config.%s_nature.%s.label"|args:$_GET.dir:$_GET.op_key}}
{{:admin_footer}}
-
-
-
diff --git a/movements/delete_movement.html b/movements/delete_movement.html
index 506ebe4..aea6243 100644
--- a/movements/delete_movement.html
+++ b/movements/delete_movement.html
@@ -1,6 +1,4 @@
-{{* -*- brindille -*- *}}
-
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
+{{* -*- brindille -*-}}
{{*
paramètres GET :
@@ -23,11 +21,6 @@
{{:include file="../_get_config.html" keep="config"}}
{{#form on="delete"}}
- {{if $_GET.from == "lh"}}
- {{:assign from="../loan_history.html"}}
- {{else}}
- {{:assign from="../equipment_history.html"}}
- {{/if}}
{{* vérifier s'il est possible de supprimer le mouvement *}}
{{if $mvt_suppr.direction == 'input'}}
{{:assign var="type_operation" from="config.input_nature.%s.type"|args:$mvt_suppr.operation}}
@@ -36,7 +29,7 @@
{{:assign link_key=$key}}
{{/load}}
{{if $link_key != null}}
- {{:redirect force="%s?key=%s&prop=%s&err=1&msg=suppression"|args:$from:$mvt_suppr.equipment:$_GET.prop}}
+ {{:redirect force="../equipment_history.html?key=%s&prop=%s&err=1&msg=suppression"|args:$mvt_suppr.equipment:$_GET.prop}}
{{/if}}
{{else}}
{{:assign dispo=0}}
@@ -69,7 +62,7 @@
{{* problème ? *}}
{{if $dispo < 0 || $nonprop < 0}}
- {{:redirect force="%s?key=%s&prop=%s&err=1&msg=suppression"|args:$from:$mvt_suppr.equipment:$_GET.prop}}
+ {{:redirect force="../equipment_history.html?key=%s&prop=%s&err=1&msg=suppression"|args:$mvt_suppr.equipment:$_GET.prop}}
{{/if}}
{{/if}}
{{/load}}
@@ -90,7 +83,7 @@
{{:assign link_key=$key}}
{{/load}}
{{if $link_key != null}}
- {{:redirect force="%s?key=%s&prop=%s&err=1&msg=suppression"|args:$from:$mvt_suppr.equipment:$_GET.prop}}
+ {{:redirect force="../equipment_history.html?key=%s&prop=%s&err=1&msg=suppression"|args:$mvt_suppr.equipment:$_GET.prop}}
{{/if}}
{{elseif $type_operation == 'retour'}}
{{#load type="link" where="$$.return = :key" :key=$_GET.key}}
@@ -155,7 +148,7 @@
out=$curr_eqpmt.out
notowned=$curr_eqpmt.notowned
}}
- {{:redirect force="%s?ok=1&key=%s&prop=%s&msg=suppression"|args:$from:$mvt_suppr.equipment:$_GET.prop}}
+ {{:redirect force="../equipment_history.html?ok=1&key=%s&prop=%s&msg=suppression"|args:$mvt_suppr.equipment:$_GET.prop}}
{{else}}
{{* supprimer le matériel *}}
{{:delete key=$curr_eqpmt.key}}
diff --git a/movements/input_equipment.html b/movements/input_equipment.html
index 1f687bf..deff4cc 100644
--- a/movements/input_equipment.html
+++ b/movements/input_equipment.html
@@ -1,7 +1,5 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
{{*
Enregistrer une entrée de matériel
paramètres :
@@ -44,7 +42,7 @@
{{:assign var="equipment.notowned" value="%d+%d"|math:$equipment.notowned:$_POST.amount|intval}}
{{/if}}
- {{* écritures liées *}}
+ {{* documents liés *}}
{{#foreach from=$_POST.transactions item="value"}}
{{:assign var="transactions." value=$value|intval}}
{{/foreach}}
@@ -107,9 +105,9 @@
{{if $input_labels|count == 1}}
- {{:input type="select" name="operation" label="Type d'entrée" required=true options=$input_labels}}
+ {{:input type="select" name="operation" label="Type" required=true options=$input_labels}}
{{else}}
- {{:input type="select" name="operation" label="Type d'entrée" required=true default_empty="— Aucun —" options=$input_labels|sort}}
+ {{:input type="select" name="operation" label="Type" required=true default_empty="— Aucun —" options=$input_labels|sort}}
{{/if}}
{{:input type="date" name="date" label="Date" required=true default=$now|date_short}}
{{:input type="number" name="amount" label="Quantité" required=true min=1 default=1}}
diff --git a/movements/input_return.html b/movements/input_return.html
index c4601b3..03e567b 100644
--- a/movements/input_return.html
+++ b/movements/input_return.html
@@ -1,7 +1,5 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
{{*
Enregistrer un retour d'entrée temporaire
paramètres :
@@ -34,9 +32,9 @@
{{#select
json_extract(mvt.document, '$.amount') - IFNULL(SUM(json_extract(mvt2.document, '$.amount')), 0) AS present
- FROM {!$module.table} AS mvt
- LEFT JOIN {!$module.table} AS link ON mvt.key = json_extract(link.document, '$.temp_key')
- LEFT JOIN {!$module.table} AS mvt2 ON mvt2.key = json_extract(link.document, '$.return')
+ FROM module_data_equipment AS mvt
+ LEFT JOIN module_data_equipment AS link ON mvt.key = json_extract(link.document, '$.temp_key')
+ LEFT JOIN module_data_equipment AS mvt2 ON mvt2.key = json_extract(link.document, '$.return')
WHERE
json_extract(mvt.document, '$.operation') IN !op
AND mvt.key = :mvt_key
@@ -203,7 +201,7 @@
-
@@ -338,20 +307,3 @@
{{:admin_footer}}
-
-
-
diff --git a/movements/movement.schema.json b/movements/movement.schema.json
index eaebdb3..bd27c1c 100644
--- a/movements/movement.schema.json
+++ b/movements/movement.schema.json
@@ -46,11 +46,6 @@
"items": {
"type": "integer"
}
- },
- "return_date" : {
- "description": "Date de retour du matériel",
- "type" : ["null", "string"],
- "format" : "date"
}
},
"required": ["type", "direction", "operation", "amount", "equipment", "date", "comment"]
diff --git a/movements/movement_details.html b/movements/movement_details.html
deleted file mode 100644
index ac2bb5a..0000000
--- a/movements/movement_details.html
+++ /dev/null
@@ -1,120 +0,0 @@
-{{* -*- brindille -*- *}}
-
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
-{{*
- Afficher les détails d'un mouvement et donner la possibilité :
- - d'associer des fichiers
- - de modifier, supprimer ou dupliquer le mouvement
- paramètres :
- - key : clé du mouvement
- - prop = 1 si matériel appartient à l'asso
-*}}
-
-{{:admin_header title="Détails du mouvement" custom_css="../style.css" current="module_equipment"}}
-{{:form_errors}}
-
-{{* récupérer les infos du mouvement *}}
-{{#load key=$_GET.key assign="mvt"}}
-{{else}}
- {{:error message="Aucun mouvement avec la clé %s"|args:$_GET.key}}
-{{/load}}
-
-{{* récupérer la config des entrées/sorties *}}
-{{:include file="../_get_config.html" keep="config, directions"}}
-{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt.direction:$mvt.operation}}
-
-{{* récupérer les infos du matériel associé *}}
-{{#load key=$mvt.equipment assign="equipment"}}
-{{else}}
- {{:error message="Aucun matériel avec la clé « %s »"|args:$mvt.equipment}}
-{{/load}}
-
-{{*
- -------------------- Afficher les informations du mouvement --------------------
-*}}
-
-{{:assign var="op_label" from="config.%s_nature.%s.label"|args:$mvt.direction:$mvt.operation}}
-{{#load key=$equipment.category assign="category"}}{{/load}}
-{{#load key=$mvt.storage assign="storage"}}{{/load}}
-{{#select !name as nom FROM users WHERE id=:id; !name=$config.user_fields.name_sql :id=$mvt.user}}
- {{:assign user_name=$nom}}
-{{/select}}
-
-
-
-
- - Opération
- - {{$op_label}}
- - Matériel
- - {{:link href="../equipment_history.html?key=%s&prop=%s"|args:$equipment.key:$_GET.prop label=$equipment.name}}
- - Catégorie
- - {{:link href="../index.html?cat_key=%s&prop=1"|args:$category.key label=$category.name}}
- - Date
- - {{$mvt.date|date_short}}
- - Quantité
- - {{$mvt.amount}}
- {{if $mvt.direction == "output" && $type_mvt != "retour"}}
- - Membre destinataire
- -
- {{if $mvt.user != null}}
- {{:link href="/admin/users/details.php?id=%s"|args:$mvt.user label=$user_name}}
- {{else}}—
- {{/if}}
-
- {{/if}}
- {{if $mvt.direction == "input"}}
- - Lieu de stockage
- -
- {{if $storage != null}}
- {{$storage.name}}
- {{else}}—
- {{/if}}
-
- {{/if}}
- - Écritures liées
- -
- {{#foreach from=$mvt.transactions item="trans"}}
- {{:link class="num" href="!acc/transactions/details.php?id=%d"|args:$trans label=$trans}}
- {{else}}—
- {{/foreach}}
-
- {{if $mvt.direction == "output" && $type_mvt != "retour"}}
- - Date de retour
- -
- {{if $mvt.return_date != null}}
- {{$mvt.return_date|date_short}}
- {{else}}—
- {{/if}}
-
- {{/if}}
- - Remarques
- - {{if $mvt.comment != null}}
- {{$mvt.comment}}
- {{else}}—
- {{/if}}
-
-
-
-
-{{:admin_footer}}
diff --git a/movements/output_equipment.html b/movements/output_equipment.html
index 95ac3cd..9993f78 100644
--- a/movements/output_equipment.html
+++ b/movements/output_equipment.html
@@ -1,14 +1,12 @@
{{* -*- brindille -*- *}}
-{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-
{{*
paramètres :
- key : clé du matériel à sortir
*}}
{{* récupérer la config des entrées/sorties *}}
-{{:include file="../_get_config.html" keep="config, loan_duration"}}
+{{:include file="../_get_config.html" keep="config"}}
{{* types de sorties *}}
{{#foreach from=$config.output_nature key=key}}
@@ -33,15 +31,6 @@
{{/if}}
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$_POST.operation}}
- {{if $type_mvt != "temporaire" && $_POST.set_return_date != null}}
- {{:error message="On ne peut associer une date de retour qu'à une sortie temporaire"}}
- {{/if}}
- {{if $_POST.set_return_date != null}}
- {{:assign return_date=$_POST.return_date}}
- {{else}}
- {{:assign return_date=null}}
- {{/if}}
-
{{if $_POST.user|count > 1}}
{{:error message="Un membre au plus peut être associé à une sortie"}}
{{/if}}
@@ -128,11 +117,6 @@
{{:assign var="equipment.out" value="%d+%d"|math:$equipment.out:$_POST.amount|intval}}
{{/if}}
- {{* écritures liées *}}
- {{#foreach from=$_POST.transactions item="value"}}
- {{:assign var="transactions." value=$value|intval}}
- {{/foreach}}
-
{{:save
key=$equipment.key
validate_schema="../equipment.schema.json"
@@ -158,8 +142,6 @@
date=$_POST.date|parse_date
comment=$_POST.remarques|trim
user=$user.id
- return_date=$return_date|parse_date
- transactions=$transactions
}}
{{:redirect force="../equipment_history.html?ok=1&key=%s&prop=1&msg=sortie"|args:$_GET.key}}
{{/form}}
@@ -174,8 +156,6 @@
{{:assign dispo="%d-%d"|math:$equipment.stock:$equipment.out}}
{{if $dispo > 0}}
- {{:assign ts_retour="%d+%d*(60*60*24)"|math:$now:$loan_duration}}
- {{:assign date_retour=$ts_retour|date_short}}
{{* formulaire de sortie de matériel *}}