réorganisation (cf remarques Bohwaz)
This commit is contained in:
parent
6006bdd169
commit
0e669a7c21
23 changed files with 279 additions and 236 deletions
|
|
@ -7,18 +7,15 @@
|
|||
|
||||
{{* liste des catégories *}}
|
||||
{{if $categories === null}}
|
||||
{{#select
|
||||
key
|
||||
FROM module_data_equipment as cat
|
||||
WHERE json_extract(cat.document, '$.type') = 'category'}}
|
||||
{{#load type="category"}}
|
||||
{{:assign var="categories." value=$key}}
|
||||
{{/select}}
|
||||
{{/load}}
|
||||
{{/if}}
|
||||
|
||||
{{* date *}}
|
||||
{{if $date === null}}
|
||||
{{* :assign date=$now|date:"Y-m-d" *}}
|
||||
{{:assign date="31/12/9999"|parse_date"}}
|
||||
{{:assign date="31/12/9999"|parse_date}}
|
||||
{{* si on veut aussi lister les mouvements du futur :-) *}}
|
||||
{{/if}}
|
||||
|
||||
|
|
@ -32,8 +29,8 @@
|
|||
mvt.key as 'mvt_key',
|
||||
json_extract(mvt.document, '$.direction') as 'direction',
|
||||
CASE json_extract(mvt.document, '$.direction')
|
||||
WHEN 'entrée' THEN json_extract(mvt.document, '$.inputNature')
|
||||
WHEN 'sortie' THEN json_extract(mvt.document, '$.outputNature')
|
||||
WHEN 'input' THEN json_extract(mvt.document, '$.input_nature')
|
||||
WHEN 'output' THEN json_extract(mvt.document, '$.output_nature')
|
||||
END
|
||||
AS 'operation',
|
||||
json_extract(mvt.document, '$.amount') AS 'nombre'
|
||||
|
|
@ -87,9 +84,9 @@
|
|||
{{* récupérer la config des entrées/sorties *}}
|
||||
{{:include file="./_get_config.html" keep="config"}}
|
||||
|
||||
{{if $direction === 'entrée'}}
|
||||
{{if $direction === 'input'}}
|
||||
{{* chercher le type d'entrée parmi les types de la config *}}
|
||||
{{#foreach from=$config.inputNature item="elem"}}
|
||||
{{#foreach from=$config.input_nature item="elem"}}
|
||||
{{if $operation == $elem.label}}
|
||||
{{if $elem.type == 'définitif'}}
|
||||
{{:assign stock="%d+%d"|math:$stock:$nombre}}
|
||||
|
|
@ -110,9 +107,9 @@
|
|||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{elseif $direction === 'sortie'}}
|
||||
{{elseif $direction === 'output'}}
|
||||
{{* chercher le type de sortie parmi les types de la config *}}
|
||||
{{#foreach from=$config.outputNature item="elem"}}
|
||||
{{#foreach from=$config.output_nature item="elem"}}
|
||||
{{if $operation == $elem.label}}
|
||||
{{if $elem.type == 'définitif'}}
|
||||
{{:assign stock="%d-%d"|math:$stock:$nombre}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue