diff --git a/archives.html b/_archives.html
similarity index 100%
rename from archives.html
rename to _archives.html
diff --git a/_check_date.html b/_check_date.html
deleted file mode 100644
index f68ec49..0000000
--- a/_check_date.html
+++ /dev/null
@@ -1,19 +0,0 @@
-{{* -*- brindille -*- *}}
-
-{{*
- vérifier que la date est située dans un exercice ouvert
- paramètres :
- - date
- résultat : open_years, selected_year, selected_chart
-*}}
-
-{{:assign open_years=""}}
-{{#years closed=false order="start_date" assign="open_years."}}
- {{if
- $start_date|strtotime <= $date|parse_date|strtotime &&
- $end_date|strtotime >= $date|parse_date|strtotime
- }}
- {{:assign selected_year=$id}}
- {{:assign selected_chart=$id_chart}}
- {{/if}}
-{{/years}}
diff --git a/immobilisations.html b/_immobilisations.html
similarity index 100%
rename from immobilisations.html
rename to _immobilisations.html
diff --git a/immobilisations_autres.html b/_immobilisations_autres.html
similarity index 96%
rename from immobilisations_autres.html
rename to _immobilisations_autres.html
index c987088..2d81e86 100644
--- a/immobilisations_autres.html
+++ b/_immobilisations_autres.html
@@ -120,6 +120,11 @@
target="_dialog"
}}
{{/if}}
+ {{:linkbutton
+ label="Amortissements"
+ href="amortization.html?immo_id=%s&type_immo=autres"|args:$immo_id
+ shape="table"
+ }}
{{/select}}
diff --git a/_next_year.html b/_next_year.html
deleted file mode 100644
index 0de8dea..0000000
--- a/_next_year.html
+++ /dev/null
@@ -1,13 +0,0 @@
-{{* -*- brindille -*- *}}
-{{*
- Rend une date située un an après la date paramètre
- paramètres :
- - date
- résultat : date_amort
-*}}
-
-{{:assign jour=$date|date:"d"}}
-{{:assign mois=$date|date:"m"}}
-{{:assign annee=$date|date:"Y"}}
-{{:assign annee="%d+1"|math:$annee}}
-{{:assign date_amort="%s/%s/%s"|args:$jour:$mois:$annee}}
diff --git a/amortization.html b/amortization.html
index ad2c891..0e97af0 100644
--- a/amortization.html
+++ b/amortization.html
@@ -137,9 +137,9 @@
{{/if}}
+
Amortissements enregistrés
{{if $linked_lines != null}}
- Amortissements enregistrés
+{{else}}
+ Aucun amortissement enregistré pour cette immobilisation
{{/if}}
{{if $_GET.type_immo == null || $_GET.type_immo != "fini"}}
@@ -219,7 +221,7 @@
{{if $autres_amortissements != null}}
- Autres amortissements non rattachés
+ Amortissements non rattachés
diff --git a/immobilisations_non.html b/immobilisations_non.html
deleted file mode 100644
index 39fbd96..0000000
--- a/immobilisations_non.html
+++ /dev/null
@@ -1,72 +0,0 @@
-{{* -*- brindille -*- *}}
-
-{{* Liste des immobilisations non amortissables *}}
-
-
- Immobilisations non amortissables
-
-
-
-
- | N° |
- Date |
- Libellé |
- Montant |
- N° compte |
- Compte |
- Projet |
- |
-
-
-
-
- {{#load type="immo" where="$$.status = 'ignored'"}}
- {{:assign var="lines." value="'%s'"|args:$line}}
- {{/load}}
- {{:assign lines=$lines|implode:","}}
- {{:assign lines="("|cat:$lines|cat:")"}}
- {{:assign condition="line.id IN %s"|args:$lines}}
-{{:debug condition=$condition}}
- {{#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
- 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 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}}
-
- | #{{$trans_id}} |
- {{$trans_date|date_short}} |
- {{$trans_label}} |
- {{"%f"|math:$debit|money:false}} |
- {{$account_code}} |
- {{$account_label}} |
- {{$project_label}} |
-
- {{:linkbutton
- label="Modifier infos"
- href="modif_infos.html?immo_id=%s&amort=0"|args:$immo_id
- shape="help"
- target="_dialog"
- }}
- |
-
- {{/select}}
-
-
-
diff --git a/index.html b/index.html
index 3d7bfe2..9af0454 100644
--- a/index.html
+++ b/index.html
@@ -1,5 +1,5 @@
{{* -*- brindille -*- *}}
-{{:admin_header title="Immobilisations et amortissements" custom_css="./style.css" current="module_amortissement"}}
+{{:admin_header title="Immobilisations et amortissements" custom_css="./style.css" current="module_amortization"}}
{{* barre de navigation *}}
{{if $_GET.type_immo == null}}
@@ -32,27 +32,14 @@
{{else}}
{{:delete key=$key}}
{{/select}}
-
- {{* supprimer les documents correspondant à une écriture de la balance d'ouverture
- {{#select
- line.id as line_id,
- trans.status
- FROM acc_transactions_lines as line
- INNER JOIN acc_transactions AS trans on line.id_transaction = trans.id
- WHERE line.id = :line_id AND (trans.status & 16);
- :line_id = $line
- }}
- {{:delete key=$key}}
- {{/select}}
- *}}
{{/load}}
{{if $type_immo == "autres"}}
- {{:include file="./immobilisations_autres.html"}}
+ {{:include file="_immobilisations_autres.html"}}
{{elseif $type_immo == "archive"}}
- {{:include file="archives.html"}}
+ {{:include file="_archives.html"}}
{{elseif $type_immo == "encours" || $type_immo == "fini"}}
- {{:include file="./immobilisations.html"}}
+ {{:include file="_immobilisations.html"}}
{{/if}}
{{:admin_footer}}
diff --git a/modif_infos.html b/modif_infos.html
deleted file mode 100644
index 7181226..0000000
--- a/modif_infos.html
+++ /dev/null
@@ -1,118 +0,0 @@
-{{* -*- brindille -*- *}}
-
-{{:admin_header title="Modifier informations amortissement" custom_css=$custom_css current="module_amortissement"}}
-
-{{* barre de navigation *}}
-{{if ! $dialog}}
- {{:include file="_nav.html" current="index"}}
-{{/if}}
-
-{{* infos de l'immobilisation *}}
-{{:assign var="immo_id" value=$_GET.immo_id|intval}}
-{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$immo_id|intval}}
-{{/load}}
-
-{{* Traiter l'envoi du formulaire *}}
-{{#form on="change"}}
-
- {{* chercher la date d'acquisition de l'immobilisation *}}
- {{#select
- trans.date as date_achat
- from acc_transactions_lines as line
- inner join acc_transactions as trans on line.id_transaction = trans.id
- where line.id = :line_id;
- :line_id = $immo_id
- assign=ligne_immo
- }}
- {{/select}}
-
- {{if $_POST.no_amort}}
- {{* ne pas amortir *}}
- {{:assign duration=0}}
- {{:assign date_debut=$ligne_immo.date_achat|parse_date}}
- {{:assign status="ignored"}}
- {{else}}
- {{* vérifier que la date d'acquisition est antérieure à la date de mise en service *}}
- {{:assign date_debut=$_POST.date_mes|or:$ligne_immo.date_achat|parse_date}}
- {{if $date_debut|strtotime < $ligne_immo.date_achat|strtotime}}
- {{:assign dd=$date_debut|date_short}}
- {{:assign da=$ligne_immo.date_achat|date_short}}
- {{:error message="Erreur : la date de mise en service (%s) ne peut être antérieure à la date d'acquisition (%s)"|args:$dd:$da}}
- {{/if}}
- {{:assign duration=$_POST.duree|intval}}
- {{if $duration <= 0}}
- {{:error message="Erreur : la durée d'amortissement doit être strictement positive"}}
- {{/if}}
- {{:assign status="managed"}}
- {{/if}}
-
- {{* enregistrer les infos modifiées de l'immobilisation *}}
- {{:save
- key=$info_immo.key
- validate_schema="schema.json"
- type="immo"
- line=$immo_id
- duration=$duration
- date=$date_debut
- status=$status
- }}
-
- {{if $_POST.no_amort}}
- {{:assign amort="autres"}}
- {{else}}
- {{:assign amort="encours"}}
- {{/if}}
- {{:redirect force="index.html?ok=1&msg=infos&amort=%s"|args:$amort}}
-{{else}}
- {{:form_errors}}
-{{/form}}
-
-{{* modifier la date de mise en service et durée d'amortissement *}}
-
-{{if $_GET.amort == 0}}
- {{:assign checked=1}}
- {{:assign disabled=1}}
-{{else}}
- {{:assign checked=0}}
- {{:assign disabled=0}}
-{{/if}}
-
-
-
-{{* activer/désactiver les champs de saisie *}}
-
-
-{{:admin_footer}}