Compare commits

...

3 Commits

5 changed files with 67 additions and 16 deletions

View File

@ -12,6 +12,10 @@
{{* récupérer la config des entrées/sorties *}} {{* récupérer la config des entrées/sorties *}}
{{:include file="./_get_config.html" keep="config"}} {{:include file="./_get_config.html" keep="config"}}
<div class="shortFormLeft">
<p class="help">Historique des mouvements</p>
</div>
{{* lister tous les mouvements *}} {{* lister tous les mouvements *}}
{{#list {{#list
type="movement" type="movement"
@ -19,8 +23,8 @@
CASE $$.direction WHEN 'input' THEN 'Entrée' WHEN 'output' THEN 'Sortie' END AS 'Mouvement'; CASE $$.direction WHEN 'input' THEN 'Entrée' WHEN 'output' THEN 'Sortie' END AS 'Mouvement';
$$.operation AS 'Opération'; $$.operation AS 'Opération';
(SELECT $$.name (SELECT $$.name
FROM @TABLE AS b FROM @TABLE AS mat
WHERE b.key = @TABLE.$$.equipment) AS 'Matériel' ; WHERE mat.key = @TABLE.$$.equipment) AS 'Matériel' ;
$$.amount AS 'Quantité'; $$.amount AS 'Quantité';
$$.comment AS 'Commentaire'" $$.comment AS 'Commentaire'"
order=1 order=1

View File

@ -28,7 +28,7 @@
{{else}} {{else}}
{{:error message="Le matériel %s n'appartient à aucune catégorie"|args:$equipment.name}} {{:error message="Le matériel %s n'appartient à aucune catégorie"|args:$equipment.name}}
{{/load}} {{/load}}
{{:admin_header title="Gestion des matériels" current="module_equipment"}} {{:admin_header title="Gestion des matériels" custom_css="./style.css" current="module_equipment"}}
{{if $_GET.current != null}} {{if $_GET.current != null}}
{{:assign current=$_GET.current}} {{:assign current=$_GET.current}}

View File

@ -70,46 +70,85 @@
WHERE cat.key = @TABLE.$$.category) AS 'Catégorie' ; WHERE cat.key = @TABLE.$$.category) AS 'Catégorie' ;
(SELECT (SELECT
SUM($$.amount) SUM($$.amount)
FROM module_data_equipment AS mvt FROM @TABLE AS mvt
WHERE WHERE
$$.type = 'movement' $$.type = 'movement'
AND AND
$$.operation IN %s $$.operation IN %s
AND AND
$$.equipment = module_data_equipment.key $$.equipment = @TABLE.key
) - ) -
(SELECT (SELECT
COALESCE(SUM($$.amount), 0) COALESCE(SUM($$.amount), 0)
FROM module_data_equipment AS mvt FROM @TABLE AS mvt
WHERE WHERE
$$.type = 'movement' $$.type = 'movement'
AND AND
$$.operation IN %s $$.operation IN %s
AND AND
$$.equipment = module_data_equipment.key $$.equipment = @TABLE.key
) AS 'Stock' ; ) AS 'Stock' ;
(SELECT (SELECT
COALESCE(SUM($$.amount), 0) COALESCE(SUM($$.amount), 0)
FROM module_data_equipment AS mvt FROM @TABLE AS mvt
WHERE WHERE
$$.type = 'movement' $$.type = 'movement'
AND AND
$$.operation IN %s $$.operation IN %s
AND AND
$$.equipment = module_data_equipment.key $$.equipment = @TABLE.key
) - ) -
(SELECT (SELECT
COALESCE(SUM($$.amount), 0) COALESCE(SUM($$.amount), 0)
FROM module_data_equipment AS mvt FROM @TABLE AS mvt
WHERE WHERE
$$.type = 'movement' $$.type = 'movement'
AND AND
$$.operation IN %s $$.operation IN %s
AND AND
$$.equipment = module_data_equipment.key $$.equipment = @TABLE.key
) AS 'Sorti' ; ) AS 'Sorti' ;
'' AS 'Disponible'
"|args:$input_types.définitif:$output_types.définitif:$output_types.temporaire:$input_types.retour (SELECT
SUM($$.amount)
FROM @TABLE AS mvt
WHERE
$$.type = 'movement'
AND
$$.operation IN %s
AND
$$.equipment = @TABLE.key
) -
(SELECT
COALESCE(SUM($$.amount), 0)
FROM @TABLE AS mvt
WHERE
$$.type = 'movement'
AND
$$.operation IN %s
AND
$$.equipment = @TABLE.key
) -
(SELECT
COALESCE(SUM($$.amount), 0)
FROM @TABLE AS mvt
WHERE
$$.type = 'movement'
AND
$$.operation IN %s
AND
$$.equipment = @TABLE.key
) + (SELECT
COALESCE(SUM($$.amount), 0)
FROM @TABLE AS mvt
WHERE
$$.type = 'movement'
AND
$$.operation IN %s
AND
$$.equipment = @TABLE.key
) AS 'Disponible'
"|args:$input_types.définitif:$output_types.définitif:$output_types.temporaire:$input_types.retour:$input_types.définitif:$output_types.définitif:$output_types.temporaire:$input_types.retour
type="equipment" type="equipment"
where="$$.status <> 'archived' AND %s"|args:$condition where="$$.status <> 'archived' AND %s"|args:$condition
group="col1 HAVING col3 NOT NULL" group="col1 HAVING col3 NOT NULL"
@ -117,14 +156,13 @@
}} }}
{{:assign var=cat_name from=categories.%s|args:$category}} {{:assign var=cat_name from=categories.%s|args:$category}}
{{:assign dispo="%d-%d"|math:$col3:$col4}}
<tr> <tr>
<td>{{$name}}</td> <td>{{$name}}</td>
<td>{{$cat_name}}</td> <td>{{$cat_name}}</td>
<td class="num">{{$col3}}</td> <td class="num">{{$col3}}</td>
<td class="num">{{$col4}}</td> <td class="num">{{$col4}}</td>
<td class="num nosort">{{$dispo}}</td> <td class="num">{{$col5}}</td>
<td class="actions"> <td class="actions">
{{if $col4 > 0}} {{if $col4 > 0}}
{{:linkbutton {{:linkbutton
@ -133,7 +171,7 @@
shape="history" shape="history"
target="_dialog"}} target="_dialog"}}
{{/if}} {{/if}}
{{if $dispo > 0}} {{if $col5 > 0}}
{{:linkbutton {{:linkbutton
label="Sortie" label="Sortie"
shape="minus" shape="minus"

View File

@ -18,6 +18,10 @@ function disableColumSort(liste) {
anchor.removeAttribute("href"); anchor.removeAttribute("href");
anchor.removeAttribute("title"); anchor.removeAttribute("title");
anchor.removeChild(anchor.firstElementChild); anchor.removeChild(anchor.firstElementChild);
let headerClass = titles[i].getAttribute("class");
if (headerClass == null) { headerClass = ""; }
headerClass += "nosort";
titles[i].setAttribute("class", headerClass);
} }
} }
} }

View File

@ -26,3 +26,8 @@
margin-top : 0; margin-top : 0;
margin-left : 0; margin-left : 0;
} }
/* désactiver rétroaction pour colonnes non triables */
table.list > thead td[class~=nosort] a:hover {
background-color : rgba(var(--gSecondColor), 0.);
}