Nettoyage code
This commit is contained in:
parent
c025f7f10c
commit
7a41c43ea3
1 changed files with 8 additions and 64 deletions
72
config.html
72
config.html
|
@ -1,4 +1,5 @@
|
||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{:admin_header title="Configuration" custom_css="./style.css" current="module_amortissement"}}
|
{{:admin_header title="Configuration" custom_css="./style.css" current="module_amortissement"}}
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{:include file="_nav.html" current="config"}}
|
{{:include file="_nav.html" current="config"}}
|
||||||
|
@ -9,26 +10,16 @@
|
||||||
{{* lecture config (défaut ou enregistrée) *}}
|
{{* lecture config (défaut ou enregistrée) *}}
|
||||||
{{:include file="./_get_config.html" keep="config"}}
|
{{:include file="./_get_config.html" keep="config"}}
|
||||||
|
|
||||||
{{*:debug prefixes=$config.prefixes*}}
|
|
||||||
|
|
||||||
{{#form on="save"}}
|
{{#form on="save"}}
|
||||||
{{*:debug post=$_POST*}}
|
|
||||||
{{:assign ok=0}}
|
{{:assign ok=0}}
|
||||||
{{*
|
|
||||||
TODO ? gérer le cas d'un compte qui englobe un autre...
|
|
||||||
ex : 27 21 273 ou 20 21 27 2
|
|
||||||
*}}
|
|
||||||
{{#foreach from=$_POST.immo_accounts item="line"}}
|
{{#foreach from=$_POST.immo_accounts item="line"}}
|
||||||
{{:assign elem=$line|values}}
|
{{:assign elem=$line|values}}
|
||||||
{{:assign elem=$elem.0}}
|
{{:assign elem=$elem.0}}
|
||||||
{{*:debug elem=$elem*}}
|
|
||||||
{{:assign var="fields" value=$elem|explode:" "}}
|
{{:assign var="fields" value=$elem|explode:" "}}
|
||||||
{{*if ! $account_codes|has:$fields.0*}}
|
|
||||||
{{:assign present=false}}
|
{{:assign present=false}}
|
||||||
{{* ne pas garder si préfixe d'un compte déjà présent => voir commentaire précédent *}}
|
{{* ne pas garder si préfixe d'un compte déjà présent *}}
|
||||||
{{#foreach from=$account_codes item="code"}}
|
{{#foreach from=$account_codes item="code"}}
|
||||||
{{:assign pos=$code|strpos:$fields.0}}
|
{{:assign pos=$code|strpos:$fields.0}}
|
||||||
{{*:debug code=$code pos=$pos*}}
|
|
||||||
{{if $pos !== false}}
|
{{if $pos !== false}}
|
||||||
{{:assign present=true}}
|
{{:assign present=true}}
|
||||||
{{:break}}
|
{{:break}}
|
||||||
|
@ -38,7 +29,6 @@
|
||||||
{{:assign var="account_codes." value=$fields.0}}
|
{{:assign var="account_codes." value=$fields.0}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{*:debug codes=$account_codes*}}
|
|
||||||
|
|
||||||
{{:save
|
{{:save
|
||||||
key="config"
|
key="config"
|
||||||
|
@ -62,26 +52,6 @@
|
||||||
{{/years}}
|
{{/years}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
{{*
|
|
||||||
{{#select
|
|
||||||
year.id,
|
|
||||||
year.label as year_label,
|
|
||||||
year.start_date,
|
|
||||||
year.end_date,
|
|
||||||
chart.id as chart_id,
|
|
||||||
chart.label AS chart_label
|
|
||||||
FROM acc_years AS year
|
|
||||||
INNER JOIN acc_charts AS chart ON chart.id = year.id_chart
|
|
||||||
WHERE year.id = :year_id;
|
|
||||||
:year_id = $selected_year
|
|
||||||
}}
|
|
||||||
*}}
|
|
||||||
{{*:debug year=$year_label chart=$chart_label*}}
|
|
||||||
{{*
|
|
||||||
{{/select}}
|
|
||||||
*}}
|
|
||||||
|
|
||||||
{{* libellés des comptes d'immobilisation *}}
|
{{* libellés des comptes d'immobilisation *}}
|
||||||
{{:assign condition="("}}
|
{{:assign condition="("}}
|
||||||
{{#foreach from=$config.prefixes item="code"}}
|
{{#foreach from=$config.prefixes item="code"}}
|
||||||
|
@ -90,7 +60,6 @@
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{:assign condition=$condition|cat:"0)"}}
|
{{:assign condition=$condition|cat:"0)"}}
|
||||||
{{:assign condition=$condition|cat:" AND year.id = %s"|args:$selected_year}}
|
{{:assign condition=$condition|cat:" AND year.id = %s"|args:$selected_year}}
|
||||||
{{*:debug cond=$condition*}}
|
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
account.id as account_id,
|
account.id as account_id,
|
||||||
|
@ -107,15 +76,15 @@
|
||||||
!condition=$condition
|
!condition=$condition
|
||||||
}}
|
}}
|
||||||
{{:assign var="accounts.%s"|args:$code label=$label id=$account_id}}
|
{{:assign var="accounts.%s"|args:$code label=$label id=$account_id}}
|
||||||
{{*:debug acc_id=$account_id code=$code label=$label year_label=$year_label chart_label=$chart_label*}}
|
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{*:debug accounts=$accounts*}}
|
|
||||||
|
|
||||||
{{*
|
<h3>Comptes d'immobilisation</h3>
|
||||||
<form method="post" action="">
|
|
||||||
*}}
|
|
||||||
<h3>Comptes d'immobilisation</h3>
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
|
|
||||||
|
<p class="help">
|
||||||
|
Les immobilisations sont cherchées dans les comptes sélectionnées et leurs sous-comptes.
|
||||||
|
</p>
|
||||||
|
|
||||||
<table class="list transaction-lines" id="asset_prefixes">
|
<table class="list transaction-lines" id="asset_prefixes">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -156,30 +125,6 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
{{*
|
|
||||||
<p class="actions">
|
|
||||||
{{:button shape="plus" label="Ajouter" title="Ajouter un compte"}}
|
|
||||||
*}}
|
|
||||||
{{*:button shape="plus" label="Ajouter un compte" onclick="var a = $('#asset_prefixes tbody')[0].lastElementChild; var b = a.cloneNode(true); b.querySelectorAll('input, select').forEach((e) => e.value = null); a.parentNode.append(b);"*}}
|
|
||||||
{{*
|
|
||||||
</p>
|
|
||||||
*}}
|
|
||||||
|
|
||||||
{{*
|
|
||||||
<fieldset>
|
|
||||||
<dl>
|
|
||||||
{{:input
|
|
||||||
type="list"
|
|
||||||
name="immo_account"
|
|
||||||
label="Ajouter un compte d'immobilisation"
|
|
||||||
target="!acc/charts/accounts/selector.php?codes=2*&year=%s"|args:$selected_year
|
|
||||||
}}
|
|
||||||
*}}
|
|
||||||
{{*:input type="checkbox" name="tva" value=1 label="TVA" source=$config help="Cocher si l'asso est assujettie à la TVA"*}}
|
|
||||||
{{*
|
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
*}}
|
|
||||||
|
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
||||||
|
@ -244,4 +189,3 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue