diff --git a/_nav.html b/_nav.html index 57b9dee..fac14e4 100644 --- a/_nav.html +++ b/_nav.html @@ -1,17 +1,35 @@ {{* -*- brindille -*- *}} - {{if $current == "index" && $subsubcurrent == null}} + {{if $current == "index" && $subcurrent != "unfinished" && $subsubcurrent == null}} + {{elseif $current == "index" && $subcurrent == "details"}} + {{elseif $subsubcurrent == "amortization" && $type_immo == null || $type_immo == "managed" || $type_immo == "other"}} {{/if}} @@ -20,7 +38,7 @@ Amorties Sorties du bilan En cours - Autres + À classer Configuration diff --git a/amortization.html b/amortization.html index 2d3e951..1af7148 100644 --- a/amortization.html +++ b/amortization.html @@ -101,27 +101,40 @@ {{/select}} {{/load}} -{{:assign autres_amortissements=false}} {{if $valeur_residuelle > 0}} {{* Chercher des amortissements non rattachés à une immo *}} {{#select line.id as amort_line_id, - line.id_transaction AS amort_trans_id + line.id_transaction AS amort_trans_id, + line.credit as amort_amount FROM acc_transactions_lines AS line INNER JOIN acc_accounts AS account ON account.id = line.id_account INNER JOIN acc_transactions AS trans ON trans.id = line.id_transaction INNER JOIN acc_years AS y ON y.id = trans.id_year WHERE account.code LIKE "28%" AND credit > 0 AND (NOT trans.status & 16) ORDER BY trans.date, trans.label; + assign="amort" }} - {{* cette ligne d'amortissement a-t-elle un doc associé ? *}} + {{* voir s'il existe des lignes d'immo liées à cette ligne d'amortissement *}} + {{:assign amort_amount=0}} + {{:assign keep_amort=true}} {{#load type="amort_link" where="$$.amort_line_id = :amort_line_id" :amort_line_id = $amort_line_id + assign="amort_link" }} + {{if $amort_link.amount == null || $amort_link.amount == 0}} + {{:assign amort_amount=$amort.amort_amount}} + {{:assign keep_amort=false}} + {{else}} + {{:assign amort_amount="%d+%d"|math:$amort_amount:$amort_link.amount}} + {{/if}} {{else}} - {{:assign autres_amortissements=true}} + {{* pas de ligne d'immo liée à cette ligne d'amort => garder cette ligne d'amortissement *}} {{/load}} + {{if $keep_amort && $amort_amount < $amort.amort_amount}} + {{:assign var="free_amort_lines." value=$amort}} + {{/if}} {{/select}} {{/if}} @@ -144,7 +157,7 @@ subcurrent="%s"|args:$subcurrent subsubcurrent="amortization" type_immo=$_GET.type_immo - autres_amort=$autres_amortissements + autres_amort=$free_amort_lines }} {{if $_GET.ok}} @@ -263,7 +276,7 @@ Aucun amortissement enregistré pour cette immobilisation {{/if}} -{{if $autres_amortissements}} +{{if $free_amort_lines}} Il y a des écritures d'amortissement qui ne sont pas rattachées à une immobilisation ! Utilisez le bouton « Rattacher un amortissement » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation. diff --git a/index.html b/index.html index ed61086..356f42c 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,7 @@ {{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 de constitution" custom_css="./style.css" current="module_amortization"}} + {{:admin_header title="Immobilisations en cours de constitution" custom_css="./style.css" current="module_amortization" subcurrent="unfinished"}} {{/if}} {{:include file="_nav.html" current="index" subcurrent="%s"|args:$type_immo}} @@ -24,6 +24,8 @@ {{if $_GET.ok}} {{if $_GET.msg|match:"immobilisation"}} {{:assign msg="Immobilisation enregistrée"}} + {{elseif $_GET.msg|match:"suppr_infos"}} + {{:assign msg="Informations supprimées"}} {{elseif $_GET.msg|match:"infos"}} {{:assign msg="Informations enregistrées"}} {{/if}} @@ -45,6 +47,9 @@ {{/select}} {{/load}} +{{* chercher des immos antérieures à la date de début du 1er exercice *}} +{{*:include file="_old_assets.html"*}} + {{if $type_immo == "other"}} {{:include file="_immobilisations_autres.html"}} {{elseif $type_immo == "archived"}} diff --git a/other_amortizations.html b/other_amortizations.html index 5163e78..e185d27 100644 --- a/other_amortizations.html +++ b/other_amortizations.html @@ -145,6 +145,8 @@ +{{else}} + Aucun amortissement à rattacher {{/if}} {{:form_errors}} {{:admin_footer}}
Aucun amortissement enregistré pour cette immobilisation
Il y a des écritures d'amortissement qui ne sont pas rattachées à une immobilisation ! Utilisez le bouton « Rattacher un amortissement » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation. diff --git a/index.html b/index.html index ed61086..356f42c 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,7 @@ {{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 de constitution" custom_css="./style.css" current="module_amortization"}} + {{:admin_header title="Immobilisations en cours de constitution" custom_css="./style.css" current="module_amortization" subcurrent="unfinished"}} {{/if}} {{:include file="_nav.html" current="index" subcurrent="%s"|args:$type_immo}} @@ -24,6 +24,8 @@ {{if $_GET.ok}} {{if $_GET.msg|match:"immobilisation"}} {{:assign msg="Immobilisation enregistrée"}} + {{elseif $_GET.msg|match:"suppr_infos"}} + {{:assign msg="Informations supprimées"}} {{elseif $_GET.msg|match:"infos"}} {{:assign msg="Informations enregistrées"}} {{/if}} @@ -45,6 +47,9 @@ {{/select}} {{/load}} +{{* chercher des immos antérieures à la date de début du 1er exercice *}} +{{*:include file="_old_assets.html"*}} + {{if $type_immo == "other"}} {{:include file="_immobilisations_autres.html"}} {{elseif $type_immo == "archived"}} diff --git a/other_amortizations.html b/other_amortizations.html index 5163e78..e185d27 100644 --- a/other_amortizations.html +++ b/other_amortizations.html @@ -145,6 +145,8 @@ +{{else}} +
Aucun amortissement à rattacher