Ajout date retour fiche membre et simplification affichage matériels permanents
This commit is contained in:
parent
ada1115192
commit
aee34623f4
1 changed files with 30 additions and 11 deletions
|
|
@ -44,6 +44,7 @@
|
|||
eqpmt.key as eqpmt_key,
|
||||
json_extract(eqpmt.document, '$.name') AS eqpmt_name,
|
||||
json_extract(mvt.document, '$.amount') AS qte,
|
||||
json_extract(mvt.document, '$.return_date') AS return_date,
|
||||
json_extract(mvt.document, '$.operation') AS operation
|
||||
FROM {!$module.table} AS mvt
|
||||
INNER JOIN users ON json_extract(mvt.document, '$.user') = users.id
|
||||
|
|
@ -65,9 +66,17 @@
|
|||
{{if $premier}}
|
||||
{{:assign premier=false}}
|
||||
{{:assign total=0}}
|
||||
{{:assign nb_jours=0}}
|
||||
{{:assign old_eqpmt_key=$eqpmt_key}}
|
||||
{{:assign var="ligne.date" value=$date}}
|
||||
{{:assign var="ligne.materiel" value=$eqpmt_name}}
|
||||
{{:assign var="ligne.return_date" value=$return_date}}
|
||||
{{:assign var="ligne.retard" value="0"}}
|
||||
{{if $return_date != null}}
|
||||
{{:assign ts_retour=$return_date|strtotime}}
|
||||
{{:assign nb_jours="floor((%d-%d)/(60*60*24))"|math:$now:$ts_retour}}
|
||||
{{:assign var="ligne.retard" value=$nb_jours}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{if $eqpmt_key != $old_eqpmt_key}}
|
||||
|
|
@ -76,9 +85,17 @@
|
|||
{{:assign var="lignes." value=$ligne}}
|
||||
{{/if}}
|
||||
{{:assign total=0}}
|
||||
{{:assign nb_jours=0}}
|
||||
{{:assign old_eqpmt_key=$eqpmt_key}}
|
||||
{{:assign var="ligne.date" value=$date}}
|
||||
{{:assign var="ligne.materiel" value=$eqpmt_name}}
|
||||
{{:assign var="ligne.return_date" value=$return_date}}
|
||||
{{:assign var="ligne.retard" value="0"}}
|
||||
{{if $return_date != null}}
|
||||
{{:assign ts_retour=$return_date|strtotime}}
|
||||
{{:assign nb_jours="floor((%d-%d)/(60*60*24))"|math:$now:$ts_retour}}
|
||||
{{:assign var="ligne.retard" value=$nb_jours}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{if $direction == "output"}}
|
||||
|
|
@ -101,6 +118,8 @@
|
|||
<th>Date</th>
|
||||
<th>Matériel</th>
|
||||
<th>Quantité</th>
|
||||
<th>Date de retour</th>
|
||||
<th>Remarque</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -109,6 +128,17 @@
|
|||
<td>{{$date|date_short}}</td>
|
||||
<td>{{$materiel}}</td>
|
||||
<td>{{$qte}}</td>
|
||||
<td>{{$return_date|date_short}}</td>
|
||||
<td>
|
||||
{{if $retard < 0}}
|
||||
{{:assign delai="abs(%d)"|math:$retard}}
|
||||
{{"Reste %s jours"|args:$delai}}
|
||||
{{elseif $retard >0 }}
|
||||
{{:tag color="darkred" label="Retard %s jours"|args:$retard}}
|
||||
{{else}}
|
||||
{{:tag color="darkgreen" label="À rendre aujourdh'ui"}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
|
|
@ -151,27 +181,16 @@
|
|||
<th>Matériel</th>
|
||||
<th>Opération</th>
|
||||
<th>Quantité</th>
|
||||
<th>Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#foreach from=$def_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}}
|
||||
{{:assign var="total" from="reste.%s"|args:$eqpmt_key}}
|
||||
{{if $total == null}}
|
||||
{{:assign total=0}}
|
||||
{{/if}}
|
||||
{{if $direction == 'output' && $type_mvt == 'définitif'}}
|
||||
{{:assign var="reste.%s"|args:$eqpmt_key value="%d+%d"|math:$total:$amount}}
|
||||
{{/if}}
|
||||
{{:assign var="total" from="reste.%s"|args:$eqpmt_key}}
|
||||
<tr>
|
||||
<td>{{$date|date_short}}</td>
|
||||
<td>{{$eqpmt_name}}</td>
|
||||
<td>{{$op_label}}</td>
|
||||
<td>{{$amount}}</td>
|
||||
<td>{{$total}}</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue