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