- {{:assign nb_immo=0}}
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"}}
- {{:assign code=$code|cat:"%"|quote_sql}}
- {{:assign condition=$condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}}
+ {{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,
diff --git a/_nav.html b/_nav.html
index d452b9c..1cc3608 100644
--- a/_nav.html
+++ b/_nav.html
@@ -19,6 +19,7 @@
Amortissables
Amorties
Sorties du bilan
+ En cours
Autres
Configuration
diff --git a/_unfinished.html b/_unfinished.html
new file mode 100644
index 0000000..e583acc
--- /dev/null
+++ b/_unfinished.html
@@ -0,0 +1,92 @@
+{{* -*- brindille -*- *}}
+
+{{* Liste des immobilisations en cours de constitution *}}
+
+
+
+
+ Cette page liste les immobilisations en cours de constitution, donc non amortissables
+
+
+
+
+
+ | N° |
+ Date |
+ Libellé |
+ Montant |
+ N° compte |
+ Compte |
+ |
+
+
+
+
+ {{* 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}}
+
+
+ | #{{$trans_id}} |
+ {{$trans_date|date_short}} |
+ {{$trans_label}} |
+ {{"%f"|math:$debit|money:false}} |
+ {{$account_code}} |
+ {{$account_label}} |
+ |
+
+ {{/select}}
+
+
+ {{if $nb_immo == 0}}
+ Aucune immobilisation
+ {{/if}}
+
diff --git a/index.html b/index.html
index 282a4a0..bf12f85 100644
--- a/index.html
+++ b/index.html
@@ -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}}
diff --git a/write_exit.html b/write_exit.html
index a0a1f57..4441850 100644
--- a/write_exit.html
+++ b/write_exit.html
@@ -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"}}
@@ -297,7 +291,8 @@
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 year.id = :year_id AND !condition;
+ :year_id = $_GET.year
!condition=$condition
}}
{{:assign var="liste_codes.%s.id"|args:$acc_code value=$id}}
@@ -492,7 +487,7 @@
{{/if}}
- | {{* style="pointer-events: none; opacity: 0.6;">*}}
+ |
{{:input
type="list"
name="immo_account"
@@ -550,4 +545,5 @@
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
+{{:form_errors}}
{{:admin_footer}}
|