refonte config types ES
This commit is contained in:
parent
b19904b05b
commit
08ff1f82fd
16 changed files with 133 additions and 208 deletions
|
|
@ -52,11 +52,9 @@
|
|||
|
||||
{{* récupérer la config des entrées/sorties *}}
|
||||
{{:include file="./_get_config.html" keep="config"}}
|
||||
{{:debug config.input_nature=$config.input_nature}}
|
||||
|
||||
{{* déterminer les types de mouvements selon l'affection du matériel *}}
|
||||
{{#foreach from=$config.input_nature}}
|
||||
{{:debug key=$key label=$label type=$type}}
|
||||
{{if $_GET.prop}}
|
||||
{{* matériel propriété de l'asso *}}
|
||||
{{if $type != 'temporaire'}}
|
||||
|
|
@ -69,7 +67,6 @@
|
|||
{{/if}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{:debug input_types=$input_types}}
|
||||
|
||||
{{#foreach from=$config.output_nature}}
|
||||
{{if $_GET.prop}}
|
||||
|
|
@ -91,8 +88,8 @@
|
|||
{{:assign nonproprio=0}}
|
||||
|
||||
{{#load type="movement" where="$$.equipment = :key" :key=$equipment_key order="$$.date"}}
|
||||
{{if $direction == 'input'}}
|
||||
{{:assign var="type_mvt" from="config.input_nature.%s"|args:$input_nature}}
|
||||
{{if $direction == 'input'}}
|
||||
{{:assign var="type_mvt" from="config.input_nature.%s.type"|args:$operation}}
|
||||
{{if $type_mvt == 'définitif'}}
|
||||
{{:assign stock="%d+%d"|math:$stock:$amount}}
|
||||
{{elseif $type_mvt == 'retour'}}
|
||||
|
|
@ -101,7 +98,7 @@
|
|||
{{:assign nonproprio="%d+%d"|math:$nonproprio:$amount}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{:assign var="type_mvt" from="config.output_nature.%s"|args:$output_nature}}
|
||||
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$operation}}
|
||||
{{if $type_mvt == 'définitif'}}
|
||||
{{:assign stock="%d-%d"|math:$stock:$amount}}
|
||||
{{elseif $type_mvt == 'temporaire'}}
|
||||
|
|
@ -123,7 +120,7 @@
|
|||
type="movement"
|
||||
select="$$.date AS 'Date';
|
||||
CASE $$.direction WHEN 'input' THEN 'Entrée' WHEN 'output' THEN 'Sortie' END AS 'Mouvement';
|
||||
CASE $$.direction WHEN 'input' THEN $$.input_nature WHEN 'output' THEN $$.output_nature END AS 'Opération';
|
||||
$$.operation AS 'Opération';
|
||||
$$.amount AS 'Quantité';
|
||||
"" as 'Stock';
|
||||
"" as 'Sorti';
|
||||
|
|
@ -132,10 +129,11 @@
|
|||
equipment=$equipment_key
|
||||
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:$operation}}
|
||||
{{:assign var="op_label" from="config.%s_nature.%s.label"|args:$direction:$operation}}
|
||||
|
||||
{{if $direction === "input" && $input_nature|in:$input_types ||
|
||||
$direction === "output"&& $output_nature|in:$output_types
|
||||
{{if $direction === "input" && $op_label|in:$input_types ||
|
||||
$direction === "output"&& $op_label|in:$output_types
|
||||
}}
|
||||
{{:assign var="stock" from="quantites.%s.stock"|args:$id}}
|
||||
{{:assign var="exterieur" from="quantites.%s.exterieur"|args:$id}}
|
||||
|
|
@ -143,7 +141,7 @@
|
|||
<tr>
|
||||
<td>{{$date|date_short}}</td>
|
||||
<td>{{$col2}}</td>
|
||||
<td>{{$col3}}</td>
|
||||
<td>{{$op_label}}</td>
|
||||
<td class="num">{{$amount}}</td>
|
||||
<td class="num">{{$stock}}</td>
|
||||
<td class="num">{{$exterieur}}</td>
|
||||
|
|
@ -152,17 +150,17 @@
|
|||
<td class="actions">
|
||||
{{:linkbutton
|
||||
label="Dupliquer"
|
||||
href="mouvements/dupliquer_mouvement.html?key=%s&direction=%s&prop=%s"|args:$key:$direction:$_GET.prop
|
||||
href="mouvements/dupliquer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
||||
shape="plus"
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="mouvements/modifier_mouvement.html?key=%s&direction=%s"|args:$key:$direction
|
||||
href="mouvements/modifier_mouvement.html?key=%s"|args:$key
|
||||
shape="edit"
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Supprimer"
|
||||
href="mouvements/supprimer_mouvement.html?key=%s&direction=%s&prop=%s"|args:$key:$direction:$_GET.prop
|
||||
href="mouvements/supprimer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
||||
shape="delete"
|
||||
target="_dialog"}}
|
||||
</td>
|
||||
|
|
@ -175,7 +173,7 @@
|
|||
type="movement"
|
||||
select="$$.date AS 'Date';
|
||||
CASE $$.direction WHEN 'input' THEN 'Entrée' WHEN 'output' THEN 'Sortie' END AS 'Mouvement';
|
||||
CASE $$.direction WHEN 'input' THEN $$.input_nature WHEN 'output' THEN $$.output_nature END AS 'Opération';
|
||||
$$.operation AS 'Opération';
|
||||
$$.amount AS 'Quantité';
|
||||
"" as 'Présent';
|
||||
$$.comment AS 'Commentaire'"
|
||||
|
|
@ -183,32 +181,33 @@
|
|||
order=1
|
||||
}}
|
||||
{{:assign var="type_mvt" from="config.%s_nature.%s"|args:$direction:$col3}}
|
||||
{{:assign var="op_label" from="config.%s_nature.%s.label"|args:$direction:$operation}}
|
||||
|
||||
{{if $direction === "input" && $input_nature|in:$input_types ||
|
||||
$direction === "output"&& $output_nature|in:$output_types
|
||||
{{if $direction === "input" && $op_label|in:$input_types ||
|
||||
$direction === "output"&& $op_label|in:$output_types
|
||||
}}
|
||||
{{:assign var="stock" from="quantites.%s.nonproprio"|args:$id}}
|
||||
<tr>
|
||||
<td>{{$date|date_short}}</td>
|
||||
<td>{{$col2}}</td>
|
||||
<td>{{$col3}}</td>
|
||||
<td>{{$op_label}}</td>
|
||||
<td class="num">{{$amount}}</td>
|
||||
<td class="num">{{$stock}}</td>
|
||||
<td>{{$comment}}</td>
|
||||
<td class="actions">
|
||||
{{:linkbutton
|
||||
label="Dupliquer"
|
||||
href="mouvements/dupliquer_mouvement.html?key=%s&direction=%s&prop=%s"|args:$key:$direction:$_GET.prop
|
||||
href="mouvements/dupliquer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
||||
shape="plus"
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="mouvements/modifier_mouvement.html?key=%s&direction=%s"|args:$key:$direction
|
||||
href="mouvements/modifier_mouvement.html?key=%s"|args:$key
|
||||
shape="edit"
|
||||
target="_dialog"}}
|
||||
{{:linkbutton
|
||||
label="Supprimer"
|
||||
href="mouvements/supprimer_mouvement.html?key=%s&direction=%s&prop=%s"|args:$key:$direction:$_GET.prop
|
||||
href="mouvements/supprimer_mouvement.html?key=%s&prop=%s"|args:$key:$_GET.prop
|
||||
shape="delete"
|
||||
target="_dialog"}}
|
||||
</td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue