fiche membre : ajout bouton retour et séparation mouvements temporaires et définitifs
This commit is contained in:
parent
8f759dcf77
commit
7340f44aa8
@ -3,52 +3,73 @@
|
||||
{{#restrict section="users" level="read"}}{{/restrict}}
|
||||
|
||||
{{* lecture config (défaut ou enregistrée) *}}
|
||||
{{:include file="../_get_config.html" keep="config"}}
|
||||
{{:include file="../_get_config.html" keep="config, directions"}}
|
||||
|
||||
{{#foreach from=$config.output_nature key=key}}
|
||||
{{:assign var="types.output.%s."|args:$type value=$key}}
|
||||
{{/foreach}}
|
||||
|
||||
{{#foreach from=$types.output key=key}}
|
||||
{{:assign var=elem from="types.output.%s"|args:$key}}
|
||||
{{:assign elem=$elem|quote_sql|implode:","}}
|
||||
{{#foreach from=$directions key="direction"}}
|
||||
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
|
||||
{{#foreach from=$nature key=key}}
|
||||
{{:assign var="types.%s.%s."|args:$direction:$type value=$key|quote_sql}}
|
||||
{{/foreach}}
|
||||
{{:assign var="io_types" from="types.%s"|args:$direction}}
|
||||
{{#foreach from=$io_types key=key}}
|
||||
{{:assign var=elem from="io_types.%s"|args:$key}}
|
||||
{{:assign elem=$elem|implode:","}}
|
||||
{{:assign elem="("|cat:$elem|cat:")"}}
|
||||
{{:assign var="output_types.%s"|args:$key value=$elem}}
|
||||
{{:assign var="%s_types.%s"|args:$direction:$key value=$elem}}
|
||||
{{/foreach}}
|
||||
{{/foreach}}
|
||||
|
||||
{{#select
|
||||
json_extract(eqpmt.document, '$.name') as mat,
|
||||
json_extract(eqpmt.document, '$.name') as eqpmt_name,
|
||||
mvt.key AS mvt_key,
|
||||
json_extract(mvt.document, '$.direction') as direction,
|
||||
json_extract(mvt.document, '$.operation') as operation,
|
||||
json_extract(mvt.document, '$.date') as date,
|
||||
json_extract(mvt.document, '$.amount') as qte
|
||||
json_extract(mvt.document, '$.amount') as amount
|
||||
FROM module_data_equipment AS mvt
|
||||
INNER JOIN users ON json_extract(mvt.document, '$.user') = users.id
|
||||
INNER JOIN module_data_equipment AS eqpmt
|
||||
ON json_extract(mvt.document, '$.equipment') = eqpmt.key
|
||||
WHERE users.id = :user AND json_extract(mvt.document, '$.operation') IN !output_types
|
||||
ORDER BY date DESC
|
||||
WHERE users.id = :user AND json_extract(mvt.document, '$.operation') IN !output_types OR json_extract(mvt.document, '$.operation') IN !input_types
|
||||
ORDER BY date
|
||||
;
|
||||
:user = $user.id
|
||||
!output_types=$output_types.temporaire
|
||||
!input_types=$input_types.retour
|
||||
assign="temp_mat."
|
||||
}}
|
||||
{{/select}}
|
||||
|
||||
{{if $temp_mat|count != 0}}
|
||||
<h3 class="ruler">Matériels en prêt</h3>
|
||||
<h3 class="ruler">Matériels attribués temporairement</h3>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Matériel</td>
|
||||
<td>Date</td>
|
||||
<td>Quantité</td>
|
||||
<td>Opération</td>
|
||||
<td class="actions"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#foreach from=$temp_mat}}
|
||||
{{: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}}
|
||||
<tr>
|
||||
<td>{{$mat}}</td>
|
||||
<td>{{$eqpmt_name}}</td>
|
||||
<td>{{$date|date_short}}</td>
|
||||
<td>{{$qte}}</td>
|
||||
<td>{{$amount}}</td>
|
||||
<td>{{$op_label}}</td>
|
||||
<td class="actions">
|
||||
{{if $direction == "output" && $type_mvt == "temporaire"}}
|
||||
{{:linkbutton
|
||||
label="Retour"
|
||||
href="%smouvements/output_return.html?key=%s&prop=0"|args:$module.url:$mvt_key
|
||||
shape="history"
|
||||
target="_dialog"}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
@ -56,9 +77,11 @@
|
||||
{{/if}}
|
||||
|
||||
{{#select
|
||||
json_extract(eqpmt.document, '$.name') as mat,
|
||||
json_extract(eqpmt.document, '$.name') as eqpmt_name,
|
||||
json_extract(mvt.document, '$.direction') as direction,
|
||||
json_extract(mvt.document, '$.operation') as operation,
|
||||
json_extract(mvt.document, '$.date') as date,
|
||||
json_extract(mvt.document, '$.amount') as qte
|
||||
json_extract(mvt.document, '$.amount') as amount
|
||||
FROM module_data_equipment AS mvt
|
||||
INNER JOIN users ON json_extract(mvt.document, '$.user') = users.id
|
||||
INNER JOIN module_data_equipment AS eqpmt
|
||||
@ -80,14 +103,17 @@
|
||||
<td>Matériel</td>
|
||||
<td>Date</td>
|
||||
<td>Quantité</td>
|
||||
<td>Opération</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#foreach from=$def_mat}}
|
||||
{{:assign var="op_label" from="config.%s_nature.%s.label"|args:$direction:$operation}}
|
||||
<tr>
|
||||
<td>{{$mat}}</td>
|
||||
<td>{{$eqpmt_name}}</td>
|
||||
<td>{{$date|date_short}}</td>
|
||||
<td>{{$qte}}</td>
|
||||
<td>{{$amount}}</td>
|
||||
<td>{{$op_label}}</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
|
Loading…
Reference in New Issue
Block a user