diff --git a/_archives.html b/_archives.html index 39d87d5..2e404fc 100644 --- a/_archives.html +++ b/_archives.html @@ -3,11 +3,10 @@ {{* Liste des immobilisations archivées *}} {{* Immobilisation avec une écriture de sortie de bilan *}} -{{:read file="./defaut.json" assign="config_json"}} -{{:assign config_defaut=$config_json|json_decode}} +{{:include file="_get_config.html" keep="config.prefixes"}} {{:assign condition="("}} -{{#foreach from=$config_defaut.prefixes item="code"}} +{{#foreach from=$config.prefixes item="code"}} {{:assign code=$code|cat:"%"|quote_sql}} {{:assign condition=$condition|cat:"account.code LIKE "|cat:$code|cat:" OR "}} {{/foreach}} diff --git a/_get_config.html b/_get_config.html index 25cd4e7..f18dfab 100644 --- a/_get_config.html +++ b/_get_config.html @@ -4,10 +4,6 @@ Récupérer la config *}} -{{* config par défaut *}} -{{:read file="./defaut.json" assign="config_defaut"}} -{{:assign config_defaut=$config_defaut|json_decode}} - {{* {{if $module.config.tva != null}} {{:assign var="config.tva" value=$module.config.tva}} @@ -19,5 +15,8 @@ {{if $module.config.prefixes != null}} {{:assign var="config.prefixes" value=$module.config.prefixes}} {{else}} + {{* config par défaut *}} + {{:read file="./defaut.json" assign="config_defaut"}} + {{:assign config_defaut=$config_defaut|json_decode}} {{:assign var="config.prefixes" value=$config_defaut.prefixes}} {{/if}} diff --git a/_immobilisations.html b/_immobilisations.html index 28041ac..8d05a14 100644 --- a/_immobilisations.html +++ b/_immobilisations.html @@ -21,10 +21,10 @@ {{* lister les immobilisations *}} - {{:read file="./defaut.json" assign="config_json"}} - {{:assign config_defaut=$config_json|json_decode}} + {{:include file="_get_config.html" keep="config.prefixes"}} + {{:assign condition="("}} - {{#foreach from=$config_defaut.prefixes item="code"}} + {{#foreach from=$config.prefixes item="code"}} {{:assign code=$code|cat:"%"|quote_sql}} {{:assign condition=$condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}} {{/foreach}} diff --git a/_immobilisations_autres.html b/_immobilisations_autres.html index c404863..613d2a7 100644 --- a/_immobilisations_autres.html +++ b/_immobilisations_autres.html @@ -30,10 +30,9 @@ {{* lister les immobilisations *}} - {{:read file="./defaut.json" assign="config_json"}} - {{:assign config_defaut=$config_json|json_decode}} + {{:include file="_get_config.html" keep="config.prefixes"}} {{:assign condition="("}} - {{#foreach from=$config_defaut.prefixes item="code"}} + {{#foreach from=$config.prefixes item="code"}} {{:assign code=$code|cat:"%"|quote_sql}} {{:assign condition=$condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}} {{/foreach}} diff --git a/add_asset.html b/add_asset.html index 99da03d..a606f15 100644 --- a/add_asset.html +++ b/add_asset.html @@ -1,7 +1,6 @@ {{* -*- brindille -*- *}} -{{:read file="./defaut.json" assign="config_json"}} -{{:assign config_defaut=$config_json|json_decode}} +{{:include file="_get_config.html" keep="config.prefixes"}} {{#years closed=false order="start_date" assign=years.}} {{:assign ts_debut=$start_date|strtotime}} @@ -75,7 +74,7 @@ file="_check_account.html" account=$debit_account chart_id=$selected_chart - prefix_array=$config_defaut.prefixes + prefix_array=$config.prefixes keep="account_ok" }} @@ -139,7 +138,7 @@ {{:assign var="projects.%d"|args:$id value=$label}} {{/select}} -{{#foreach from=$config_defaut.prefixes item="code"}} +{{#foreach from=$config.prefixes item="code"}} {{:assign var="pattern_array." value="%s*"|args:$code}} {{/foreach}} {{:assign var="patterns" value=$pattern_array|implode:"|"}} diff --git a/amortization.html b/amortization.html index 1a84a12..0ead87c 100644 --- a/amortization.html +++ b/amortization.html @@ -248,7 +248,7 @@ {{if $autres_amortissements != null}}

Il existe des écritures d'amortissement qui ne sont pas rattachés à une immobilisation !
- Utilisez le bouton « Attacher un amortissement » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation. + Utilisez le bouton « Rattacher une écriture » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation.

{{/if}} {{/if}} diff --git a/config.html b/config.html index 8170ac1..9038441 100644 --- a/config.html +++ b/config.html @@ -41,7 +41,7 @@ {{/form}} {{* récupérer l'exercice courant ou sinon le plus récent *}} -{{:assign var="selected_year" from="logged_user.preferences.accounting_year}} +{{:assign var="selected_year" from="logged_user.preferences.accounting_year"}} {{if $selected_year == null}} {{* sélectionner l'exercice le plus probable *}} {{#years}} diff --git a/save_amort.html b/save_amort.html index 7ad6b50..875db12 100644 --- a/save_amort.html +++ b/save_amort.html @@ -147,9 +147,8 @@ - que le compte d'amortissement débute par un préfixe correct (280, 281, ...) - est présent dans le PC de l'exercice correspondant à la date *}} - {{:read file="./defaut.json" assign="config_json"}} - {{:assign config_defaut=$config_json|json_decode}} - {{#foreach from=$config_defaut.prefixes item="code"}} + {{:include file="_get_config.html" keep="config.prefixes"}} + {{#foreach from=$config.prefixes item="code"}} {{* déterminer le numéro du compte d'amortissement associé au compte d'immobilisation *}} {{:include file="./_get_amort_code.html" diff --git a/write_exit.html b/write_exit.html index 9d0b553..a0a1f57 100644 --- a/write_exit.html +++ b/write_exit.html @@ -309,10 +309,8 @@ {{:assign var="%s.%s"|args:$name:$code value="%s — %s"|args:$code:$acc_label}} {{/foreach}} -{{:read file="./defaut.json" assign="config_json"}} -{{:assign config_defaut=$config_json|json_decode}} - -{{#foreach from=$config_defaut.prefixes item="code"}} +{{:include file="_get_config.html" keep="config.prefixes"}} +{{#foreach from=$config.prefixes item="code"}} {{:assign var="pattern_array." value="%s*"|args:$code}} {{/foreach}} {{:assign patterns=$pattern_array|implode:"|"}}