Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff2d16d8cb | ||
|
|
2bf3234ec1 | ||
|
|
2d65bf0f33 |
7 changed files with 159 additions and 42 deletions
|
|
@ -1,14 +1,19 @@
|
|||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{* 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 *}}
|
||||
{{:include file="_get_config.html" keep="config.prefixes"}}
|
||||
|
||||
{{:assign condition="("}}
|
||||
{{#foreach from=$config.prefixes item="code"}}
|
||||
{{if $code|substr:0:2 != "23"}}
|
||||
{{:assign code=$code|cat:"%"|quote_sql}}
|
||||
{{: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)"}}
|
||||
|
|
@ -42,7 +47,6 @@
|
|||
{{/select}}
|
||||
|
||||
<section class="immobilisation">
|
||||
{{:assign nb_immo=0}}
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -58,6 +62,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{:assign nb_immo=0}}
|
||||
{{#foreach from=$immo_archivees}}
|
||||
{{: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}}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,14 @@
|
|||
{{* Liste des immobilisations en cours ou amorties *}}
|
||||
|
||||
<section class="immobilisation">
|
||||
{{:assign nb_immo=0}}
|
||||
|
||||
<p class="help">
|
||||
{{if $type_immo == "managed"}}
|
||||
Cette page liste les immobilisations en cours d'amortissement
|
||||
{{elseif $type_immo == "amortized"}}
|
||||
Cette page liste les immobilisations dont l'amortissement est terminé
|
||||
{{/if}}
|
||||
</p>
|
||||
|
||||
<table class="list">
|
||||
<thead>
|
||||
|
|
@ -25,11 +32,14 @@
|
|||
|
||||
{{:assign condition="("}}
|
||||
{{#foreach from=$config.prefixes item="code"}}
|
||||
{{if $code|substr:0:2 != "23"}}
|
||||
{{:assign code=$code|cat:"%"|quote_sql}}
|
||||
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{:assign condition=$condition|cat:"0)"}}
|
||||
{{:assign condition=$condition|cat:" AND debit > 0 AND NOT (trans.status & 16)"}}
|
||||
{{:assign nb_immo=0}}
|
||||
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
{{* Liste des immobilisations non amortissables ou non (encore) gérées *}}
|
||||
|
||||
<section class="immobilisation">
|
||||
{{:assign nb_immo=0}}
|
||||
|
||||
<p class="help">
|
||||
Cette page liste les écritures pas (encore) prises en charges par le module ou classées non amortissables
|
||||
|
|
@ -33,11 +32,14 @@
|
|||
{{:include file="_get_config.html" keep="config.prefixes"}}
|
||||
{{:assign condition="("}}
|
||||
{{#foreach from=$config.prefixes item="code"}}
|
||||
{{if $code|substr:0:2 != "23"}}
|
||||
{{:assign code=$code|cat:"%"|quote_sql}}
|
||||
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{:assign condition=$condition|cat:"0)"}}
|
||||
{{:assign condition=$condition|cat:" AND debit > 0 AND NOT (trans.status & 16)"}}
|
||||
{{:assign nb_immo=0}}
|
||||
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
<li {{if $subcurrent == "managed"}}class="current"{{/if}}><a href="index.html?type_immo=managed">Amortissables</a></li>
|
||||
<li {{if $subcurrent == "amortized"}}class="current"{{/if}}><a href="index.html?type_immo=amortized">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 == "unfinished"}}class="current"{{/if}}><a href="index.html?type_immo=unfinished">En cours</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>
|
||||
|
|
|
|||
92
_unfinished.html
Normal file
92
_unfinished.html
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
{{* -*- 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>
|
||||
|
|
@ -15,6 +15,8 @@
|
|||
{{: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}}
|
||||
|
|
@ -47,6 +49,8 @@
|
|||
{{:include file="_immobilisations_autres.html"}}
|
||||
{{elseif $type_immo == "archived"}}
|
||||
{{:include file="_archives.html"}}
|
||||
{{elseif $type_immo == "unfinished"}}
|
||||
{{:include file="_unfinished.html"}}
|
||||
{{elseif $type_immo == "managed" || $type_immo == "amortized"}}
|
||||
{{:include file="_immobilisations.html"}}
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -33,21 +33,6 @@
|
|||
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}
|
||||
{{/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 amort_comp=0}} {{* amortissement complémentaire jqà date sortie *}}
|
||||
{{:assign amort_except=0}} {{* amortissement exceptionnel jqà date fin amortissement *}}
|
||||
|
|
@ -269,16 +254,25 @@
|
|||
{{if ! $dialog}}
|
||||
{{:include file="_nav.html" current="index" subcurrent="balance_exit"}}
|
||||
{{/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
|
||||
file="./_get_amort_code.html"
|
||||
code_immo=$ligne_immo.code
|
||||
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.687" name="except_account"}}
|
||||
{{:assign var="liste_codes.462" name="creance_account"}}
|
||||
|
|
@ -289,20 +283,28 @@
|
|||
{{:assign condition=$liste_codes|keys|implode:","}}
|
||||
{{: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
|
||||
acc.id,
|
||||
acc.code as acc_code,
|
||||
acc.label as acc_label,
|
||||
year.label as year_label
|
||||
acc.label as acc_label
|
||||
FROM acc_accounts as acc
|
||||
INNER JOIN acc_charts as chart ON chart.id = acc.id_chart
|
||||
INNER JOIN acc_years as year ON chart.id = year.id_chart
|
||||
WHERE year.id = 1 AND !condition;
|
||||
WHERE chart.id = :chart_id AND !condition;
|
||||
:chart_id = $chart_id
|
||||
!condition=$condition
|
||||
}}
|
||||
{{: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.year_label"|args:$acc_code value=$year_label}}
|
||||
{{/select}}
|
||||
|
||||
{{#foreach from=$liste_codes key=code}}
|
||||
|
|
@ -383,7 +385,7 @@
|
|||
{{:input
|
||||
type="list"
|
||||
name="comp_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"68*":$_GET.year
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"68*":$chart_id
|
||||
default=$comp_account
|
||||
}}
|
||||
</td>
|
||||
|
|
@ -395,7 +397,7 @@
|
|||
{{:input
|
||||
type="list"
|
||||
name="amort_comp_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$_GET.year
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"28*":$chart_id
|
||||
default=$amort_account
|
||||
}}
|
||||
</td>
|
||||
|
|
@ -427,7 +429,7 @@
|
|||
{{:input
|
||||
type="list"
|
||||
name="except_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"687*":$_GET.year
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"687*":$chart_id
|
||||
default=$except_account
|
||||
}}
|
||||
</td>
|
||||
|
|
@ -439,7 +441,7 @@
|
|||
{{:input
|
||||
type="list"
|
||||
name="amort_except_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$_GET.year
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"28*":$chart_id
|
||||
default=$amort_account
|
||||
}}
|
||||
</td>
|
||||
|
|
@ -465,7 +467,7 @@
|
|||
{{:input
|
||||
type="list"
|
||||
name="amort_sortie_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$_GET.year
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"28*":$chart_id
|
||||
default=$amort_account
|
||||
}}
|
||||
</td>
|
||||
|
|
@ -483,7 +485,7 @@
|
|||
{{:input
|
||||
type="list"
|
||||
name="vnc_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s*&year=%d"|args:$vnc_code:$_GET.year
|
||||
target="!acc/charts/accounts/selector.php?codes=%s*&id_chart=%s"|args:$vnc_code:$chart_id
|
||||
default=$vnc_account
|
||||
}}
|
||||
</td>
|
||||
|
|
@ -492,11 +494,11 @@
|
|||
</tr>
|
||||
{{/if}}
|
||||
<tr>
|
||||
<td> {{* style="pointer-events: none; opacity: 0.6;">*}}
|
||||
<td>
|
||||
{{:input
|
||||
type="list"
|
||||
name="immo_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:$patterns:$_GET.year
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:$patterns:$chart_id
|
||||
default=$immo_account
|
||||
}}
|
||||
</td>
|
||||
|
|
@ -522,7 +524,7 @@
|
|||
{{:input
|
||||
type="list"
|
||||
name="creance_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"462*":$_GET.year
|
||||
target="!acc/charts/accounts/selector.php?codes=%s&id_chart=%s"|args:"462*":$chart_id
|
||||
default=$creance_account
|
||||
}}
|
||||
</td>
|
||||
|
|
@ -534,7 +536,7 @@
|
|||
{{:input
|
||||
type="list"
|
||||
name="cession_account"
|
||||
target="!acc/charts/accounts/selector.php?codes=%s*&year=%d"|args:$cession_code:$_GET.year
|
||||
target="!acc/charts/accounts/selector.php?codes=%s*&id_chart=%s"|args:$cession_code:$chart_id
|
||||
default=$cession_account
|
||||
}}
|
||||
</td>
|
||||
|
|
@ -550,4 +552,5 @@
|
|||
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
||||
</p>
|
||||
</form>
|
||||
{{:form_errors}}
|
||||
{{:admin_footer}}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue