Ajout mise à jour des liens
This commit is contained in:
parent
bb7e5a2844
commit
a3b1b44fce
6 changed files with 60 additions and 4 deletions
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
{{if $module.table}}
|
||||
{{* supprimer les documents sans écriture associée *}}
|
||||
{{:assign var="docs." type="immo" field="line"}}
|
||||
{{:assign var="docs." type="amort_link" field="line_id"}}
|
||||
{{:assign var="docs." type="credit_link" field="line_id"}}
|
||||
{{:assign var="docs." type="cession_link" field="line_id"}}
|
||||
{{:assign var="docs." type="exit_link" field="line_id"}}
|
||||
{{:assign var="docs." type="immo" field="line"}}
|
||||
|
||||
{{#foreach from=$docs}}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,21 @@
|
|||
<p class="block info">Mise à jour vers version {{$tag}} terminée</p>
|
||||
{{/if}}
|
||||
|
||||
{{* version 0.42 *}}
|
||||
{{:assign tag="0.42"}}
|
||||
|
||||
{{:include file="_compare_version.tpl" nv1=$module_version nv2=$tag keep="comp"}}
|
||||
{{:assign module_comp=$comp}}
|
||||
{{:include file="_compare_version.tpl" nv1=$module.config.version nv2=$tag keep="comp"}}
|
||||
{{:assign config_comp=$comp}}
|
||||
|
||||
{{if $module_comp >= 0 && $config_comp < 0}}
|
||||
{{* $module_version >= '0.42' && $module.config.version < '0.42' *}}
|
||||
|
||||
{{:include file="_upgrade_to042.tpl"}}
|
||||
<p class="block info">Mise à jour vers version {{$tag}} terminée</p>
|
||||
{{/if}}
|
||||
|
||||
{{* enregistrer le nouveau numéro de version dans la config du module *}}
|
||||
{{:include file="_compare_version.tpl" nv1=$module_version nv2=$module.config.version keep="comp"}}
|
||||
{{if $comp > 0}}
|
||||
|
|
|
|||
41
_upgrade_to042.tpl
Normal file
41
_upgrade_to042.tpl
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{* remplacer xxx_line_id par line_id pour simplifier et mutualiser le code *}}
|
||||
|
||||
{{:assign var="link_types." type="amort"}}
|
||||
{{:assign var="link_types." type="credit"}}
|
||||
{{:assign var="link_types." type="cession"}}
|
||||
{{:assign var="link_types." type="exit"}}
|
||||
|
||||
{{* lister les liens actuels *}}
|
||||
{{#foreach from=$link_types}}
|
||||
{{:assign link_type=$type|cat:"_link"}}
|
||||
{{:assign line_id=$type|cat:"_line_id"}}
|
||||
{{#load type=$link_type assign="link"}}
|
||||
{{:assign new_link=null}}
|
||||
{{:assign var="new_link.key value=$link.key}}
|
||||
{{:assign var="new_link.type" value=$link.type}}
|
||||
{{:assign var="new_link.immo_doc_id" value=$link.immo_doc_id}}
|
||||
{{:assign var="new_link.line_id" from="link.%s"|args:$line_id}}
|
||||
{{:assign var="new_link.amount" value=$link.amount}}
|
||||
{{:assign var="new_link.created" value=$link.created}}
|
||||
{{* mémoriser les infos des docs *}}
|
||||
{{:assign var="new_links." value=$new_link}}
|
||||
{{/load}}
|
||||
{{:delete type=$link_type}}
|
||||
{{/foreach}}
|
||||
|
||||
{{* créer les nouveaux documents de liaisons *}}
|
||||
{{:assign nb_links=0}}
|
||||
{{#foreach from=$new_links item="link"}}
|
||||
{{:save
|
||||
key=$link.key
|
||||
type=$link.type
|
||||
immo_doc_id=$link.immo_doc_id
|
||||
line_id=$link.line_id
|
||||
amount=$link.amount
|
||||
created=$link.created
|
||||
}}
|
||||
{{:assign nb_links="%d+1"|math:$nb_links}}
|
||||
{{/foreach}}
|
||||
<p class="block alert">Nombre de liens modifiés : {{$nb_links}}</p>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
{{:include file="_nav.html" current=$type_immo}}
|
||||
|
||||
{{* Mise à niveau *}}
|
||||
{{:assign module_version="0.41"}}
|
||||
{{:assign module_version="0.42"}}
|
||||
{{:include file="_upgrade.html" module_version=$module_version}}
|
||||
|
||||
{{* supprimer les documents sans écriture associée *}}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
"exclusiveMinimum": 0
|
||||
},
|
||||
"line_id" : {
|
||||
"description": "ligne associée à l'immobilisation",
|
||||
"description": "ligne d'écriture associée à l'immobilisation",
|
||||
"type": "integer",
|
||||
"exclusiveMinimum": 0
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
name="Amortissements"
|
||||
description="Immobilisations et amortissements\nversion 0.41.3"
|
||||
description="Immobilisations et amortissements\nversion 0.42"
|
||||
author="Jean-Christophe Engel"
|
||||
author_url="https://gitea.zaclys.com/lesanges"
|
||||
home_button=false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue