Enregistrement quantités avec matériel
This commit is contained in:
parent
bea3a2f0e8
commit
c10ff02403
11 changed files with 291 additions and 201 deletions
|
|
@ -29,24 +29,6 @@
|
|||
<p class="help">Inventaire des matériels empruntés ou loués</p>
|
||||
</div>
|
||||
|
||||
{{* types d'entrées et sorties *}}
|
||||
{{:include file="./_get_config.html" keep="config, directions"}}
|
||||
|
||||
{{#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}}
|
||||
{{/foreach}}
|
||||
|
||||
{{:assign var="iotypes" from="types.%s"|args:$direction}}
|
||||
{{#foreach from=$iotypes key="key"}}
|
||||
{{:assign var=elem from="iotypes.%s"|args:$key}}
|
||||
{{:assign elem=$elem|quote_sql|implode:","}}
|
||||
{{:assign elem="("|cat:$elem|cat:")"}}
|
||||
{{:assign var="%s_types.%s"|args:$direction:$key value=$elem}}
|
||||
{{/foreach}}
|
||||
{{/foreach}}
|
||||
|
||||
{{* filtrer selon la catégorie *}}
|
||||
{{if $_GET.cat_key == null}}
|
||||
{{:assign condition="1"}}
|
||||
|
|
@ -61,35 +43,13 @@
|
|||
(SELECT $$.name
|
||||
FROM @TABLE as cat
|
||||
WHERE cat.key = @TABLE.$$.category) AS 'Catégorie' ;
|
||||
(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
|
||||
) AS 'Quantité'
|
||||
"|args:$input_types.temporaire:$output_types.retour
|
||||
$$.notowned AS 'Quantité'
|
||||
"
|
||||
type="equipment"
|
||||
where="$$.status <> 'archived' AND %s"|args:$condition
|
||||
group="col1 HAVING (col3 NOT NULL AND col3 > 0)"
|
||||
where="$$.status <> 'archived' AND $$.notowned != 0 AND %s"|args:$condition
|
||||
order=1
|
||||
}}
|
||||
|
||||
{{:assign var=cat_name from=categories.%s|args:$category}}
|
||||
|
||||
<tr>
|
||||
<td>{{$name}}</td>
|
||||
<td>{{$cat_name}}</td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue