2024-10-24 10:15:56 +02:00
|
|
|
{{* -*- brindille -*- *}}
|
|
|
|
|
2024-10-28 09:53:29 +01:00
|
|
|
|
2023-10-30 17:45:56 +01:00
|
|
|
{{:assign equipment_key=$_GET.key|trim}}
|
|
|
|
{{#load key=$_GET.key assign="equipment"}}
|
|
|
|
{{else}}
|
2023-12-06 09:59:11 +01:00
|
|
|
{{:error message="Pas de matériel avec la clé %s"|args:$equipment_key}}
|
2023-10-30 17:45:56 +01:00
|
|
|
{{/load}}
|
|
|
|
|
|
|
|
{{#load type="category" where="key = :cle" :cle=$equipment.category assign="category"}}
|
|
|
|
{{else}}
|
2023-12-06 09:59:11 +01:00
|
|
|
{{:error message="Le matériel %s n'appartient à aucune catégorie"|args:$equipment.designation}}
|
2023-10-30 17:45:56 +01:00
|
|
|
{{/load}}
|
2024-10-28 09:53:29 +01:00
|
|
|
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
|
|
|
|
|
|
|
|
{{if $_GET.ok}}
|
|
|
|
{{if $_GET.msg == "modification"}}
|
|
|
|
<p class="block confirm">Modification enregistrée</p>
|
|
|
|
{{elseif $_GET.msg == "suppression"}}
|
|
|
|
<p class="block confirm">Mouvement supprimé</p>
|
|
|
|
{{else}}
|
|
|
|
<p class="block confirm">{{$_GET.msg}}</p>
|
|
|
|
{{/if}}
|
|
|
|
{{elseif $_GET.err}}
|
|
|
|
{{if $_GET.msg == "suppression"}}
|
|
|
|
<p class="block error">Ce mouvement ne peut être supprimé</p>
|
|
|
|
{{else}}
|
|
|
|
<p class="block error">{{$_GET.msg}}</p>
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{* barre de navigation *}}
|
|
|
|
{{if ! $dialog}}
|
|
|
|
{{:include file="./_nav.html" current="mouvements"}}
|
|
|
|
{{/if}}
|
2023-10-30 17:45:56 +01:00
|
|
|
|
2024-10-18 17:15:56 +02:00
|
|
|
{{* récupérer la config des entrées/sorties *}}
|
|
|
|
{{:include file="./_get_config.html" keep="config"}}
|
|
|
|
|
|
|
|
{{* déterminer les type de mouvements selon l'affection du matériel *}}
|
|
|
|
{{#foreach from=$config.input_nature key=mvt item=type_mvt}}
|
|
|
|
{{if $_GET.prop}}
|
|
|
|
{{* matériel propriété de l'asso *}}
|
|
|
|
{{if $type_mvt != 'temporaire'}}
|
|
|
|
{{:assign var="input_types." value=$mvt}}
|
|
|
|
{{/if}}
|
|
|
|
{{else}}
|
|
|
|
{{* matériel non propriété de l'asso *}}
|
|
|
|
{{if $type_mvt == 'temporaire'}}
|
|
|
|
{{:assign var="input_types." value=$mvt}}
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
{{/foreach}}
|
2024-10-28 09:53:29 +01:00
|
|
|
|
2024-10-18 17:15:56 +02:00
|
|
|
{{#foreach from=$config.output_nature key=mvt item=type_mvt}}
|
|
|
|
{{if $_GET.prop}}
|
|
|
|
{{* matériel propriété de l'asso *}}
|
|
|
|
{{if $type_mvt != 'retour'}}
|
|
|
|
{{:assign var="output_types." value=$mvt}}
|
|
|
|
{{/if}}
|
|
|
|
{{else}}
|
|
|
|
{{* matériel non propriété de l'asso *}}
|
|
|
|
{{if $type_mvt == 'retour'}}
|
|
|
|
{{:assign var="output_types." value=$mvt}}
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
{{/foreach}}
|
|
|
|
|
2023-10-30 17:45:56 +01:00
|
|
|
{{* lister tous les mouvements du matériel passé en paramètre *}}
|
2024-10-28 09:53:29 +01:00
|
|
|
<h2>Mouvements de {{$equipment.designation}} ({{$category.name}})</h2>
|
|
|
|
|
2023-10-30 17:45:56 +01:00
|
|
|
{{#list
|
2023-12-06 09:59:11 +01:00
|
|
|
type="movement"
|
|
|
|
select="$$.date AS 'Date';
|
|
|
|
CASE $$.direction WHEN 'input' THEN 'Entrée' WHEN 'output' THEN 'Sortie' END AS 'Mvt';
|
2024-10-24 10:15:56 +02:00
|
|
|
CASE $$.direction WHEN 'input' THEN $$.input_nature WHEN 'output' THEN $$.output_nature END AS 'operation';
|
2023-12-06 09:59:11 +01:00
|
|
|
$$.amount AS 'Nombre';
|
|
|
|
$$.comment AS 'Commentaire'"
|
|
|
|
equipment=$equipment_key
|
|
|
|
order=1
|
2023-10-30 17:45:56 +01:00
|
|
|
}}
|
2024-10-24 10:15:56 +02:00
|
|
|
{{:assign var="type_mvt" from="config.%s_nature.%s"|args:$direction:$col3}}
|
2024-10-28 09:53:29 +01:00
|
|
|
{{if $direction == 'input'}}
|
|
|
|
{{:assign sens="entree"}}
|
|
|
|
{{else}}
|
|
|
|
{{:assign sens="sortie"}}
|
|
|
|
{{/if}}
|
2024-10-24 10:15:56 +02:00
|
|
|
|
|
|
|
{{if $direction === "input" && $input_nature|in:$input_types ||
|
|
|
|
$direction === "output"&& $output_nature|in:$output_types
|
2024-10-18 17:15:56 +02:00
|
|
|
}}
|
|
|
|
<tr>
|
|
|
|
<td>{{$date|date_short}}</td>
|
|
|
|
<td>{{$col2}}</td>
|
|
|
|
<td>{{$col3}}</td>
|
|
|
|
<td>{{$amount}}</td>
|
|
|
|
<td>{{$comment}}</td>
|
2024-10-24 10:15:56 +02:00
|
|
|
<td class="actions">
|
2024-10-28 09:53:29 +01:00
|
|
|
{{if $direction === "input" && $type_mvt == 'temporaire'}}
|
|
|
|
{{:linkbutton
|
2024-10-24 10:15:56 +02:00
|
|
|
label="Retour"
|
2024-10-29 10:24:50 +01:00
|
|
|
href="%smouvements/sorties/emprunte.html?key=%s&prop=%s"|args:$module.url:$key:$_GET.prop
|
2024-10-24 10:15:56 +02:00
|
|
|
shape="history"
|
|
|
|
target="_dialog"}}
|
2024-10-28 09:53:29 +01:00
|
|
|
{{elseif $direction === "input" && $type_mvt == 'définitif'}}
|
|
|
|
{{:linkbutton
|
2024-10-24 10:15:56 +02:00
|
|
|
label="Sortir"
|
2024-10-29 10:24:50 +01:00
|
|
|
href="%smouvements/sorties/stock_disponible.html?key=%s&prop=%s"|args:$module.url:$key:$_GET.prop
|
2024-10-24 10:15:56 +02:00
|
|
|
shape="minus"
|
|
|
|
target="_dialog"}}
|
2024-10-28 09:53:29 +01:00
|
|
|
{{elseif $direction === "output" && $type_mvt == 'temporaire'}}
|
2024-10-24 10:15:56 +02:00
|
|
|
{{:linkbutton
|
2024-10-28 09:53:29 +01:00
|
|
|
label="Retour"
|
2024-10-29 10:24:50 +01:00
|
|
|
href="%smouvements/entrees/retour.html?key=%s&prop=%s"|args:$module.url:$key:$_GET.prop
|
2024-10-28 09:53:29 +01:00
|
|
|
shape="history"
|
2024-10-24 10:15:56 +02:00
|
|
|
target="_dialog"}}
|
|
|
|
{{/if}}
|
2024-10-28 09:53:29 +01:00
|
|
|
{{:linkbutton
|
|
|
|
label="Dupliquer"
|
2024-10-29 10:24:50 +01:00
|
|
|
href="%smouvements/dupliquer_mouvement.html?key=%s&direction=%s&prop=%s"|args:$module.url:$key:$direction:$_GET.prop
|
2024-10-28 09:53:29 +01:00
|
|
|
shape="plus"
|
|
|
|
target="_dialog"}}
|
|
|
|
{{:linkbutton
|
|
|
|
label="Modifier"
|
2024-10-29 10:24:50 +01:00
|
|
|
href="%smouvements/modifier_mouvement.html?key=%s&direction=%s&prop=%s"|args:$module.url:$key:$direction:$_GET.prop
|
2024-10-28 09:53:29 +01:00
|
|
|
shape="edit"
|
|
|
|
target="_dialog"}}
|
|
|
|
{{:linkbutton
|
|
|
|
label="Supprimer"
|
2024-10-29 10:24:50 +01:00
|
|
|
href="%smouvements/supprimer_mouvement.html?key=%s&direction=%s&prop=%s"|args:$module.url:$key:$direction:$_GET.prop
|
2024-10-28 09:53:29 +01:00
|
|
|
shape="delete"
|
|
|
|
target="_dialog"}}
|
2024-10-24 10:15:56 +02:00
|
|
|
</td>
|
2024-10-18 17:15:56 +02:00
|
|
|
</tr>
|
|
|
|
{{/if}}
|
2023-10-30 17:45:56 +01:00
|
|
|
{{/list}}
|
|
|
|
|
|
|
|
{{:admin_footer}}
|