Compare commits
4 Commits
64d57b8560
...
b5afcb8ea3
Author | SHA1 | Date | |
---|---|---|---|
b5afcb8ea3 | |||
3132f3b7ce | |||
3e3ae7b033 | |||
56b11a0edf |
@ -9,11 +9,19 @@
|
||||
|
||||
{{* Traiter l'envoi du formulaire *}}
|
||||
{{#form on="save"}}
|
||||
{{* Vérifier s'il existe déjà une catégorie avec le même nom *}}
|
||||
{{#load type="category"}}
|
||||
{{if $name|tolower == $_POST.name|trim|tolower && $key != $_GET.key}}
|
||||
{{:error message="Modification impossible car ce nom de catégorie (« %s ») existe déjà !"|args:$name|trim}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/load}}
|
||||
|
||||
{{:save
|
||||
key=$category.key
|
||||
validate_schema="./category.schema.json"
|
||||
type="category"
|
||||
name=$_POST.name|trim
|
||||
name=$_POST.name|trim|tolower|ucfirst
|
||||
}}
|
||||
{{:redirect force="./index.html?ok=1&msg=modification"}}
|
||||
{{/form}}
|
||||
|
@ -42,19 +42,18 @@
|
||||
|
||||
{{#list
|
||||
select="
|
||||
$$.date AS 'Date' ;
|
||||
(SELECT $$.designation
|
||||
FROM @TABLE AS b
|
||||
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
|
||||
"" as 'Catégorie' ;
|
||||
"" AS 'Stock' ;
|
||||
"" AS 'Sorti' ;
|
||||
"" AS 'Dispo'
|
||||
(SELECT $$.designation
|
||||
FROM @TABLE AS b
|
||||
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
|
||||
"" as 'Catégorie' ;
|
||||
"" AS 'Stock' ;
|
||||
"" AS 'Sorti' ;
|
||||
"" AS 'Dispo'
|
||||
"
|
||||
type="movement"
|
||||
group="$$.equipment"
|
||||
direction="input"
|
||||
order=2
|
||||
order=1
|
||||
}}
|
||||
|
||||
{{:assign var=cat_key from="equipments.%s.category"|args:$equipment}}
|
||||
@ -72,8 +71,7 @@
|
||||
{{/if}}
|
||||
|
||||
<tr>
|
||||
<td>{{$date|date_short}}</td>
|
||||
<td>{{$col2}}</td>
|
||||
<td>{{$col1}}</td>
|
||||
<td>{{$cat_name}}</td>
|
||||
<td>{{$stock}}</td>
|
||||
<td>{{if $exterieur == null}}0{{else}}{{$exterieur}}{{/if}}</td>
|
||||
|
@ -42,17 +42,16 @@
|
||||
|
||||
{{#list
|
||||
select="
|
||||
$$.date AS 'Date' ;
|
||||
(SELECT $$.designation
|
||||
FROM @TABLE AS b
|
||||
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
|
||||
"" as 'Catégorie' ;
|
||||
"" AS 'Quantité'
|
||||
(SELECT $$.designation
|
||||
FROM @TABLE AS b
|
||||
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
|
||||
"" as 'Catégorie' ;
|
||||
"" AS 'Quantité'
|
||||
"
|
||||
type="movement"
|
||||
group="$$.equipment"
|
||||
direction="input"
|
||||
order=2
|
||||
order=1
|
||||
}}
|
||||
|
||||
{{:assign var=cat_key from="equipments.%s.category"|args:$equipment}}
|
||||
@ -67,8 +66,7 @@
|
||||
{{:continue}}
|
||||
{{/if}}
|
||||
<tr>
|
||||
<td>{{$date|date_short}}</td>
|
||||
<td>{{$col2}}</td>
|
||||
<td>{{$col1}}</td>
|
||||
<td>{{$cat_name}}</td>
|
||||
<td>{{$qte}}</td>
|
||||
<td class="actions">
|
||||
|
@ -32,6 +32,12 @@
|
||||
|
||||
{{* Traiter l'envoi du formulaire *}}
|
||||
{{#form on="save"}}
|
||||
|
||||
{{* vérifier la quantité saisie *}}
|
||||
{{if $_POST.quantite <= 0}}
|
||||
{{:error message="La quantité (%s) doit être strictement positive !!"|args:$_POST.quantite}}
|
||||
{{/if}}
|
||||
|
||||
{{* Enregistrer le mouvement *}}
|
||||
{{:assign mvt_key=""|uuid}}
|
||||
{{:assign var="operation" from="input_labels.%d|args:$_POST.nature_operation}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{{*
|
||||
paramètres :
|
||||
- key : clé du mouvement à modifier
|
||||
- key : clé du matériel qui revient
|
||||
- prop : = 1 si matériel propriété
|
||||
*}}
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
{{* formulaire d'entrée de matériel *}}
|
||||
<form method="post" action="">
|
||||
<fieldset class="entree">
|
||||
<legend>Ajouter une entrée pour un retour de matériel</legend>
|
||||
<legend>Ajouter un retour de matériel</legend>
|
||||
<dl>
|
||||
{{:input type="select" name="type_operation" label="Type" required=true options=$input_labels}}
|
||||
{{:input type="date" name="date" label="Date" required=true default=$now|date_short}}
|
||||
|
Loading…
Reference in New Issue
Block a user