Compare commits

..

No commits in common. "b5afcb8ea380ade86796300ab650b06c090b8ce7" and "64d57b8560861983ace646930a4a64b3ae5dfe8c" have entirely different histories.

5 changed files with 23 additions and 33 deletions

View File

@ -9,19 +9,11 @@
{{* 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|tolower|ucfirst name=$_POST.name|trim
}} }}
{{:redirect force="./index.html?ok=1&msg=modification"}} {{:redirect force="./index.html?ok=1&msg=modification"}}
{{/form}} {{/form}}

View File

@ -42,18 +42,19 @@
{{#list {{#list
select=" select="
(SELECT $$.designation $$.date AS 'Date' ;
FROM @TABLE AS b (SELECT $$.designation
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ; FROM @TABLE AS b
"" as 'Catégorie' ; WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
"" AS 'Stock' ; "" as 'Catégorie' ;
"" AS 'Sorti' ; "" AS 'Stock' ;
"" AS 'Dispo' "" AS 'Sorti' ;
"" AS 'Dispo'
" "
type="movement" type="movement"
group="$$.equipment" group="$$.equipment"
direction="input" direction="input"
order=1 order=2
}} }}
{{:assign var=cat_key from="equipments.%s.category"|args:$equipment}} {{:assign var=cat_key from="equipments.%s.category"|args:$equipment}}
@ -71,7 +72,8 @@
{{/if}} {{/if}}
<tr> <tr>
<td>{{$col1}}</td> <td>{{$date|date_short}}</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>

View File

@ -42,16 +42,17 @@
{{#list {{#list
select=" select="
(SELECT $$.designation $$.date AS 'Date' ;
FROM @TABLE AS b (SELECT $$.designation
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ; FROM @TABLE AS b
"" as 'Catégorie' ; WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ;
"" AS 'Quantité' "" as 'Catégorie' ;
"" AS 'Quantité'
" "
type="movement" type="movement"
group="$$.equipment" group="$$.equipment"
direction="input" direction="input"
order=1 order=2
}} }}
{{:assign var=cat_key from="equipments.%s.category"|args:$equipment}} {{:assign var=cat_key from="equipments.%s.category"|args:$equipment}}
@ -66,7 +67,8 @@
{{:continue}} {{:continue}}
{{/if}} {{/if}}
<tr> <tr>
<td>{{$col1}}</td> <td>{{$date|date_short}}</td>
<td>{{$col2}}</td>
<td>{{$cat_name}}</td> <td>{{$cat_name}}</td>
<td>{{$qte}}</td> <td>{{$qte}}</td>
<td class="actions"> <td class="actions">

View File

@ -32,12 +32,6 @@
{{* 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}}

View File

@ -2,7 +2,7 @@
{{* {{*
paramètres : paramètres :
- key : clé du matériel qui revient - key : clé du mouvement à modifier
- 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 un retour de matériel</legend> <legend>Ajouter une entrée pour 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}}