fusion branche retourhisto
This commit is contained in:
commit
68284ee309
@ -42,6 +42,8 @@
|
|||||||
<p class="block confirm">Modification enregistrée</p>
|
<p class="block confirm">Modification enregistrée</p>
|
||||||
{{elseif $_GET.msg == "copie"}}
|
{{elseif $_GET.msg == "copie"}}
|
||||||
<p class="block confirm">Mouvement copié</p>
|
<p class="block confirm">Mouvement copié</p>
|
||||||
|
{{elseif $_GET.msg == "retour"}}
|
||||||
|
<p class="block confirm">Retour enregistré</p>
|
||||||
{{elseif $_GET.msg == "suppression"}}
|
{{elseif $_GET.msg == "suppression"}}
|
||||||
<p class="block confirm">Mouvement supprimé</p>
|
<p class="block confirm">Mouvement supprimé</p>
|
||||||
{{else}}
|
{{else}}
|
||||||
@ -125,15 +127,38 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{:linkbutton label="Entrée" shape="plus" href="mouvements/entrees/repertorie.html?key=%s"|args:$_GET.key target="_dialog"}}
|
{{:linkbutton label="Entrée" shape="plus" href="mouvements/entrees/repertorie.html?key=%s"|args:$_GET.key target="_dialog"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{if $equipment.notowned > 0}}
|
|
||||||
{{:linkbutton label="Retour" href="mouvements/sorties/emprunte.html?key=%s"|args:$_GET.key shape="history" target="_dialog"}}
|
|
||||||
{{/if}}
|
|
||||||
{{:linkbutton label="Entrée" shape="plus" href="mouvements/entrees/repertorie.html?key=%s"|args:$_GET.key target="_dialog"}}
|
{{:linkbutton label="Entrée" shape="plus" href="mouvements/entrees/repertorie.html?key=%s"|args:$_GET.key target="_dialog"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</aside>
|
</aside>
|
||||||
</nav>
|
</nav>
|
||||||
{{* lister tous les mouvements du matériel passé en paramètre *}}
|
{{* lister tous les mouvements du matériel passé en paramètre *}}
|
||||||
{{if $_GET.prop}}
|
{{if $_GET.prop}}
|
||||||
|
{{* calculer la quantité temporairement l'extérieur de chaque matériel *}}
|
||||||
|
{{#foreach from=$config.output_nature key=key}}
|
||||||
|
{{if $type == "temporaire"}}
|
||||||
|
{{:assign var="temp_outputs." value=$key|quote_sql}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
{{:assign operations=$temp_outputs|implode:","}}
|
||||||
|
{{:assign operations="("|cat:$operations|cat:")"}}
|
||||||
|
|
||||||
|
{{#select
|
||||||
|
mvt.key AS mvt_key,
|
||||||
|
json_extract(mvt.document, '$.amount') - IFNULL(SUM(json_extract(mvt2.document, '$.amount')), 0) AS reste
|
||||||
|
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 json_extract(mvt.document, '$.equipment') = :eqpmt_key
|
||||||
|
GROUP by mvt.key
|
||||||
|
;
|
||||||
|
!op = $operations
|
||||||
|
:eqpmt_key = $_GET.key
|
||||||
|
}}
|
||||||
|
{{:assign var="reste.%s"|args:$mvt_key value=$reste}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
{{#list
|
{{#list
|
||||||
type="movement"
|
type="movement"
|
||||||
select="$$.date AS 'Date';
|
select="$$.date AS 'Date';
|
||||||
@ -178,6 +203,16 @@
|
|||||||
<td>{{$comment}}</td>
|
<td>{{$comment}}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{{if $current != "archives"}}
|
{{if $current != "archives"}}
|
||||||
|
{{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="mouvements/output_return.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
||||||
|
shape="reset"
|
||||||
|
target="_dialog"}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Dupliquer"
|
label="Dupliquer"
|
||||||
href="mouvements/dupliquer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
href="mouvements/dupliquer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
||||||
@ -200,6 +235,33 @@
|
|||||||
{{/list}}
|
{{/list}}
|
||||||
|
|
||||||
{{else}}
|
{{else}}
|
||||||
|
{{* calculer la quantité présente temporairement de chaque matériel *}}
|
||||||
|
{{#foreach from=$config.input_nature key=key}}
|
||||||
|
{{if $type == "temporaire"}}
|
||||||
|
{{:assign var="temp_inputs." value=$key|quote_sql}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
{{:assign operations=$temp_inputs|implode:","}}
|
||||||
|
{{:assign operations="("|cat:$operations|cat:")"}}
|
||||||
|
|
||||||
|
{{#select
|
||||||
|
mvt.key AS mvt_key,
|
||||||
|
json_extract(mvt.document, '$.amount') - IFNULL(SUM(json_extract(mvt2.document, '$.amount')), 0) AS present
|
||||||
|
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 json_extract(mvt.document, '$.equipment') = :eqpmt_key
|
||||||
|
GROUP by mvt.key
|
||||||
|
;
|
||||||
|
!op = $operations
|
||||||
|
:eqpmt_key = $_GET.key
|
||||||
|
}}
|
||||||
|
{{:assign var="present.%s"|args:$mvt_key value=$present}}
|
||||||
|
{{/select}}
|
||||||
|
{{*:debug present=$present*}}
|
||||||
|
{{*:debug direction=$direction type_mvt=$type_mvt in=$in*}}
|
||||||
{{#list
|
{{#list
|
||||||
type="movement"
|
type="movement"
|
||||||
select="$$.date AS 'Date';
|
select="$$.date AS 'Date';
|
||||||
@ -215,7 +277,7 @@
|
|||||||
equipment=$equipment_key
|
equipment=$equipment_key
|
||||||
order=1
|
order=1
|
||||||
}}
|
}}
|
||||||
{{:assign var="type_mvt" from="config.%s_nature.%s"|args:$direction:$col3}}
|
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$direction:$col3}}
|
||||||
{{:assign var="op_label" from="config.%s_nature.%s.label"|args:$direction:$operation}}
|
{{:assign var="op_label" from="config.%s_nature.%s.label"|args:$direction:$operation}}
|
||||||
|
|
||||||
{{if $direction === "input" && $op_label|in:$input_types ||
|
{{if $direction === "input" && $op_label|in:$input_types ||
|
||||||
@ -231,6 +293,16 @@
|
|||||||
<td>{{$col6}}</td>
|
<td>{{$col6}}</td>
|
||||||
<td>{{$comment}}</td>
|
<td>{{$comment}}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
|
{{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"
|
||||||
|
href="mouvements/input_return.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
||||||
|
shape="reset"
|
||||||
|
target="_dialog"}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Dupliquer"
|
label="Dupliquer"
|
||||||
href="mouvements/dupliquer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
href="mouvements/dupliquer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
(SELECT $$.stock - $$.out) AS 'Disponible'
|
(SELECT $$.stock - $$.out) AS 'Disponible'
|
||||||
"
|
"
|
||||||
type="equipment"
|
type="equipment"
|
||||||
where="$$.status <> 'archived' AND %s"|args:$condition
|
where="$$.status <> 'archived' AND $$.stock != 0 AND %s"|args:$condition
|
||||||
order=1
|
order=1
|
||||||
}}
|
}}
|
||||||
{{:assign var=cat_name from=categories.%s|args:$category}}
|
{{:assign var=cat_name from=categories.%s|args:$category}}
|
||||||
@ -59,13 +59,6 @@
|
|||||||
<td class="num">{{$out}}</td>
|
<td class="num">{{$out}}</td>
|
||||||
<td class="num">{{$col5}}</td>
|
<td class="num">{{$col5}}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{{if $col4 > 0}}
|
|
||||||
{{:linkbutton
|
|
||||||
label="Retour"
|
|
||||||
href="mouvements/entrees/retour.html?key=%s"|args:$key
|
|
||||||
shape="history"
|
|
||||||
target="_dialog"}}
|
|
||||||
{{/if}}
|
|
||||||
{{if $col5 > 0}}
|
{{if $col5 > 0}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Sortie"
|
label="Sortie"
|
||||||
|
@ -55,13 +55,6 @@
|
|||||||
<td>{{$cat_name}}</td>
|
<td>{{$cat_name}}</td>
|
||||||
<td class="num">{{$col3}}</td>
|
<td class="num">{{$col3}}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{{if $col3 > 0}}
|
|
||||||
{{:linkbutton
|
|
||||||
label="Retour"
|
|
||||||
href="mouvements/sorties/emprunte.html?key=%s"|args:$key
|
|
||||||
shape="history"
|
|
||||||
target="_dialog"}}
|
|
||||||
{{/if}}
|
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Entrée"
|
label="Entrée"
|
||||||
shape="plus"
|
shape="plus"
|
||||||
|
204
mouvements/input_return.html
Normal file
204
mouvements/input_return.html
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
Enregistrer un retour d'entrée temporaire
|
||||||
|
paramètres :
|
||||||
|
- key : clé du mouvement
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{* infos du mouvement *}}
|
||||||
|
{{#load key=$_GET.key assign="mvt_new"}}
|
||||||
|
{{else}}
|
||||||
|
{{:error message="Aucun mouvement avec la clé %s"|args:$_GET.key}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
|
{{* infos du matériel associé *}}
|
||||||
|
{{#load key=$mvt_new.equipment assign="equipment"}}
|
||||||
|
{{else}}
|
||||||
|
{{:error message="Aucun matériel avec la clé « %s »"|args:$key}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
|
{{* récupérer la config des entrées/sorties *}}
|
||||||
|
{{:include file="../_get_config.html" keep="config"}}
|
||||||
|
|
||||||
|
{{* calculer la quantité entrée temporairement *}}
|
||||||
|
{{#foreach from=$config.input_nature key=key}}
|
||||||
|
{{if $type == "temporaire"}}
|
||||||
|
{{:assign var="temp_inputs." value=$key|quote_sql}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
{{:assign operations=$temp_inputs|implode:","}}
|
||||||
|
{{:assign operations="("|cat:$operations|cat:")"}}
|
||||||
|
|
||||||
|
{{#select
|
||||||
|
json_extract(mvt.document, '$.amount') - IFNULL(SUM(json_extract(mvt2.document, '$.amount')), 0) AS present
|
||||||
|
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
|
||||||
|
GROUP by mvt.key
|
||||||
|
;
|
||||||
|
!op = $operations
|
||||||
|
:mvt_key = $_GET.key
|
||||||
|
}}
|
||||||
|
{{:assign present=$present}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
-------------------- Traiter la saisie --------------------
|
||||||
|
*}}
|
||||||
|
{{#form on="save"}}
|
||||||
|
{{* vérifier validité des données *}}
|
||||||
|
{{if $_POST.amount <= 0}}
|
||||||
|
{{:error message="La quantité (%s) doit être strictement positive !!"|args:$_POST.amount}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{if $_POST.amount > $present}}
|
||||||
|
{{:error message="La quantité (%s) doit être inférieure à la quantité présente (%s) !!"|args:$_POST.amount:$present}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{if $_POST.date|parse_date|strtotime > $now}}
|
||||||
|
{{:error message="Impossible de saisir une date dans le futur (%s)"|args:$_POST.date}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{* préparer le nouveau mouvement *}}
|
||||||
|
{{:assign var="mvt_new.key" value=""|uuid}}
|
||||||
|
{{:assign var="mvt_new.direction" value="input"}}
|
||||||
|
{{:assign var="mvt_new.date" value=$_POST.date|parse_date}}
|
||||||
|
{{:assign var="mvt_new.operation" value=$_POST.operation}}
|
||||||
|
{{:assign var="mvt_new.amount" value=$_POST.amount}}
|
||||||
|
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt_new.direction:$mvt_new.operation}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
lister les mouvements
|
||||||
|
- insérer le nouveau mvt à sa place par date croissante
|
||||||
|
*}}
|
||||||
|
{{:assign insere=false}}
|
||||||
|
{{#load
|
||||||
|
where="
|
||||||
|
$$.type = 'movement'
|
||||||
|
AND
|
||||||
|
$$.equipment = :eqpmt_key"
|
||||||
|
:eqpmt_key=$equipment.key
|
||||||
|
order="$$.date"
|
||||||
|
assign="movement"
|
||||||
|
}}
|
||||||
|
{{if ! $insere}}
|
||||||
|
{{if $mvt_new.date < $date}}
|
||||||
|
{{:assign var="movements_new." from=mvt_new}}
|
||||||
|
{{:assign insere=true}}
|
||||||
|
{{elseif $mvt_new.date == $date}}
|
||||||
|
{{if $mvt_new.direction == "input" && $type_mvt != "retour"}}
|
||||||
|
{{:assign var="movements_new." from=mvt_new}}
|
||||||
|
{{:assign insere=true}}
|
||||||
|
{{elseif $mvt_new.direction == "output" && $type_mvt == "temporaire"}}
|
||||||
|
{{:assign var="movements_new." from=mvt_new}}
|
||||||
|
{{:assign insere=true}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{:assign var="movements_new." from=movement}}
|
||||||
|
{{/load}}
|
||||||
|
{{if ! $insere}}
|
||||||
|
{{:assign var="movements_new." from=mvt_new}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{* Vérifier la cohérence des mouvements du matériel *}}
|
||||||
|
{{:include
|
||||||
|
file="./valider_modification.html"
|
||||||
|
keep="erreur, pb"
|
||||||
|
movements=$movements_new
|
||||||
|
}}
|
||||||
|
{{if $erreur}}
|
||||||
|
<p class="block error">Impossible d'enregistrer ce mouvement.
|
||||||
|
{{if $pb.mvt.key != $mvt_new.key}}
|
||||||
|
{{:assign var="err_mvt_label" from="config.input_nature.%s.label"|args:$pb.mvt.operation}}
|
||||||
|
<br />Mouvement incompatible avec
|
||||||
|
« {{$err_mvt_label}} » : « {{$equipment.name}} (qté : {{$pb.mvt.amount}})
|
||||||
|
en date du {{$pb.mvt.date|date_short}} ».
|
||||||
|
{{/if}}
|
||||||
|
</p>
|
||||||
|
{{else}}
|
||||||
|
{{* calculer la nouvelle quantité du matériel *}}
|
||||||
|
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$_POST.operation}}
|
||||||
|
{{:assign var="equipment.notowned" value="%d-%d"|math:$equipment.notowned:$_POST.amount|intval}}
|
||||||
|
|
||||||
|
{{:save
|
||||||
|
key=$equipment.key
|
||||||
|
validate_schema="../equipment.schema.json"
|
||||||
|
type="equipment"
|
||||||
|
category=$equipment.category
|
||||||
|
name=$equipment.name
|
||||||
|
status="available"
|
||||||
|
stock=$equipment.stock
|
||||||
|
out=$equipment.out
|
||||||
|
notowned=$equipment.notowned
|
||||||
|
}}
|
||||||
|
|
||||||
|
{{* vérification réussie : enregistrer le mouvement modifié *}}
|
||||||
|
{{:assign mvt_key=""|uuid}}
|
||||||
|
{{:save
|
||||||
|
key=$mvt_key
|
||||||
|
validate_schema="movement.schema.json"
|
||||||
|
type="movement"
|
||||||
|
direction="output"
|
||||||
|
operation=$_POST.operation
|
||||||
|
amount=$_POST.amount|intval
|
||||||
|
equipment=$equipment.key
|
||||||
|
date=$_POST.date|parse_date
|
||||||
|
comment=$_POST.comment|trim
|
||||||
|
}}
|
||||||
|
{{* enregistrer la liaison entre le retour et la sortie temporaire *}}
|
||||||
|
{{:save
|
||||||
|
key=""|uuid
|
||||||
|
validate_schema="link.schema.json"
|
||||||
|
type="link"
|
||||||
|
direction="input"
|
||||||
|
temp_key=$_GET.key
|
||||||
|
return=$mvt_key
|
||||||
|
}}
|
||||||
|
{{:redirect force="../historique.html?ok=1&key=%s&prop=0&msg=retour"|args:$mvt_new.equipment}}
|
||||||
|
{{/if}}
|
||||||
|
{{/form}}
|
||||||
|
|
||||||
|
{{:admin_header title="Retour de matériel" custom_css="./../../style.css" current="module_equipment"}}
|
||||||
|
{{:form_errors}}
|
||||||
|
|
||||||
|
{{* barre de navigation *}}
|
||||||
|
{{if ! $dialog}}
|
||||||
|
{{:include file="../_nav.html" current="entrees"}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
-------------------- Préparer la saisie --------------------
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{#foreach from=$config.output_nature key=key}}
|
||||||
|
{{if $type == "retour"}}
|
||||||
|
{{:assign var="return_label.%s"|args:$key value=$label}}
|
||||||
|
{{:break}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
|
||||||
|
{{* infos de la catégorie *}}
|
||||||
|
{{#load key=$equipment.category assign="category"}}{{/load}}
|
||||||
|
|
||||||
|
<form method="post" action="">
|
||||||
|
<fieldset>
|
||||||
|
<legend>Retour de « {{$equipment.name}} (Catégorie : {{$category.name}}) »</legend>
|
||||||
|
<dl>
|
||||||
|
{{:input type="select" name="operation" label="Type" required=true options=$return_label}}
|
||||||
|
{{:input type="date" name="date" label="Date" required=true default=$now|date_short}}
|
||||||
|
{{:input type="number" name="amount" label="Quantité" min=1 max=$present required=true default=$present}}
|
||||||
|
{{:input type="textarea" name="comment" label="Remarques" cols="40", rows="3" required=false}}
|
||||||
|
</dl>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<p class="submit">
|
||||||
|
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{{:admin_footer}}
|
23
mouvements/link.schema.json
Normal file
23
mouvements/link.schema.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["link"]
|
||||||
|
},
|
||||||
|
"direction" : {
|
||||||
|
"type" : "string",
|
||||||
|
"enum" : ["input", "output"]
|
||||||
|
},
|
||||||
|
"temp_key" : {
|
||||||
|
"description": "clé d'une entrée ou sortie temporaire",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"return": {
|
||||||
|
"description": "clé du retour associé",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["type", "direction", "temp_key", "return"]
|
||||||
|
}
|
@ -1,30 +1,64 @@
|
|||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
|
Enregistrer un retour de sortie temporaire
|
||||||
paramètres :
|
paramètres :
|
||||||
- key : clé du matériel qui revient
|
- key : clé de la sortie temporaire
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* infos du mouvement *}}
|
||||||
{{if ! $dialog}}
|
{{#load key=$_GET.key assign="mvt_new"}}
|
||||||
{{:include file="../../_nav.html" current="entrees"}}
|
{{else}}
|
||||||
{{/if}}
|
{{:error message="Aucun mouvement avec la clé %s"|args:$_GET.key}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
|
{{* infos du matériel associé *}}
|
||||||
|
{{#load key=$mvt_new.equipment assign="equipment"}}
|
||||||
|
{{else}}
|
||||||
|
{{:error message="Aucun matériel avec la clé « %s »"|args:$key}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
{{* récupérer la config des entrées/sorties *}}
|
{{* récupérer la config des entrées/sorties *}}
|
||||||
{{:include file="../../_get_config.html" keep="config"}}
|
{{:include file="../_get_config.html" keep="config"}}
|
||||||
|
|
||||||
{{* déterminer le matériel concerné par le mouvement *}}
|
{{* calculer la quantité sortie *}}
|
||||||
{{#load key=$_GET.key assign="equipment"}}{{/load}}
|
{{#foreach from=$config.output_nature key=key}}
|
||||||
|
{{if $type == "temporaire"}}
|
||||||
|
{{:assign var="temp_outputs." value=$key|quote_sql}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
{{:assign operations=$temp_outputs|implode:","}}
|
||||||
|
{{:assign operations="("|cat:$operations|cat:")"}}
|
||||||
|
|
||||||
|
{{#select
|
||||||
|
json_extract(mvt.document, '$.amount') - IFNULL(SUM(json_extract(mvt2.document, '$.amount')), 0) AS exterieur
|
||||||
|
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
|
||||||
|
GROUP by mvt.key
|
||||||
|
;
|
||||||
|
!op = $operations
|
||||||
|
:mvt_key = $_GET.key
|
||||||
|
}}
|
||||||
|
{{:assign exterieur=$exterieur}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
-------------------- Traiter l'envoi du formulaire --------------------
|
-------------------- Traiter la saisie --------------------
|
||||||
*}}
|
*}}
|
||||||
{{#form on="save"}}
|
{{#form on="save"}}
|
||||||
{{* vérifier les données saisies *}}
|
{{* vérifier validité des données *}}
|
||||||
{{if $_POST.amount <= 0}}
|
{{if $_POST.amount <= 0}}
|
||||||
{{:error message="La quantité (%s) doit être strictement positive !!"|args:$_POST.amount}}
|
{{:error message="La quantité (%s) doit être strictement positive !!"|args:$_POST.amount}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{if $_POST.amount > $exterieur}}
|
||||||
|
{{:error message="La quantité (%s) doit être inférieure à la quantité sortie (%s) !!"|args:$_POST.amount:$exterieur}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{if $_POST.date|parse_date|strtotime > $now}}
|
{{if $_POST.date|parse_date|strtotime > $now}}
|
||||||
{{:error message="Impossible de saisir une date dans le futur (%s)"|args:$_POST.date}}
|
{{:error message="Impossible de saisir une date dans le futur (%s)"|args:$_POST.date}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@ -73,17 +107,16 @@
|
|||||||
|
|
||||||
{{* Vérifier la cohérence des mouvements du matériel *}}
|
{{* Vérifier la cohérence des mouvements du matériel *}}
|
||||||
{{:include
|
{{:include
|
||||||
file="../valider_modification.html"
|
file="./valider_modification.html"
|
||||||
keep="erreur, pb"
|
keep="erreur, pb"
|
||||||
movements=$movements_new
|
movements=$movements_new
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{if $erreur}}
|
{{if $erreur}}
|
||||||
<p class="block error">Impossible d'enregistrer ce mouvement.
|
<p class="block error">Impossible d'enregistrer ce mouvement.
|
||||||
{{if $pb.mvt.key != $mvt_new.key}}
|
{{if $pb.mvt.key != $mvt_new.key}}
|
||||||
{{:assign var="err_mvt_label" from="config.input_nature.%s.label"|args:$pb.mvt.operation}}
|
{{:assign var="err_mvt_label" from="config.input_nature.%s.label"|args:$pb.mvt.operation}}
|
||||||
<br />Mouvement incompatible avec
|
<br />Mouvement incompatible avec
|
||||||
« {{$err_mvt_label}} de {{$equipment.name}} (qté : {{$pb.mvt.amount}})
|
« {{$err_mvt_label}} » : « {{$equipment.name}} (qté : {{$pb.mvt.amount}})
|
||||||
en date du {{$pb.mvt.date|date_short}} ».
|
en date du {{$pb.mvt.date|date_short}} ».
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</p>
|
</p>
|
||||||
@ -94,7 +127,7 @@
|
|||||||
|
|
||||||
{{:save
|
{{:save
|
||||||
key=$equipment.key
|
key=$equipment.key
|
||||||
validate_schema="../../equipment.schema.json"
|
validate_schema="../equipment.schema.json"
|
||||||
type="equipment"
|
type="equipment"
|
||||||
category=$equipment.category
|
category=$equipment.category
|
||||||
name=$equipment.name
|
name=$equipment.name
|
||||||
@ -105,9 +138,10 @@
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
{{* enregistrer le mouvement modifié *}}
|
{{* enregistrer le mouvement modifié *}}
|
||||||
|
{{:assign mvt_key=""|uuid}}
|
||||||
{{:save
|
{{:save
|
||||||
key=""|uuid
|
key=$mvt_key
|
||||||
validate_schema="../movement.schema.json"
|
validate_schema="movement.schema.json"
|
||||||
type="movement"
|
type="movement"
|
||||||
direction="input"
|
direction="input"
|
||||||
operation=$_POST.operation
|
operation=$_POST.operation
|
||||||
@ -115,55 +149,57 @@
|
|||||||
equipment=$equipment.key
|
equipment=$equipment.key
|
||||||
date=$_POST.date|parse_date
|
date=$_POST.date|parse_date
|
||||||
comment=$_POST.comment|trim
|
comment=$_POST.comment|trim
|
||||||
|
user=$mvt_new.user
|
||||||
}}
|
}}
|
||||||
{{:redirect force="../../historique.html?ok=1&key=%s&prop=1&msg=retour"|args:$_GET.key}}
|
{{* enregistrer la liaison entre le retour et la sortie temporaire *}}
|
||||||
|
{{:save
|
||||||
|
key=""|uuid
|
||||||
|
validate_schema="link.schema.json"
|
||||||
|
type="link"
|
||||||
|
direction="output"
|
||||||
|
temp_key=$_GET.key
|
||||||
|
return=$mvt_key
|
||||||
|
}}
|
||||||
|
{{:redirect force="../historique.html?ok=1&key=%s&prop=1&msg=retour"|args:$mvt_new.equipment}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:admin_header title="Retour de matériel" custom_css="./../../style.css" current="module_equipment"}}
|
{{:admin_header title="Retour de matériel" custom_css="./../../style.css" current="module_equipment"}}
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
|
||||||
{{* Extraire et compiler les infos de la base *}}
|
{{* barre de navigation *}}
|
||||||
{{:include file="../../_calcul_dispo.html" eqpmt_key=$_GET.key keep="categories, equipments"}}
|
{{if ! $dialog}}
|
||||||
{{:assign var=sorti from="equipments.%s.exterieur"|args:$_GET.key}}
|
{{:include file="../_nav.html" current="entrees"}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
-------------------- Préparer la saisie --------------------
|
||||||
|
*}}
|
||||||
|
|
||||||
{{* types d'entrées *}}
|
|
||||||
{{#foreach from=$config.input_nature key=key}}
|
{{#foreach from=$config.input_nature key=key}}
|
||||||
{{if $type == 'retour'}}
|
{{if $type == "retour"}}
|
||||||
{{:assign var="input_labels.%s"|args:$key value=$label}}
|
{{:assign var="return_label.%s"|args:$key value=$label}}
|
||||||
|
{{:break}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
{{if $sorti > 0}}
|
{{* infos de la catégorie *}}
|
||||||
{{:assign var=cat_name from=categories.%s|args:$equipment.category}}
|
{{#load key=$equipment.category assign="category"}}{{/load}}
|
||||||
{{* formulaire d'entrée de matériel *}}
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
<fieldset class="informations">
|
<fieldset>
|
||||||
<legend>Informations matériel</legend>
|
<legend>Retour de « {{$equipment.name}} (Catégorie : {{$category.name}}) »</legend>
|
||||||
<dl class="describe">
|
|
||||||
<dt>Matériel</dt>
|
|
||||||
<dd>{{$equipment.name}}</dd>
|
|
||||||
<dt>Catégorie</dt>
|
|
||||||
<dd>{{$cat_name}}</dd>
|
|
||||||
<dt>Quantité sortie</dt>
|
|
||||||
<dd>{{$sorti}}</dd>
|
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
<fieldset class="entree">
|
|
||||||
<legend>Enregistrer un retour de matériel</legend>
|
|
||||||
<dl>
|
<dl>
|
||||||
{{:input type="select" name="operation" label="Type" required=true options=$input_labels|sort}}
|
{{:input type="select" name="operation" label="Type" required=true options=$return_label}}
|
||||||
{{:input type="date" name="date" label="Date" required=true default=$now|date_short}}
|
{{:input type="date" name="date" label="Date" required=true default=$now|date_short}}
|
||||||
{{:input type="number" name="amount" label="Quantité" min=1 required=true default=$sorti max=$sorti}}
|
{{:input type="number" name="amount" label="Quantité" min=1 max=$exterieur required=true default=$exterieur}}
|
||||||
{{:input type="textarea" name="comment" label="Remarques" cols="40", rows="3" required=false}}
|
{{:input type="textarea" name="comment" label="Remarques" cols="40", rows="3" required=false}}
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
|
||||||
<p class="block error">Il n'y a aucun matériel</p>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
@ -1,165 +0,0 @@
|
|||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
{{*
|
|
||||||
paramètres :
|
|
||||||
- key : clé du matériel à rendre
|
|
||||||
*}}
|
|
||||||
|
|
||||||
{{if ! $dialog}}
|
|
||||||
{{* barre de navigation *}}
|
|
||||||
{{:include file="../../_nav.html" current="sorties"}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* récupérer la config des entrées/sorties *}}
|
|
||||||
{{:include file="../../_get_config.html" keep="config"}}
|
|
||||||
|
|
||||||
{{* types de sorties *}}
|
|
||||||
{{#foreach from=$config.output_nature key=key}}
|
|
||||||
{{if $type == 'retour'}}
|
|
||||||
{{:assign var="output_labels.%s"|args:$key value=$label}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
|
||||||
{{#form on="save"}}
|
|
||||||
{{* interdire date dans le futur *}}
|
|
||||||
{{if $_POST.date|parse_date|strtotime > $now}}
|
|
||||||
{{:error message="Impossible de saisir une date dans le futur (%s)"|args:$_POST.date}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* récupérer les infos du matériel *}}
|
|
||||||
{{#load type="equipment" key=$_GET.key assign="equipment"}}
|
|
||||||
{{/load}}
|
|
||||||
|
|
||||||
{{:assign stock=0}}
|
|
||||||
{{:assign exterieur=0}}
|
|
||||||
{{:assign nonproprio=0}}
|
|
||||||
{{:assign insere=false}}
|
|
||||||
|
|
||||||
{{* lister tous les mouvements du matériel *}}
|
|
||||||
{{#load type="movement" where="$$.equipment = '%s'"|args:$_GET.key assign="mvt" order="$$.date ASC"}}
|
|
||||||
|
|
||||||
{{* traiter le nouveau mouvement *}}
|
|
||||||
{{if ! $insere && $mvt.date > $_POST.date|parse_date}}
|
|
||||||
{{:assign insere=true}}
|
|
||||||
{{:assign dispo_old=$nonproprio}}
|
|
||||||
{{:assign nonproprio="%d-%d"|math:$nonproprio:$_POST.amount}}
|
|
||||||
|
|
||||||
{{if $nonproprio < 0}}
|
|
||||||
{{:assign date_err=$_POST.date|date:"d/m/Y"}}
|
|
||||||
{{:error message="Erreur : la quantité indiquée (%s) est supérieure à celle disponible (%d) à la date du %s"|args:$_POST.amount:$dispo_old:$date_err}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* traiter le mouvement courant *}}
|
|
||||||
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt.direction:$mvt.operation}}
|
|
||||||
|
|
||||||
{{if $mvt.direction === 'input'}}
|
|
||||||
{{if $type_mvt == 'définitif'}}
|
|
||||||
{{:assign stock="%d+%d"|math:$stock:$mvt.amount}}
|
|
||||||
{{elseif $type_mvt == 'retour'}}
|
|
||||||
{{:assign exterieur="%d-%d"|math:$exterieur:$mvt.amount}}
|
|
||||||
{{elseif $type_mvt == 'temporaire'}}
|
|
||||||
{{:assign nonproprio="%d+%d"|math:$nonproprio:$mvt.amount}}
|
|
||||||
{{/if}}
|
|
||||||
{{elseif $mvt.direction === 'output'}}
|
|
||||||
{{if $type_mvt == 'définitif'}}
|
|
||||||
{{:assign stock="%d-%d"|math:$stock:$mvt.amount}}
|
|
||||||
{{elseif $type_mvt == 'temporaire'}}
|
|
||||||
{{:assign exterieur="%d+%d"|math:$exterieur:$mvt.amount}}
|
|
||||||
{{elseif $type_mvt == 'retour'}}
|
|
||||||
{{:assign nonproprio="%d-%d"|math:$nonproprio:$mvt.amount}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{:assign dispo="%d-%d"|math:$stock:$exterieur}}
|
|
||||||
|
|
||||||
{{if $dispo < 0 || $stock < 0 || $exterieur < 0 || $nonproprio < 0}}
|
|
||||||
{{:assign date_err=$mvt.date|date:"d/m/Y"}}
|
|
||||||
{{:error message="Erreur : la quantité indiquée (%s) est incompatible avec la sortie de %s unités à la date du %s"|args:$_POST.amount:$mvt.amount:$date_err}}
|
|
||||||
{{/if}}
|
|
||||||
{{/load}}
|
|
||||||
{{if ! $insere}}
|
|
||||||
{{:assign dispo_old=$nonproprio}}
|
|
||||||
{{:assign nonproprio="%d-%d"|math:$nonproprio:$_POST.amount}}
|
|
||||||
{{if $nonproprio < 0}}
|
|
||||||
{{:assign date_err=$_POST.date|date:"d/m/Y"}}
|
|
||||||
{{:error message="Erreur : la quantité indiquée (%s) est supérieure à celle disponible (%d) à la date du %s"|args:$_POST.amount:$dispo_old:$date_err}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* calculer la nouvelle quantité du matériel *}}
|
|
||||||
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$_POST.operation}}
|
|
||||||
{{:assign var="equipment.notowned" value="%d-%d"|math:$equipment.notowned:$_POST.amount|intval}}
|
|
||||||
|
|
||||||
{{:save
|
|
||||||
key=$equipment.key
|
|
||||||
validate_schema="../../equipment.schema.json"
|
|
||||||
type="equipment"
|
|
||||||
category=$equipment.category
|
|
||||||
name=$equipment.name
|
|
||||||
status="available"
|
|
||||||
stock=$equipment.stock
|
|
||||||
out=$equipment.out
|
|
||||||
notowned=$equipment.notowned
|
|
||||||
}}
|
|
||||||
|
|
||||||
{{* Enregistrer le mouvement *}}
|
|
||||||
{{:assign mvt_key=""|uuid}}
|
|
||||||
{{:save
|
|
||||||
key=$mvt_key
|
|
||||||
validate_schema="../movement.schema.json"
|
|
||||||
type="movement"
|
|
||||||
direction="output"
|
|
||||||
operation=$_POST.operation
|
|
||||||
amount=$_POST.amount|intval
|
|
||||||
equipment=$equipment.key
|
|
||||||
date=$_POST.date|parse_date
|
|
||||||
comment=$_POST.remarques|trim
|
|
||||||
}}
|
|
||||||
{{:redirect force="../../historique.html?ok=1&key=%s&prop=0&msg=sortie"|args:$_GET.key}}
|
|
||||||
{{/form}}
|
|
||||||
|
|
||||||
{{:admin_header title="Sortie de matériel" custom_css="./../../style.css" current="module_equipment"}}
|
|
||||||
{{:form_errors}}
|
|
||||||
|
|
||||||
{{* Extraire et compiler les infos de la base *}}
|
|
||||||
{{:include file="../../_calcul_dispo.html" eqpmt_key=$_GET.key keep="categories,equipments"}}
|
|
||||||
{{:assign var=present from="equipments.%s.nonproprio"|args:$_GET.key}}
|
|
||||||
|
|
||||||
{{if $present > 0}}
|
|
||||||
{{* déterminer le matériel concerné par le mouvement *}}
|
|
||||||
{{#load key=$_GET.key assign="equipment"}}{{/load}}
|
|
||||||
{{:assign var=cat_name from=categories.%s|args:$equipment.category}}
|
|
||||||
|
|
||||||
{{* formulaire de sortie de matériel *}}
|
|
||||||
<form method="post" action="">
|
|
||||||
<fieldset class="informations">
|
|
||||||
<legend>Informations matériel</legend>
|
|
||||||
<dl class="describe">
|
|
||||||
<dt>Matériel</dt>
|
|
||||||
<dd>{{$equipment.name}}</dd>
|
|
||||||
<dt>Catégorie</dt>
|
|
||||||
<dd>{{$cat_name}}</dd>
|
|
||||||
<dt>Quantité présente</dt>
|
|
||||||
<dd>{{$present}}</dd>
|
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
<fieldset class="sortie">
|
|
||||||
<legend>Enregistrer la sortie d'un matériel présent temporairement</legend>
|
|
||||||
<dl>
|
|
||||||
{{:input type="select" name="operation" label="Type" required=true options=$output_labels|sort}}
|
|
||||||
{{:input type="date" name="date" label="Date de sortie" required=true default=$now|date_short}}
|
|
||||||
{{:input type="number" name="amount" label="Quantité" required=true default=$present min=1 max=$present}}
|
|
||||||
{{:input type="textarea" name="remarques" label="Remarques" cols="40" rows="3" required=false}}
|
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
<p class="submit">
|
|
||||||
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
|
||||||
</p>
|
|
||||||
</form>
|
|
||||||
{{else}}
|
|
||||||
<p class="block error">Il n'y a aucun matériel en stock</p>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{:admin_footer}}
|
|
@ -21,9 +21,18 @@
|
|||||||
{{:include file="../_get_config.html" keep="config"}}
|
{{:include file="../_get_config.html" keep="config"}}
|
||||||
|
|
||||||
{{#form on="delete"}}
|
{{#form on="delete"}}
|
||||||
|
|
||||||
{{* vérifier s'il est possible de supprimer le mouvement *}}
|
{{* vérifier s'il est possible de supprimer le mouvement *}}
|
||||||
{{if $mvt_suppr.direction == 'input'}}
|
{{if $mvt_suppr.direction == 'input'}}
|
||||||
|
{{:assign var="type_operation" from="config.input_nature.%s.type"|args:$mvt_suppr.operation}}
|
||||||
|
|
||||||
|
{{if $type_operation == 'temporaire'}}
|
||||||
|
{{#load type="link" where="$$.temp_key = :key OR $$.return = :key" :key=$_GET.key}}
|
||||||
|
{{:assign link_key=$key}}
|
||||||
|
{{/load}}
|
||||||
|
{{if $link_key != null}}
|
||||||
|
{{:redirect force="../historique.html?key=%s&prop=%s&err=1&msg=suppression"|args:$mvt_suppr.equipment:$_GET.prop}}
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
{{:assign dispo=0}}
|
{{:assign dispo=0}}
|
||||||
{{:assign nonprop=0}}
|
{{:assign nonprop=0}}
|
||||||
|
|
||||||
@ -59,46 +68,27 @@
|
|||||||
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{else}}
|
{{else}}
|
||||||
{{* sortie *}}
|
{{* sortie *}}
|
||||||
{{:assign temporaire=false}}
|
|
||||||
{{:assign var="type_operation" from="config.output_nature.%s.type"|args:$mvt_suppr.operation}}
|
{{:assign var="type_operation" from="config.output_nature.%s.type"|args:$mvt_suppr.operation}}
|
||||||
|
|
||||||
{{if $type_operation == 'temporaire'}}
|
{{if $type_operation == 'temporaire'}}
|
||||||
{{:assign exterieur=0}}
|
{{#load type="link" where="$$.temp_key = :key OR $$.return = :key" :key=$_GET.key}}
|
||||||
{{#load
|
{{:assign link_key=$key}}
|
||||||
type="movement"
|
{{/load}}
|
||||||
where="$$.equipment = :key" :key=$mvt_suppr.equipment
|
{{if $link_key != null}}
|
||||||
assign="mvt"
|
|
||||||
order="$$.date"}}
|
|
||||||
|
|
||||||
{{* déterminer le type de mouvement *}}
|
|
||||||
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt.direction:$mvt.operation}}
|
|
||||||
|
|
||||||
{{if $key != $_GET.key}}
|
|
||||||
{{* ce n'est pas le mouvement à supprimer : cumuler les entrées/sorties *}}
|
|
||||||
{{if $mvt.direction == 'input'}}
|
|
||||||
{{if $type_mvt == 'retour'}}
|
|
||||||
{{:assign exterieur="%d-%d"|math:$exterieur:$mvt.amount}}
|
|
||||||
{{/if}}
|
|
||||||
{{elseif $mvt.direction == 'output'}}
|
|
||||||
{{if $type_mvt == 'temporaire'}}
|
|
||||||
{{:assign exterieur="%d+%d"|math:$exterieur:$mvt.amount}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* problème ? *}}
|
|
||||||
{{if $exterieur < 0}}
|
|
||||||
{{:redirect force="../historique.html?key=%s&prop=%s&err=1&msg=suppression"|args:$mvt_suppr.equipment:$_GET.prop}}
|
{{:redirect force="../historique.html?key=%s&prop=%s&err=1&msg=suppression"|args:$mvt_suppr.equipment:$_GET.prop}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/load}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* vérification réussie : supprimer le mouvement *}}
|
{{* vérification réussie : supprimer le mouvement *}}
|
||||||
{{:delete key=$_GET.key}}
|
{{:delete key=$_GET.key}}
|
||||||
|
{{if $link_key != null}}
|
||||||
|
{{:delete key=$link_key}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{* voir s'il reste des mouvements pour le matériel concerné par le mouvement supprimé *}}
|
{{* voir s'il reste des mouvements pour le matériel concerné par le mouvement supprimé *}}
|
||||||
{{#load type="movement" where="$$.equipment = :eqpmt_key" :eqpmt_key=$equipment.key}}
|
{{#load type="movement" where="$$.equipment = :eqpmt_key" :eqpmt_key=$equipment.key}}
|
||||||
|
Loading…
Reference in New Issue
Block a user