Compare commits
1 commit
main
...
batch_clas
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb7cbc9d3b |
18 changed files with 289 additions and 551 deletions
|
|
@ -1,22 +1,14 @@
|
||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{* Liste des immobilisations archivées *}}
|
{{* Liste des immobilisations archivées *}}
|
||||||
<p class="help">
|
|
||||||
Cette page liste les immobilisations sorties du bilan
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{{* Immobilisation avec une écriture de sortie de bilan *}}
|
{{* Immobilisation archivées prises en charge *}}
|
||||||
{{:include file="_get_config.html" keep="config.prefixes"}}
|
{{#load type="immo" where="$$.status = 'archived'"}}
|
||||||
|
{{:assign var="lines." value="'%s'"|args:$line}}
|
||||||
{{:assign condition="("}}
|
{{/load}}
|
||||||
{{#foreach from=$config.prefixes item="code"}}
|
{{:assign lines=$lines|implode:","}}
|
||||||
{{if $code|substr:0:2 != "23"}}
|
{{:assign lines="("|cat:$lines|cat:")"}}
|
||||||
{{:assign code=$code|cat:"%"|quote_sql}}
|
{{:assign condition="line.id IN %s"|args:$lines}}
|
||||||
{{:assign condition=$condition|cat:"account.code LIKE "|cat:$code|cat:" OR "}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{:assign condition=$condition|cat:"0)"}}
|
|
||||||
{{:assign condition=$condition|cat:" AND acc2.code = account.code AND line.debit > 0 AND line.debit = line2.credit AND NOT (trans.status & 16)"}}
|
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
trans.id as trans_id,
|
trans.id as trans_id,
|
||||||
|
|
@ -28,8 +20,46 @@
|
||||||
account.label as account_label,
|
account.label as account_label,
|
||||||
line.debit AS debit,
|
line.debit AS debit,
|
||||||
project.label as project_label,
|
project.label as project_label,
|
||||||
trans.id_year as trans_id_year,
|
trans.id_year as trans_id_year
|
||||||
trans2.date as exit_date
|
FROM acc_transactions AS trans
|
||||||
|
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
||||||
|
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
||||||
|
INNER JOIN acc_years AS years ON trans.id_year = years.id
|
||||||
|
LEFT JOIN acc_projects AS project ON line.id_project = project.id
|
||||||
|
WHERE !condition
|
||||||
|
ORDER BY trans.date DESC;
|
||||||
|
!condition=$condition
|
||||||
|
assign="immo_archivee"
|
||||||
|
}}
|
||||||
|
{{:assign var="immo_archivees.%s"|args:$trans_id value=$immo_archivee}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
|
{{* Immobilisation avec une écriture de sortie de bilan *}}
|
||||||
|
{{:read file="./defaut.json" assign="config_json"}}
|
||||||
|
{{:assign config_defaut=$config_json|json_decode}}
|
||||||
|
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
||||||
|
|
||||||
|
{{:assign condition="("}}
|
||||||
|
{{#foreach from=$prefix_array item="code"}}
|
||||||
|
{{:assign code=$code|cat:"%"|quote_sql}}
|
||||||
|
{{:assign condition=$condition|cat:"account.code LIKE "|cat:$code|cat:" OR "}}
|
||||||
|
{{/foreach}}
|
||||||
|
{{:assign condition=$condition|cat:"0)"}}
|
||||||
|
{{:assign cond2=$condition|replace:"account.":"acc2."}}
|
||||||
|
{{:assign condition=$condition|cat:" AND "|cat:$cond2}}
|
||||||
|
{{:assign condition=$condition|cat:" AND line.debit > 0 AND NOT (trans.status & 16)"}}
|
||||||
|
|
||||||
|
{{#select
|
||||||
|
trans.id as trans_id,
|
||||||
|
trans.label as trans_label,
|
||||||
|
trans.date as trans_date,
|
||||||
|
line.id as immo_id,
|
||||||
|
account.id as account_id,
|
||||||
|
account.code as account_code,
|
||||||
|
account.label as account_label,
|
||||||
|
line.debit AS debit,
|
||||||
|
project.label as project_label,
|
||||||
|
trans.id_year as trans_id_year
|
||||||
FROM acc_transactions AS trans
|
FROM acc_transactions AS trans
|
||||||
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
||||||
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
||||||
|
|
@ -43,16 +73,20 @@
|
||||||
!condition=$condition
|
!condition=$condition
|
||||||
assign="immo_archivee"
|
assign="immo_archivee"
|
||||||
}}
|
}}
|
||||||
|
{{if ! $trans_id|key_in:$immo_archivees}}
|
||||||
{{:assign var="immo_archivees.%s"|args:$trans_id value=$immo_archivee}}
|
{{:assign var="immo_archivees.%s"|args:$trans_id value=$immo_archivee}}
|
||||||
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
<section class="immobilisation">
|
<section class="immobilisation">
|
||||||
|
<h2 class="ruler">Immobilisations archivées</h2>
|
||||||
|
|
||||||
|
{{:assign nb_immo=0}}
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>N°</th>
|
<th>N°</th>
|
||||||
<th>Mise en service</th>
|
<th>Date</th>
|
||||||
<th>Date sortie</th>
|
|
||||||
<th>Libellé</th>
|
<th>Libellé</th>
|
||||||
<th class="nombre">Montant</th>
|
<th class="nombre">Montant</th>
|
||||||
<th>N° compte</th>
|
<th>N° compte</th>
|
||||||
|
|
@ -62,7 +96,6 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{:assign nb_immo=0}}
|
|
||||||
{{#foreach from=$immo_archivees}}
|
{{#foreach from=$immo_archivees}}
|
||||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$account_id:$trans_id_year}}
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$account_id:$trans_id_year}}
|
||||||
|
|
@ -70,7 +103,6 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||||
<td>{{$trans_date|date_short}}</td>
|
<td>{{$trans_date|date_short}}</td>
|
||||||
<td>{{$exit_date|date_short}}</td>
|
|
||||||
<td>{{$trans_label}}</td>
|
<td>{{$trans_label}}</td>
|
||||||
<td class="money">{{"%f"|math:$debit|money:false}}</td>
|
<td class="money">{{"%f"|math:$debit|money:false}}</td>
|
||||||
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
|
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
{{*
|
|
||||||
Récupérer la config
|
|
||||||
*}}
|
|
||||||
|
|
||||||
{{*
|
|
||||||
{{if $module.config.tva != null}}
|
|
||||||
{{:assign var="config.tva" value=$module.config.tva}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign var="config.tva" value=$config_defaut.tva}}
|
|
||||||
{{/if}}
|
|
||||||
*}}
|
|
||||||
|
|
||||||
{{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}}
|
|
||||||
|
|
@ -3,14 +3,12 @@
|
||||||
{{* Liste des immobilisations en cours ou amorties *}}
|
{{* Liste des immobilisations en cours ou amorties *}}
|
||||||
|
|
||||||
<section class="immobilisation">
|
<section class="immobilisation">
|
||||||
|
{{if $type_immo == "encours"}}
|
||||||
<p class="help">
|
<h2 class="ruler">Immobilisations en cours</h2>
|
||||||
{{if $type_immo == "managed"}}
|
{{elseif $type_immo == "amortie"}}
|
||||||
Cette page liste les immobilisations en cours d'amortissement
|
<h2 class="ruler">Immobilisations amorties</h2>
|
||||||
{{elseif $type_immo == "amortized"}}
|
|
||||||
Cette page liste les immobilisations dont l'amortissement est terminé
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</p>
|
{{:assign nb_immo=0}}
|
||||||
|
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
@ -28,18 +26,16 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
{{* lister les immobilisations *}}
|
{{* lister les immobilisations *}}
|
||||||
{{:include file="_get_config.html" keep="config.prefixes"}}
|
{{:read file="./defaut.json" assign="config_json"}}
|
||||||
|
{{:assign config_defaut=$config_json|json_decode}}
|
||||||
|
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
||||||
{{:assign condition="("}}
|
{{:assign condition="("}}
|
||||||
{{#foreach from=$config.prefixes item="code"}}
|
{{#foreach from=$prefix_array item="code"}}
|
||||||
{{if $code|substr:0:2 != "23"}}
|
|
||||||
{{:assign code=$code|cat:"%"|quote_sql}}
|
{{:assign code=$code|cat:"%"|quote_sql}}
|
||||||
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}}
|
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}}
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{:assign condition=$condition|cat:"0)"}}
|
{{:assign condition=$condition|cat:"0)"}}
|
||||||
{{:assign condition=$condition|cat:" AND debit > 0 AND NOT (trans.status & 16)"}}
|
{{:assign condition=$condition|cat:" AND debit > 0 AND NOT (trans.status & 16)"}}
|
||||||
{{:assign nb_immo=0}}
|
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
trans.id as trans_id,
|
trans.id as trans_id,
|
||||||
|
|
@ -135,12 +131,12 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{* classement par onglet *}}
|
|
||||||
{{if $type_immo == "managed" && $amort_amount >= $debit}}{{:continue}}{{/if}}
|
|
||||||
{{if $type_immo == "managed" && $status == "amortized"}}{{:continue}}{{/if}}
|
|
||||||
{{if $status == "unknown" && ! $exist_amort}}{{:continue}}{{/if}}
|
|
||||||
{{if $type_immo == "amortized" && $amort_amount < $debit && $status != "amortized"}}{{:continue}}{{/if}}
|
|
||||||
|
|
||||||
|
{{* classement par onglet *}}
|
||||||
|
{{if $type_immo == "encours" && $amort_amount >= $debit}}{{:continue}}{{/if}}
|
||||||
|
{{if $type_immo == "encours" && $status == "amortized"}}{{:continue}}{{/if}}
|
||||||
|
{{if $status == "unknown" && ! $exist_amort}}{{:continue}}{{/if}}
|
||||||
|
{{if $type_immo == "amortie" && $amort_amount < $debit && $status != "amortized"}}{{:continue}}{{/if}}
|
||||||
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||||
|
|
@ -154,14 +150,14 @@
|
||||||
{{if ! $exist_amort}}
|
{{if ! $exist_amort}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Paramètres"
|
label="Paramètres"
|
||||||
href="add_infos.html?immo_id=%s&type_immo=%s"|args:$immo_id:$type_immo
|
href="add_infos.html?immo_id=%s&amort=1&op=modif&type_immo=%s"|args:$immo_id:$type_immo
|
||||||
shape="settings"
|
shape="settings"
|
||||||
target="_dialog"
|
target="_dialog"
|
||||||
}}
|
}}
|
||||||
{{elseif $status == "unknown"}}
|
{{elseif $status == "unknown"}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Paramètres"
|
label="Paramètres"
|
||||||
href="add_infos.html?immo_id=%s&type_immo=%s"|args:$immo_id:$type_immo
|
href="add_infos.html?immo_id=%s&amort=1&op=new&type_immo=%s"|args:$immo_id:$type_immo
|
||||||
shape="settings"
|
shape="settings"
|
||||||
target="_dialog"
|
target="_dialog"
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,17 @@
|
||||||
{{* Liste des immobilisations non amortissables ou non (encore) gérées *}}
|
{{* Liste des immobilisations non amortissables ou non (encore) gérées *}}
|
||||||
|
|
||||||
<section class="immobilisation">
|
<section class="immobilisation">
|
||||||
|
<h2 class="ruler">Autres immobilisations</h2>
|
||||||
|
{{:assign nb_immo=0}}
|
||||||
|
|
||||||
<p class="help">
|
<form method="post" action="confirm_action.html?target=_dialog" target="_dialog">
|
||||||
Cette page liste les écritures pas (encore) prises en charges par le module ou classées non amortissables
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<form method="post" action="">
|
|
||||||
<fieldset>
|
|
||||||
{{:input type="checkbox" value=1 name="unhide" label="Afficher les écritures marquées ignorées" }}
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="check">
|
||||||
|
<input type="checkbox" title="Tout cocher / décocher" id="f_all" />
|
||||||
|
<label for="f_all" title="Tout cocher / décocher"></label>
|
||||||
|
</td>
|
||||||
<th>N°</th>
|
<th>N°</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>Libellé</th>
|
<th>Libellé</th>
|
||||||
|
|
@ -29,17 +26,16 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
{{* lister les immobilisations *}}
|
{{* lister les immobilisations *}}
|
||||||
{{:include file="_get_config.html" keep="config.prefixes"}}
|
{{:read file="./defaut.json" assign="config_json"}}
|
||||||
|
{{:assign config_defaut=$config_json|json_decode}}
|
||||||
|
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
||||||
{{:assign condition="("}}
|
{{:assign condition="("}}
|
||||||
{{#foreach from=$config.prefixes item="code"}}
|
{{#foreach from=$prefix_array item="code"}}
|
||||||
{{if $code|substr:0:2 != "23"}}
|
|
||||||
{{:assign code=$code|cat:"%"|quote_sql}}
|
{{:assign code=$code|cat:"%"|quote_sql}}
|
||||||
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}}
|
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}}
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{:assign condition=$condition|cat:"0)"}}
|
{{:assign condition=$condition|cat:"0)"}}
|
||||||
{{:assign condition=$condition|cat:" AND debit > 0 AND NOT (trans.status & 16)"}}
|
{{:assign condition=$condition|cat:" AND debit > 0 AND NOT (trans.status & 16)"}}
|
||||||
{{:assign nb_immo=0}}
|
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
trans.id as trans_id,
|
trans.id as trans_id,
|
||||||
|
|
@ -68,15 +64,9 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign status="unknown"}}
|
{{:assign status="unknown"}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
{{if $_POST.unhide == null}}
|
|
||||||
{{if $status != "unknown"}}
|
{{if $status != "unknown"}}
|
||||||
{{:continue}}
|
{{:continue}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
|
||||||
{{if $status != "ignored" && $status != "unknown"}}
|
|
||||||
{{:continue}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* voir s'il existe des écritures d'amortissement associées *}}
|
{{* voir s'il existe des écritures d'amortissement associées *}}
|
||||||
{{#select
|
{{#select
|
||||||
|
|
@ -103,7 +93,7 @@
|
||||||
account.code LIKE '28%';
|
account.code LIKE '28%';
|
||||||
:line_id = $immo_id|intval
|
:line_id = $immo_id|intval
|
||||||
}}
|
}}
|
||||||
{{if $amort_amount != null}}
|
{{if $status == "unknown" && $amort_amount != null}}
|
||||||
{{:assign ignore=true}}
|
{{:assign ignore=true}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign ignore=false}}
|
{{:assign ignore=false}}
|
||||||
|
|
@ -116,6 +106,11 @@
|
||||||
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>
|
||||||
|
{{:input type="checkbox" name="check[%s]"|args:$immo_id value=$immo_id default=0}}
|
||||||
|
<input type="hidden" name="label[{{$immo_id}}]" value="{{$trans_label}}">
|
||||||
|
<input type="hidden" name="trans[{{$immo_id}}]" value="{{$trans_id}}">
|
||||||
|
</td>
|
||||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||||
<td>{{$trans_date|date_short}}</td>
|
<td>{{$trans_date|date_short}}</td>
|
||||||
<td>{{$trans_label}}</td>
|
<td>{{$trans_label}}</td>
|
||||||
|
|
@ -126,41 +121,52 @@
|
||||||
{{if $status == "unknown"}}
|
{{if $status == "unknown"}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Paramètres"
|
label="Paramètres"
|
||||||
href="add_infos.html?immo_id=%s&type_immo=other"|args:$immo_id
|
href="add_infos.html?immo_id=%s&amort=0&op=new&type_immo=autre"|args:$immo_id
|
||||||
shape="settings"
|
shape="settings"
|
||||||
target="_dialog"
|
target="_dialog"
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Paramètres"
|
label="Paramètres"
|
||||||
href="add_infos.html?immo_id=%s&type_immo=other"|args:$immo_id
|
href="add_infos.html?immo_id=%s&amort=0&op=modif&type_immo=autre"|args:$immo_id
|
||||||
shape="settings"
|
shape="settings"
|
||||||
target="_dialog"
|
target="_dialog"
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Amortissements"
|
label="Amortissements"
|
||||||
href="amortization.html?immo_id=%s&type_immo=other"|args:$immo_id
|
href="amortization.html?immo_id=%s&type_immo=autre"|args:$immo_id
|
||||||
shape="table"
|
shape="table"
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
|
{{:assign var="actions.amortize" value="Marquer l'immobilisation amortie"}}
|
||||||
|
{{:assign var="actions.ignore" value="Ignorer l'écriture"}}
|
||||||
|
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td class="check"><input type="checkbox" value="Tout cocher / décocher" id="f_all2" />
|
||||||
|
<label for="f_all2"></label>
|
||||||
|
</td>
|
||||||
|
<td class="actions" colspan="10">
|
||||||
|
<em>Pour les écritures cochées :</em>
|
||||||
|
{{*
|
||||||
|
<input type="hidden" name="from" value="{$self_url}" />
|
||||||
|
<input type="hidden" name="year" value="{$year.id}" />
|
||||||
|
{csrf_field key="projects_action"}
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{:input type="select" name="actions" options=$actions default_empty="— Choisir une action à effectuer —"}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
</form>
|
||||||
{{if $nb_immo == 0}}
|
{{if $nb_immo == 0}}
|
||||||
<p class="block alert">Aucune immobilisation</p>
|
<p class="block alert">Aucune immobilisation</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
function changeVisibility(evt, idcheck = 'f_unhide_1') {
|
|
||||||
this.form.dispatchEvent(new Event('submit'));
|
|
||||||
this.form.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
document.getElementById('f_unhide_1').onclick = changeVisibility;
|
|
||||||
})();
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
|
||||||
22
_nav.html
22
_nav.html
|
|
@ -1,34 +1,34 @@
|
||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
<nav class="tabs">
|
<nav class="tabs">
|
||||||
{{if $current == "index" && $subsubcurrent == null}}
|
{{if $current == 'index' && $subsubcurrent == null}}
|
||||||
<aside>
|
<aside>
|
||||||
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html" target="_dialog"}}
|
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html" target="_dialog"}}
|
||||||
</aside>
|
</aside>
|
||||||
{{elseif $subsubcurrent == "amortization" && $type_immo == null || $type_immo == "managed" || $type_immo == "other"}}
|
{{elseif $subsubcurrent == "amortization" && $type_immo == null || $type_immo == "encours" || $type_immo == "autre"}}
|
||||||
<aside>
|
<aside>
|
||||||
{{if $autres_amort != null}}
|
{{if $autres_amort != null}}
|
||||||
{{:linkbutton label="Rattacher une écriture" href="other_amortizations.html?immo_id=%s"|args:$_GET.immo_id shape="link" target="_dialog"}}
|
{{:linkbutton label="Attacher un amortissement" href="other_amortizations.html?immo_id=%s"|args:$_GET.immo_id shape="plus" target="_dialog"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:linkbutton label="Enregistrer un amortissement" shape="plus"
|
{{:linkbutton label="Enregistrer un amortissement" shape="plus"
|
||||||
href="save_amort.html?immo_id=%s"|args:$_GET.immo_id target="_dialog"}}
|
href="save_amort.html?immo_id=%s"|args:$_GET.immo_id target="_dialog"}}
|
||||||
</aside>
|
</aside>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{if $current == 'index'}} {{* && $subsubcurrent != 'balance_exit' *}}
|
||||||
<ul>
|
<ul>
|
||||||
<li {{if $subcurrent == "managed"}}class="current"{{/if}}><a href="index.html?type_immo=managed">Amortissables</a></li>
|
<li {{if $subcurrent == 'encours'}}class="current"{{/if}}><a href="index.html?type_immo=encours">En cours</a></li>
|
||||||
<li {{if $subcurrent == "amortized"}}class="current"{{/if}}><a href="index.html?type_immo=amortized">Amorties</a></li>
|
<li {{if $subcurrent == 'amortie'}}class="current"{{/if}}><a href="index.html?type_immo=amortie">Amorties</a></li>
|
||||||
<li {{if $subcurrent == "archived"}}class="current"{{/if}}><a href="index.html?type_immo=archived">Sorties du bilan</a></li>
|
<li {{if $subcurrent == 'sortie'}}class="current"{{/if}}><a href="index.html?type_immo=sortie">Sorties du bilan</a></li>
|
||||||
<li {{if $subcurrent == "unfinished"}}class="current"{{/if}}><a href="index.html?type_immo=unfinished">En cours</a></li>
|
<li {{if $subcurrent == 'autre'}}class="current"{{/if}}><a href="index.html?type_immo=autre">Autres</a></li>
|
||||||
<li {{if $subcurrent == "other"}}class="current"{{/if}}><a href="index.html?type_immo=other">Autres</a></li>
|
|
||||||
<li {{if $current == "config"}} class="current"{{/if}}><a href="config.html">Configuration</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{if $subsubcurrent == "amortization"}}
|
{{if $subsubcurrent == 'amortization'}}
|
||||||
<ul class="sub">
|
<ul class="sub">
|
||||||
<li class="title"><strong>Amortissements</strong></li>
|
<li class="title"><strong>Amortissements</strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
{{elseif $subsubcurrent == "balance_exit"}}
|
{{elseif $subsubcurrent == 'balance_exit'}}
|
||||||
<ul class="sub">
|
<ul class="sub">
|
||||||
<li class="title"><strong>Sortie de bilan</strong></li>
|
<li class="title"><strong>Sortie de bilan</strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
{{* Liste des immobilisations en cours de constitution *}}
|
|
||||||
|
|
||||||
<section class="immobilisation">
|
|
||||||
|
|
||||||
<p class="help">
|
|
||||||
Cette page liste les immobilisations en cours de constitution, donc non amortissables
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<table class="list">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>N°</th>
|
|
||||||
<th>Date</th>
|
|
||||||
<th>Libellé</th>
|
|
||||||
<th class="nombre">Montant</th>
|
|
||||||
<th>N° compte</th>
|
|
||||||
<th>Compte</th>
|
|
||||||
<th class="actions"></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
{{* lister les immobilisations en cours de constitution *}}
|
|
||||||
{{:assign condition=$condition|cat:"account.code LIKE '23%' AND debit > 0 AND NOT (trans.status & 16)"}}
|
|
||||||
{{:assign nb_immo=0}}
|
|
||||||
|
|
||||||
{{#select
|
|
||||||
trans.id as trans_id,
|
|
||||||
trans.label as trans_label,
|
|
||||||
trans.date as trans_date,
|
|
||||||
line.id as immo_id,
|
|
||||||
account.id as account_id,
|
|
||||||
account.code as account_code,
|
|
||||||
account.label as account_label,
|
|
||||||
sum(line.debit) AS debit,
|
|
||||||
trans.id_year as trans_id_year
|
|
||||||
FROM acc_transactions AS trans
|
|
||||||
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
|
||||||
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
|
||||||
INNER JOIN acc_years AS years ON trans.id_year = years.id
|
|
||||||
WHERE !condition
|
|
||||||
GROUP BY trans.id
|
|
||||||
ORDER BY trans.date DESC;
|
|
||||||
!condition=$condition
|
|
||||||
}}
|
|
||||||
{{* voir s'il existe une écriture qui solde l'immobilisation *}}
|
|
||||||
{{:assign ignore=false}}
|
|
||||||
{{#select
|
|
||||||
line.id AS line,
|
|
||||||
line.id_transaction AS trans,
|
|
||||||
line.debit,
|
|
||||||
line.label,
|
|
||||||
line2.id AS line2,
|
|
||||||
line2.id_transaction AS trans2,
|
|
||||||
line2.credit,
|
|
||||||
line2.label
|
|
||||||
FROM acc_transactions_lines AS line
|
|
||||||
INNER JOIN acc_accounts AS acc ON acc.id = line.id_account
|
|
||||||
INNER JOIN acc_transactions_lines AS line2 ON line2.id_account = acc.id
|
|
||||||
WHERE
|
|
||||||
line.id = :line_id
|
|
||||||
AND line2.credit = line.debit;
|
|
||||||
:line_id = $immo_id|intval
|
|
||||||
}}
|
|
||||||
{{:assign ignore=true}}
|
|
||||||
{{/select}}
|
|
||||||
{{if $ignore}}
|
|
||||||
{{:continue}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$account_id:$trans_id_year}}
|
|
||||||
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
|
||||||
<td>{{$trans_date|date_short}}</td>
|
|
||||||
<td>{{$trans_label}}</td>
|
|
||||||
<td class="money">{{"%f"|math:$debit|money:false}}</td>
|
|
||||||
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
|
|
||||||
<td>{{$account_label}}</td>
|
|
||||||
<td class="actions"></td>
|
|
||||||
</tr>
|
|
||||||
{{/select}}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
{{if $nb_immo == 0}}
|
|
||||||
<p class="block alert">Aucune immobilisation</p>
|
|
||||||
{{/if}}
|
|
||||||
</section>
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{:include file="_get_config.html" keep="config.prefixes"}}
|
{{:read file="./defaut.json" assign="config_json"}}
|
||||||
|
{{:assign config_defaut=$config_json|json_decode}}
|
||||||
|
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
||||||
|
|
||||||
{{#years closed=false order="start_date" assign=years.}}
|
{{#years closed=false order="start_date" assign=years.}}
|
||||||
{{:assign ts_debut=$start_date|strtotime}}
|
{{:assign ts_debut=$start_date|strtotime}}
|
||||||
|
|
@ -12,8 +14,6 @@
|
||||||
{{if $ts_debut <= $now && $now <= $ts_fin}}
|
{{if $ts_debut <= $now && $now <= $ts_fin}}
|
||||||
{{:assign selected_year=$id}}
|
{{:assign selected_year=$id}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
|
||||||
{{:error message="Aucun exercice ouvert"}}
|
|
||||||
{{/years}}
|
{{/years}}
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
file="_check_account.html"
|
file="_check_account.html"
|
||||||
account=$debit_account
|
account=$debit_account
|
||||||
chart_id=$selected_chart
|
chart_id=$selected_chart
|
||||||
prefix_array=$config.prefixes
|
prefix_array=$prefix_array
|
||||||
keep="account_ok"
|
keep="account_ok"
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
@ -117,9 +117,9 @@
|
||||||
status=$status
|
status=$status
|
||||||
}}
|
}}
|
||||||
{{if $_POST.amortir}}
|
{{if $_POST.amortir}}
|
||||||
{{:assign type_immo="managed"}}
|
{{:assign type_immo="encours"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign type_immo="other"}}
|
{{:assign type_immo="autre"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:redirect force="index.html?ok=1&msg=immobilisation&type_immo=%s"|args:$type_immo}}
|
{{:redirect force="index.html?ok=1&msg=immobilisation&type_immo=%s"|args:$type_immo}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
@ -134,14 +134,16 @@
|
||||||
|
|
||||||
{{* formulaire d'ajout d'immobilisation *}}
|
{{* formulaire d'ajout d'immobilisation *}}
|
||||||
|
|
||||||
|
{{:assign var="immo_account.2" value="2 — Classe 2 — Comptes d'immobilisations"}}
|
||||||
|
|
||||||
{{#select id,label FROM acc_projects WHERE archived = 0;}}
|
{{#select id,label FROM acc_projects WHERE archived = 0;}}
|
||||||
{{:assign var="projects.%d"|args:$id value=$label}}
|
{{:assign var="projects.%d"|args:$id value=$label}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{#foreach from=$config.prefixes item="code"}}
|
{{#foreach from=$prefix_array item="code"}}
|
||||||
{{:assign var="pattern_array." value="%s*"|args:$code}}
|
{{:assign var="pattern_array." value="%s*"|args:$code}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{:assign var="patterns" value=$pattern_array|implode:"|"}}
|
{{:assign patterns=$pattern_array|implode:"|"}}
|
||||||
|
|
||||||
<div id="erreur" class="hidden">
|
<div id="erreur" class="hidden">
|
||||||
<p class="block error">La date choisie n'est dans aucun exercice ouvert !</p>
|
<p class="block error">La date choisie n'est dans aucun exercice ouvert !</p>
|
||||||
|
|
@ -180,7 +182,7 @@
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Amortissement</legend>
|
<legend>Amortissement</legend>
|
||||||
<dl>
|
<dl>
|
||||||
{{:input id="amortir" type="checkbox" value=1 name="amortir" label="Amortir cette immobilisation sur plusieurs années" checked="checked" help="Dé-cocher pour ne pas amortir"}}
|
{{:input id="amortir" type="checkbox" value=1 name="amortir" label="Amortir cette immobilisation sur plusieurs années" checked="cheched" help="Dé-cocher pour ne pas amortir"}}
|
||||||
<div id="div_amort">
|
<div id="div_amort">
|
||||||
{{:input type="number" name="duree" label="Durée d'amortissement" required=true min=0 default=1 suffix="année(s)"}}
|
{{:input type="number" name="duree" label="Durée d'amortissement" required=true min=0 default=1 suffix="année(s)"}}
|
||||||
{{:input type="date" name="date_mes" label="Date de mise en service" help="C'est la date de première utilisation ; à renseigner uniquement si différente de la date d'acquisition"}}
|
{{:input type="date" name="date_mes" label="Date de mise en service" help="C'est la date de première utilisation ; à renseigner uniquement si différente de la date d'acquisition"}}
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,19 @@
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
@param immo_id
|
@param immo_id
|
||||||
@param type_immo : managed, amortized, archived, other
|
@param amort = 1 si immo amortissable, 0 si non
|
||||||
|
@param op = new ou modif
|
||||||
|
@param type_immo : encours, amortie, sortie, autre
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
{{if $_GET.op == "modif"}}
|
||||||
{{/load}}
|
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
||||||
|
{{/load}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="save"}}
|
{{#form on="save"}}
|
||||||
|
{{:debug post=$_POST}}
|
||||||
{{if $_POST.classify == null}}
|
{{if $_POST.classify == null}}
|
||||||
{{:error message="Vous devez choisir une action"}}
|
{{:error message="Vous devez choisir une action"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -51,11 +56,13 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* enregistrer les infos de l'immobilisation *}}
|
{{* enregistrer les infos de l'immobilisation *}}
|
||||||
{{if $info_immo == null}}
|
{{if $_GET.op == "new"}}
|
||||||
{{:assign key=""|uuid}}
|
{{:assign key=""|uuid}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign key=$info_immo.key}}
|
{{:assign key=$info_immo.key}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{:debug duree=$duration date=$date_debut classif=$_POST.classify status=$status}}
|
||||||
|
|
||||||
{{:save
|
{{:save
|
||||||
key=$key
|
key=$key
|
||||||
validate_schema="schema.json"
|
validate_schema="schema.json"
|
||||||
|
|
@ -66,8 +73,10 @@
|
||||||
status=$status
|
status=$status
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{if $_POST.classify == "managed" || $_POST.classify == "amortized"}}
|
{{if $_POST.classify == "managed"}}
|
||||||
{{:assign type_immo=$_POST.classify}}
|
{{:assign type_immo="encours"}}
|
||||||
|
{{elseif $_POST.classify == "amortized"}}
|
||||||
|
{{:assign type_immo="amortie"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign type_immo=$_GET.type_immo}}
|
{{:assign type_immo=$_GET.type_immo}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -76,43 +85,31 @@
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:admin_header title="Informations amortissement" custom_css=$custom_css current="module_amortissement"}}
|
{{:admin_header title="Renseigner informations amortissement" custom_css=$custom_css current="module_amortissement"}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{if ! $dialog}}
|
{{if ! $dialog}}
|
||||||
{{:include file="_nav.html" current="index"}}
|
{{:include file="_nav.html" current="index"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $info_immo == null}}
|
{{* renseigner ou modifier la date de mise en service et la durée d'amortissement *}}
|
||||||
{{:assign default=$_GET.type_immo}}
|
{{if $_GET.amort == 0}}
|
||||||
{{else}}
|
|
||||||
{{:assign default=$info_immo.status}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{if $_GET.type_immo == "managed" || $_GET.type_immo == "amortized"}}
|
|
||||||
{{:assign disabled=0}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign disabled=1}}
|
{{:assign disabled=1}}
|
||||||
|
{{:assign default=""}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign disabled=0}}
|
||||||
|
{{:assign default="managed"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{*
|
|
||||||
- classer l'immobilisation
|
|
||||||
- renseigner ou modifier la date de mise en service et la durée d'amortissement
|
|
||||||
*}}
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
<fieldset id="classement_immo">
|
<fieldset id="infos_immo">
|
||||||
<legend>Classement</legend>
|
<legend></legend>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label>Faites un choix</label> <b>(obligatoire)</b></dt>
|
<dt><label>Faites un choix</label> <b>(obligatoire)</b></dt>
|
||||||
{{:input type="radio-btn" name="classify" value="managed" label="Amortir" default=$default onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
{{:input type="radio" name="classify" value="managed" label="Amortir" help="Amortir cette immobilisation" default=$default onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
||||||
{{:input type="radio-btn" name="classify" value="amortized" label="Amortissement terminé" help="Cette immobilisation sera classée parmi les immobilisations amorties" default=$default onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
{{:input type="radio" name="classify" value="amortized" label="Marquer amortie" help="Cette immobilisation sera classée parmi les immobilisations amorties" onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
||||||
{{:input type="radio-btn" name="classify" value="ignored" label="Ignorer l'écriture" help="Cette écriture n'apparaitra plus dans la liste des immobilisations" default=$default onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
{{:input type="radio" name="classify" value="ignored" label="Ignorer l'écriture" help="Cette écriture n'apparaitra plus dans la liste des immobilisations" onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset id="infos_immo">
|
|
||||||
<legend>Informations</legend>
|
|
||||||
<dl>
|
|
||||||
{{if $info_immo != null}}
|
{{if $info_immo != null}}
|
||||||
{{:assign date_defaut=$info_immo.date}}
|
{{:assign date_defaut=$info_immo.date}}
|
||||||
{{:assign duree_defaut=$info_immo.duration}}
|
{{:assign duree_defaut=$info_immo.duration}}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
{{*
|
{{*
|
||||||
Lister les écritures d'amortissement associées à une immobilisation
|
Lister les écritures d'amortissement associées à une immobilisation
|
||||||
@param immo_id : id de la ligne d'immo
|
@param immo_id : id de la ligne d'immo
|
||||||
@param type_immo : managed, amortized, archived, others
|
@param type_immo : encours, amortie, sortie, autres
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* récupérer les infos de l'immobilisation *}}
|
{{* récupérer les infos de l'immobilisation *}}
|
||||||
|
|
@ -114,14 +114,14 @@
|
||||||
{{:admin_header title="Liste des amortissements" custom_css="./style.css" current="module_amortissement"}}
|
{{:admin_header title="Liste des amortissements" custom_css="./style.css" current="module_amortissement"}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{if $_GET.type_immo == "amortized" || $valeur_residuelle== 0 }}
|
{{if $_GET.type_immo == "amortie" || $valeur_residuelle== 0 }}
|
||||||
{{:assign subcurrent="amortized"}}
|
{{:assign subcurrent="amortie"}}
|
||||||
{{elseif $_GET.type_immo == "archived"}}
|
{{elseif $_GET.type_immo == "sortie"}}
|
||||||
{{:assign subcurrent="archived"}}
|
{{:assign subcurrent="sortie"}}
|
||||||
{{elseif $_GET.type_immo == null || $_GET.type_immo == "managed"}}
|
{{elseif $_GET.type_immo == null || $_GET.type_immo == "encours"}}
|
||||||
{{:assign subcurrent="managed"}}
|
{{:assign subcurrent="encours"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign subcurrent="other"}}
|
{{:assign subcurrent="autre"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:include
|
{{:include
|
||||||
|
|
@ -241,14 +241,14 @@
|
||||||
<p class="block alert">Aucun amortissement enregistré pour cette immobilisation</p>
|
<p class="block alert">Aucun amortissement enregistré pour cette immobilisation</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $_GET.type_immo == null || $_GET.type_immo != "amortized"}}
|
{{if $_GET.type_immo == null || $_GET.type_immo != "amortie"}}
|
||||||
|
|
||||||
{{* Autres amortissements non rattachés *}}
|
{{* Autres amortissements non rattachés *}}
|
||||||
|
|
||||||
{{if $autres_amortissements != null}}
|
{{if $autres_amortissements != null}}
|
||||||
<p class="block alert">
|
<p class="block alert">
|
||||||
Il existe des écritures d'amortissement qui ne sont pas rattachés à une immobilisation ! <br />
|
Il existe des écritures d'amortissement qui ne sont pas rattachés à une immobilisation ! <br />
|
||||||
Utilisez le bouton « Rattacher une écriture » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation.
|
Utilisez le bouton « Attacher un amortissement » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation.
|
||||||
</p>
|
</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
202
config.html
202
config.html
|
|
@ -1,202 +0,0 @@
|
||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
{{:admin_header title="Configuration" custom_css="./style.css" current="module_amortissement"}}
|
|
||||||
{{* barre de navigation *}}
|
|
||||||
{{:include file="_nav.html" current="config"}}
|
|
||||||
|
|
||||||
{{if $_GET.ok == 1}}
|
|
||||||
<p class="block confirm">Configuration enregistrée.</p>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* lecture config (défaut ou enregistrée) *}}
|
|
||||||
{{:include file="./_get_config.html" keep="config"}}
|
|
||||||
|
|
||||||
{{#form on="save"}}
|
|
||||||
{{:assign ok=0}}
|
|
||||||
{{#foreach from=$_POST.immo_accounts item="line"}}
|
|
||||||
{{:assign elem=$line|values}}
|
|
||||||
{{:assign elem=$elem.0}}
|
|
||||||
{{:assign var="fields" value=$elem|explode:" "}}
|
|
||||||
{{:assign present=false}}
|
|
||||||
{{* ne pas garder si préfixe d'un compte déjà présent *}}
|
|
||||||
{{#foreach from=$account_codes item="code"}}
|
|
||||||
{{:assign pos=$code|strpos:$fields.0}}
|
|
||||||
{{if $pos !== false}}
|
|
||||||
{{:assign present=true}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{if ! $present}}
|
|
||||||
{{:assign var="account_codes." value=$fields.0}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
{{:save
|
|
||||||
key="config"
|
|
||||||
prefixes=$account_codes|sort
|
|
||||||
}}
|
|
||||||
{{:assign ok=1}}
|
|
||||||
|
|
||||||
{{:redirect to="./config.html?ok=%d"|args:$ok}}
|
|
||||||
{{/form}}
|
|
||||||
|
|
||||||
{{* récupérer l'exercice courant ou sinon le plus récent *}}
|
|
||||||
{{:assign var="selected_year" from="logged_user.preferences.accounting_year"}}
|
|
||||||
{{if $selected_year == null}}
|
|
||||||
{{* sélectionner l'exercice le plus probable *}}
|
|
||||||
{{#years}}
|
|
||||||
{{if $start_date|strtotime <= $now && $end_date|strtotime >= $now}}
|
|
||||||
{{:assign selected_year=$id}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{:assign last_year=$id}}
|
|
||||||
{{/years}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{if $selected_year == null}}
|
|
||||||
{{if $last_year == null}}
|
|
||||||
<p class="block alert">Aucun exercice</p>
|
|
||||||
{{else}}
|
|
||||||
{{:assign selected_year=$last_year}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{if $selected_year != null}}
|
|
||||||
|
|
||||||
{{* libellés des comptes d'immobilisation *}}
|
|
||||||
{{:assign condition="("}}
|
|
||||||
{{#foreach from=$config.prefixes item="code"}}
|
|
||||||
{{:assign code=$code|quote_sql}}
|
|
||||||
{{:assign condition=$condition|cat:" account.code = "|cat:$code|cat:" OR "}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{:assign condition=$condition|cat:"0)"}}
|
|
||||||
{{:assign condition=$condition|cat:" AND year.id = %s"|args:$selected_year}}
|
|
||||||
|
|
||||||
{{#select
|
|
||||||
account.id as account_id,
|
|
||||||
account.code,
|
|
||||||
account.id_chart,
|
|
||||||
account.label,
|
|
||||||
year.label as year_label,
|
|
||||||
chart.label as chart_label
|
|
||||||
FROM acc_accounts AS account
|
|
||||||
INNER JOIN acc_charts AS chart ON chart.id = account.id_chart
|
|
||||||
INNER JOIN acc_years AS year ON year.id_chart = chart.id
|
|
||||||
WHERE !condition
|
|
||||||
;
|
|
||||||
!condition=$condition
|
|
||||||
}}
|
|
||||||
{{:assign var="accounts.%s"|args:$code label=$label id=$account_id}}
|
|
||||||
{{/select}}
|
|
||||||
|
|
||||||
<h3>Comptes d'immobilisation</h3>
|
|
||||||
<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">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td>Compte</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{{#foreach from=$accounts key=code item=elem}}
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
{{:assign var="immo_account.%s.%s"|args:$code:$code value="%s — "|args:$code|cat:$elem.label}}
|
|
||||||
{{:assign var="current_account" from="immo_account.%s"|args:$code}}
|
|
||||||
{{:input
|
|
||||||
type="list"
|
|
||||||
name="immo_accounts[]"
|
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&id_year=%d"|args:$code::$selected_year
|
|
||||||
default=$current_account
|
|
||||||
}}
|
|
||||||
</td>
|
|
||||||
<td class="actions">
|
|
||||||
{{:button
|
|
||||||
label="Enlever"
|
|
||||||
title="Enlever une ligne"
|
|
||||||
shape="minus"
|
|
||||||
min="1"
|
|
||||||
name="remove_line"
|
|
||||||
}}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{/foreach}}
|
|
||||||
</tbody>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
<td class="actions">{{:button shape="plus" label="Ajouter" title="Ajouter un compte"}}</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<p class="submit">
|
|
||||||
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
|
||||||
</p>
|
|
||||||
</form>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
<script type="text/javascript" src="scripts.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
function remove_line(idtable, code) {
|
|
||||||
let trouve = false, row = null;
|
|
||||||
const table = document.getElementById(idtable);
|
|
||||||
for (let i = 0; i < table.rows.length; ++i) {
|
|
||||||
row = table.rows[i];
|
|
||||||
for (let j = 0; j < row.cells.length; ++j) {
|
|
||||||
const col = row.cells[j];
|
|
||||||
if (col.innerText == code) {
|
|
||||||
trouve = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (trouve) { break; }
|
|
||||||
}
|
|
||||||
if (row != null) {
|
|
||||||
row.parentNode.removeChild(row);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/javascript" async="async">
|
|
||||||
|
|
||||||
// bouton - : supprimer une ligne
|
|
||||||
var lines = $('.transaction-lines tbody tr');
|
|
||||||
lines.forEach(initLine);
|
|
||||||
|
|
||||||
// bouton + : dupliquer une ligne
|
|
||||||
$('.transaction-lines tfoot button')[0].onclick = () => {
|
|
||||||
let lines = $('.transaction-lines tbody tr');
|
|
||||||
var line = lines[lines.length - 1];
|
|
||||||
var n = line.cloneNode(true);
|
|
||||||
|
|
||||||
// Réinitialiser le sélecteur de compte
|
|
||||||
let b = n.querySelector('.input-list button');
|
|
||||||
let url = b.value;
|
|
||||||
let new_url = url.replace(/codes=[0-9]+\*?/, "codes=2*");
|
|
||||||
b.value = new_url;
|
|
||||||
|
|
||||||
// gestionnaire d'événement
|
|
||||||
b.onclick = () => {
|
|
||||||
g.current_list_input = b.parentNode;
|
|
||||||
let url = b.value + (b.value.indexOf('?') > 0 ? '&' : '?') + '_dialog';
|
|
||||||
g.openFrameDialog(url);
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// réinitialiser le label
|
|
||||||
let l = n.querySelector('.input-list span.label');
|
|
||||||
console.log("label=" + l.innerText);
|
|
||||||
l.innerText = '';
|
|
||||||
|
|
||||||
line.parentNode.appendChild(n);
|
|
||||||
initLine(n);
|
|
||||||
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
50
confirm_action.html
Normal file
50
confirm_action.html
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{#form on="validate"}}
|
||||||
|
{{:debug get=$_GET post=$_POST}}
|
||||||
|
{{/form}}
|
||||||
|
|
||||||
|
{{:admin_header title="Confirmer"}}
|
||||||
|
{{:assign .="infos"}}
|
||||||
|
{{*:debug post=$_POST*}}
|
||||||
|
{{if $_POST.actions == "amortize"}}
|
||||||
|
{{:assign action="Marquer l'immobilisation amortie"}}
|
||||||
|
{{elseif $_POST.actions == "ignore"}}
|
||||||
|
{{:assign action="Ignorer l'écriture"}}
|
||||||
|
{{/if}}
|
||||||
|
{{:assign msg_titre="Appliquer l'opération « %s » sur les écritures : "|args:$action}}
|
||||||
|
|
||||||
|
{{:assign msg_lines=""}}
|
||||||
|
|
||||||
|
{{:admin_header title="Confirmer l'opération" custom_css="./style.css" current="module_amortissement"*}}
|
||||||
|
|
||||||
|
<form method="post" action="">
|
||||||
|
<div class="block alert">
|
||||||
|
<p>Appliquer l'opération « {{$action}} » sur les écritures :</p>
|
||||||
|
</div>
|
||||||
|
<table class="list">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td class="num">N°</td>
|
||||||
|
<td>Libellé</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#foreach from=$_POST.check item="line"}}
|
||||||
|
<tr>
|
||||||
|
{{:assign var="label" from="_POST.label.%s"|args:$line}}
|
||||||
|
{{:assign var="trans_id" from="_POST.trans.%s"|args:$line}}
|
||||||
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
||||||
|
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||||
|
<td>{{$label}}</td>
|
||||||
|
</tr>
|
||||||
|
<input type="hidden" name="trans[{{$trans_id}}]" value="{{$line}}">
|
||||||
|
{{/foreach}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p class="submit">
|
||||||
|
{{:button type="submit" name="validate" label="Confirmer" shape="right" class="main"}}
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{{:admin_footer}}
|
||||||
10
defaut.json
10
defaut.json
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"tva": false,
|
"tva": false,
|
||||||
"prefixes": [
|
"prefixes": {
|
||||||
"20",
|
"20": "Immobilisations incorporelles",
|
||||||
"21",
|
"21": "Immobilisations corporelles",
|
||||||
"27"
|
"27": "Immobilisations financières"
|
||||||
]
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
23
index.html
23
index.html
|
|
@ -1,24 +1,13 @@
|
||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
{{:admin_header title="Immobilisations et amortissements" custom_css="./style.css" current="module_amortization"}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{if $_GET.type_immo == null}}
|
{{if $_GET.type_immo == null}}
|
||||||
{{:assign type_immo="managed"}}
|
{{:assign type_immo="encours"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign type_immo=$_GET.type_immo}}
|
{{:assign type_immo=$_GET.type_immo}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $type_immo == "managed"}}
|
|
||||||
{{:admin_header title="Immobilisations en cours d'amortissement" custom_css="./style.css" current="module_amortization"}}
|
|
||||||
{{elseif $type_immo == "amortized"}}
|
|
||||||
{{:admin_header title="Immobilisations amorties" custom_css="./style.css" current="module_amortization"}}
|
|
||||||
{{elseif $type_immo == "archived"}}
|
|
||||||
{{:admin_header title="Immobilisations archivées" custom_css="./style.css" current="module_amortization"}}
|
|
||||||
{{elseif $type_immo == "other"}}
|
|
||||||
{{:admin_header title="Autres immobilisations" custom_css="./style.css" current="module_amortization"}}
|
|
||||||
{{elseif $type_immo == "unfinished"}}
|
|
||||||
{{:admin_header title="Immobilisations en cours" custom_css="./style.css" current="module_amortization"}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$type_immo}}
|
{{:include file="_nav.html" current="index" subcurrent="%s"|args:$type_immo}}
|
||||||
|
|
||||||
{{if $_GET.ok}}
|
{{if $_GET.ok}}
|
||||||
|
|
@ -45,13 +34,11 @@
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{if $type_immo == "other"}}
|
{{if $type_immo == "autre"}}
|
||||||
{{:include file="_immobilisations_autres.html"}}
|
{{:include file="_immobilisations_autres.html"}}
|
||||||
{{elseif $type_immo == "archived"}}
|
{{elseif $type_immo == "sortie"}}
|
||||||
{{:include file="_archives.html"}}
|
{{:include file="_archives.html"}}
|
||||||
{{elseif $type_immo == "unfinished"}}
|
{{elseif $type_immo == "encours" || $type_immo == "amortie"}}
|
||||||
{{:include file="_unfinished.html"}}
|
|
||||||
{{elseif $type_immo == "managed" || $type_immo == "amortized"}}
|
|
||||||
{{:include file="_immobilisations.html"}}
|
{{:include file="_immobilisations.html"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
name="Amortissements"
|
name="Amortissements"
|
||||||
description="Immobilisations et amortissements"
|
description="Gestion des amortissements pour le logiciel de comptabilité Paheko"
|
||||||
author="Jean-Christophe Engel"
|
author="Jean-Christophe Engel"
|
||||||
author_url="https://gitea.zaclys.com/lesanges"
|
author_url="https://gitea.zaclys.com/lesanges"
|
||||||
home_button=false
|
home_button=false
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,9 @@
|
||||||
{{:include
|
{{:include
|
||||||
file="_nav.html"
|
file="_nav.html"
|
||||||
current="index"
|
current="index"
|
||||||
subcurrent="other"
|
subcurrent="autre"
|
||||||
subsubcurrent="amortization"
|
subsubcurrent="amortization"
|
||||||
type_immo="other"
|
type_immo="autre"
|
||||||
autres_amort=$autres_amortissements
|
autres_amort=$autres_amortissements
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -147,8 +147,10 @@
|
||||||
- que le compte d'amortissement débute par un préfixe correct (280, 281, ...)
|
- 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
|
- est présent dans le PC de l'exercice correspondant à la date
|
||||||
*}}
|
*}}
|
||||||
{{:include file="_get_config.html" keep="config.prefixes"}}
|
{{:read file="./defaut.json" assign="config_json"}}
|
||||||
{{#foreach from=$config.prefixes item="code"}}
|
{{:assign config_defaut=$config_json|json_decode}}
|
||||||
|
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
||||||
|
{{#foreach from=$prefix_array item="code"}}
|
||||||
{{* déterminer le numéro du compte d'amortissement associé au compte d'immobilisation *}}
|
{{* déterminer le numéro du compte d'amortissement associé au compte d'immobilisation *}}
|
||||||
{{:include
|
{{:include
|
||||||
file="./_get_amort_code.html"
|
file="./_get_amort_code.html"
|
||||||
|
|
@ -212,7 +214,7 @@
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{if ! $dialog}}
|
{{if ! $dialog}}
|
||||||
{{:include file="_nav.html" current="index" subcurrent="managed" subsubcurrent="amortization"}}
|
{{:include file="_nav.html" current="index" subcurrent="encours" subsubcurrent="amortization"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
|
@ -252,7 +254,7 @@
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="credit_account"
|
name="credit_account"
|
||||||
label="Compte d'amortissement (28xx)"
|
label="Compte d'amortissement (280xx ou 281xx)"
|
||||||
required=true
|
required=true
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&id_year=%d"|args:"28*":$selected_year
|
target="!acc/charts/accounts/selector.php?codes=%s&id_year=%d"|args:"28*":$selected_year
|
||||||
default=$credit_account
|
default=$credit_account
|
||||||
|
|
|
||||||
18
scripts.js
18
scripts.js
|
|
@ -139,21 +139,3 @@ function setSelectorYear(button_names, f_years_selector) {
|
||||||
const selected_year = document.getElementById(f_years_selector).value;
|
const selected_year = document.getElementById(f_years_selector).value;
|
||||||
setAccountYear(button_names, selected_year);
|
setAccountYear(button_names, selected_year);
|
||||||
}
|
}
|
||||||
|
|
||||||
// config : gestion des ajouts/suppression comptes immo
|
|
||||||
|
|
||||||
function initLine(row) {
|
|
||||||
var removeBtn = row.querySelector('button[name="remove_line"]');
|
|
||||||
removeBtn.onclick = () => {
|
|
||||||
var count = $('.transaction-lines tbody tr').length;
|
|
||||||
var min = removeBtn.getAttribute('min');
|
|
||||||
|
|
||||||
if (count <= min) {
|
|
||||||
alert("Il n'est pas possible d'avoir moins de " + min + " compte(s).");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
row.parentNode.removeChild(row);
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,21 @@
|
||||||
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
|
{{* date de début de l'exercice *}}
|
||||||
|
{{#select start_date FROM acc_years WHERE id = :year_id; :year_id = $_GET.year}}
|
||||||
|
{{*
|
||||||
|
{{if $start_date < "2025-01-01"
|
||||||
|
*}}
|
||||||
|
{{:assign vnc_code="675"}}
|
||||||
|
{{:assign cession_code="775"}}
|
||||||
|
{{*
|
||||||
|
{{else}}
|
||||||
|
{{:assign vnc_code="657"}}
|
||||||
|
{{:assign cession_code="757"}}
|
||||||
|
{{/if}}
|
||||||
|
*}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.montant:$_GET.amort_amount}}
|
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.montant:$_GET.amort_amount}}
|
||||||
{{:assign amort_comp=0}} {{* amortissement complémentaire jqà date sortie *}}
|
{{:assign amort_comp=0}} {{* amortissement complémentaire jqà date sortie *}}
|
||||||
{{:assign amort_except=0}} {{* amortissement exceptionnel jqà date fin amortissement *}}
|
{{:assign amort_except=0}} {{* amortissement exceptionnel jqà date fin amortissement *}}
|
||||||
|
|
@ -245,7 +260,7 @@
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:redirect to="index.html?type_immo=archived"}}
|
{{:redirect to="index.html?type_immo=sortie"}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:admin_header title="Sortie du bilan" custom_css="./style.css" current="module_amortissement"}}
|
{{:admin_header title="Sortie du bilan" custom_css="./style.css" current="module_amortissement"}}
|
||||||
|
|
@ -254,25 +269,16 @@
|
||||||
{{if ! $dialog}}
|
{{if ! $dialog}}
|
||||||
{{:include file="_nav.html" current="index" subcurrent="balance_exit"}}
|
{{:include file="_nav.html" current="index" subcurrent="balance_exit"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{:form_errors}}
|
||||||
|
|
||||||
{{*
|
{{* Préparer les infos pour le formulaire *}}
|
||||||
Préparer les infos pour le formulaire
|
|
||||||
déterminer les comptes pour les différentes écritures
|
|
||||||
*}}
|
|
||||||
|
|
||||||
|
{{* déterminer les comptes pour les différentes écritures *}}
|
||||||
{{:include
|
{{:include
|
||||||
file="./_get_amort_code.html"
|
file="./_get_amort_code.html"
|
||||||
code_immo=$ligne_immo.code
|
code_immo=$ligne_immo.code
|
||||||
keep="code_amort"
|
keep="code_amort"
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{*
|
|
||||||
Utilisation des « anciens » numéros de comptes because conflit
|
|
||||||
avec les nouveaux numéros ; voir info.org
|
|
||||||
*}}
|
|
||||||
{{:assign vnc_code="675"}}
|
|
||||||
{{:assign cession_code="775"}}
|
|
||||||
|
|
||||||
{{:assign var="liste_codes.6811" name="comp_account"}}
|
{{:assign var="liste_codes.6811" name="comp_account"}}
|
||||||
{{:assign var="liste_codes.687" name="except_account"}}
|
{{:assign var="liste_codes.687" name="except_account"}}
|
||||||
{{:assign var="liste_codes.462" name="creance_account"}}
|
{{:assign var="liste_codes.462" name="creance_account"}}
|
||||||
|
|
@ -283,36 +289,31 @@
|
||||||
{{:assign condition=$liste_codes|keys|implode:","}}
|
{{:assign condition=$liste_codes|keys|implode:","}}
|
||||||
{{:assign condition="acc.code IN ("|cat:$condition|cat:")"}}
|
{{:assign condition="acc.code IN ("|cat:$condition|cat:")"}}
|
||||||
|
|
||||||
{{#select
|
|
||||||
chart.id
|
|
||||||
FROM acc_charts AS chart
|
|
||||||
INNER JOIN acc_years AS year ON chart.id = year.id_chart
|
|
||||||
WHERE year.id = :year_id;
|
|
||||||
:year_id = $_GET.year
|
|
||||||
}}
|
|
||||||
{{:assign chart_id=$id}}
|
|
||||||
{{/select}}
|
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
acc.id,
|
acc.id,
|
||||||
acc.code as acc_code,
|
acc.code as acc_code,
|
||||||
acc.label as acc_label
|
acc.label as acc_label,
|
||||||
|
year.label as year_label
|
||||||
FROM acc_accounts as acc
|
FROM acc_accounts as acc
|
||||||
INNER JOIN acc_charts as chart ON chart.id = acc.id_chart
|
INNER JOIN acc_charts as chart ON chart.id = acc.id_chart
|
||||||
WHERE chart.id = :chart_id AND !condition;
|
INNER JOIN acc_years as year ON chart.id = year.id_chart
|
||||||
:chart_id = $chart_id
|
WHERE year.id = 1 AND !condition;
|
||||||
!condition=$condition
|
!condition=$condition
|
||||||
}}
|
}}
|
||||||
{{:assign var="liste_codes.%s.id"|args:$acc_code value=$id}}
|
{{:assign var="liste_codes.%s.id"|args:$acc_code value=$id}}
|
||||||
{{:assign var="liste_codes.%s.acc_label"|args:$acc_code value=$acc_label}}
|
{{:assign var="liste_codes.%s.acc_label"|args:$acc_code value=$acc_label}}
|
||||||
|
{{:assign var="liste_codes.%s.year_label"|args:$acc_code value=$year_label}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{#foreach from=$liste_codes key=code}}
|
{{#foreach from=$liste_codes key=code}}
|
||||||
{{:assign var="%s.%s"|args:$name:$code value="%s — %s"|args:$code:$acc_label}}
|
{{:assign var="%s.%s"|args:$name:$code value="%s — %s"|args:$code:$acc_label}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
{{:include file="_get_config.html" keep="config.prefixes"}}
|
{{:read file="./defaut.json" assign="config_json"}}
|
||||||
{{#foreach from=$config.prefixes item="code"}}
|
{{:assign config_defaut=$config_json|json_decode}}
|
||||||
|
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
||||||
|
|
||||||
|
{{#foreach from=$prefix_array item="code"}}
|
||||||
{{:assign var="pattern_array." value="%s*"|args:$code}}
|
{{:assign var="pattern_array." value="%s*"|args:$code}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{:assign patterns=$pattern_array|implode:"|"}}
|
{{:assign patterns=$pattern_array|implode:"|"}}
|
||||||
|
|
@ -385,7 +386,7 @@
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="comp_account"
|
name="comp_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"68*":$chart_id
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"68*":$_GET.year
|
||||||
default=$comp_account
|
default=$comp_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -397,7 +398,7 @@
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="amort_comp_account"
|
name="amort_comp_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"28*":$chart_id
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$_GET.year
|
||||||
default=$amort_account
|
default=$amort_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -429,7 +430,7 @@
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="except_account"
|
name="except_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"687*":$chart_id
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"687*":$_GET.year
|
||||||
default=$except_account
|
default=$except_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -441,7 +442,7 @@
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="amort_except_account"
|
name="amort_except_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"28*":$chart_id
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$_GET.year
|
||||||
default=$amort_account
|
default=$amort_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -467,7 +468,7 @@
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="amort_sortie_account"
|
name="amort_sortie_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"28*":$chart_id
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$_GET.year
|
||||||
default=$amort_account
|
default=$amort_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -485,7 +486,7 @@
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="vnc_account"
|
name="vnc_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s*&id_chart=%s"|args:$vnc_code:$chart_id
|
target="!acc/charts/accounts/selector.php?codes=%s*&year=%d"|args:$vnc_code:$_GET.year
|
||||||
default=$vnc_account
|
default=$vnc_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -494,11 +495,11 @@
|
||||||
</tr>
|
</tr>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td> {{* style="pointer-events: none; opacity: 0.6;">*}}
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="immo_account"
|
name="immo_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:$patterns:$chart_id
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:$patterns:$_GET.year
|
||||||
default=$immo_account
|
default=$immo_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -524,7 +525,7 @@
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="creance_account"
|
name="creance_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"462*":$chart_id
|
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"462*":$_GET.year
|
||||||
default=$creance_account
|
default=$creance_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -536,7 +537,7 @@
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="cession_account"
|
name="cession_account"
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s*&id_chart=%s"|args:$cession_code:$chart_id
|
target="!acc/charts/accounts/selector.php?codes=%s*&year=%d"|args:$cession_code:$_GET.year
|
||||||
default=$cession_account
|
default=$cession_account
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -552,5 +553,4 @@
|
||||||
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
{{:form_errors}}
|
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue