Compare commits
5 commits
simplifica
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb4bbaf697 | ||
|
|
a9b061f795 | ||
|
|
96c9e32def | ||
|
|
d54887a18d | ||
|
|
579ae55434 |
12 changed files with 57 additions and 13 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
{{if $subcurrent == null}}
|
{{if $subcurrent == null}}
|
||||||
{{if $current == "managed" || $current == "amortized" || $current == "archived"}}
|
{{if $current == "managed" || $current == "amortized" || $current == "archived"}}
|
||||||
<aside>
|
<aside>
|
||||||
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html"}}
|
{{:linkbutton label="Ajouter une immobilisation" shape="plus" href="add_asset.html?from=%s"|args:$current}}
|
||||||
</aside>
|
</aside>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
{{:assign line_id=$type|cat:"_line_id"}}
|
{{:assign line_id=$type|cat:"_line_id"}}
|
||||||
{{#load type=$link_type assign="link"}}
|
{{#load type=$link_type assign="link"}}
|
||||||
{{:assign new_link=null}}
|
{{:assign new_link=null}}
|
||||||
{{:assign var="new_link.key value=$link.key}}
|
{{:assign var="new_link.key" value=$link.key}}
|
||||||
{{:assign var="new_link.type" value=$link.type}}
|
{{:assign var="new_link.type" value=$link.type}}
|
||||||
{{:assign var="new_link.immo_doc_id" value=$link.immo_doc_id}}
|
{{:assign var="new_link.immo_doc_id" value=$link.immo_doc_id}}
|
||||||
{{:assign var="new_link.line_id" from="link.%s"|args:$line_id}}
|
{{:assign var="new_link.line_id" from="link.%s"|args:$line_id}}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,12 @@
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="add"}}
|
{{#form on="add"}}
|
||||||
{{* vérifier que la date d'achat est située dans un l'exercice sélectionné *}}
|
{{* vérifier que la date d'achat est située dans un l'exercice sélectionné *}}
|
||||||
|
{{if $_POST.date_achat|parse_date === false}}
|
||||||
|
{{:error message="Erreur : la date d'achat (%s) est invalide"|args:$_POST.date_achat}}
|
||||||
|
{{/if}}
|
||||||
|
{{if $_POST.date_mes|parse_date === false}}
|
||||||
|
{{:error message="Erreur : la date de mise en service (%s) est invalide"|args:$_POST.date_mes}}
|
||||||
|
{{/if}}
|
||||||
{{:assign ts_date = $_POST.date_achat|parse_date|strtotime}}
|
{{:assign ts_date = $_POST.date_achat|parse_date|strtotime}}
|
||||||
{{:assign ok=false}}
|
{{:assign ok=false}}
|
||||||
{{#foreach from=$years}}
|
{{#foreach from=$years}}
|
||||||
|
|
@ -93,7 +99,12 @@
|
||||||
{{:assign da=$_POST.date_achat|date_short}}
|
{{:assign da=$_POST.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}}
|
{{:error message="Erreur : la date de mise en service (%s) ne peut être antérieure à la date d'acquisition (%s)"|args:$dd:$da}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:assign duration=$_POST.duree|intval}}
|
{{:assign duration=$_POST.duree|intval}}
|
||||||
|
{{if $duration <= 0}}
|
||||||
|
{{:error message="Erreur : la durée d'amortissement doit être strictement positive"}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{:assign status="managed"}}
|
{{:assign status="managed"}}
|
||||||
{{if $_POST.date_mes == null || $_POST.date_mes == $_POST.date_achat}}
|
{{if $_POST.date_mes == null || $_POST.date_mes == $_POST.date_achat}}
|
||||||
{{:assign date_mes=null}}
|
{{:assign date_mes=null}}
|
||||||
|
|
@ -151,7 +162,7 @@
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{if ! $dialog}}
|
{{if ! $dialog}}
|
||||||
{{:linkbutton href="index.html" label="Retour" shape="left"}}
|
{{:linkbutton href="index.html?type_immo=%s"|args:$_GET.from label="Retour" shape="left"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,12 @@
|
||||||
{{:redirect force="exit_step1.html?immo_doc_id=%s&from=exit"|args:$immo_doc_id}}
|
{{:redirect force="exit_step1.html?immo_doc_id=%s&from=exit"|args:$immo_doc_id}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{* immobilisation amortissable *}}
|
{{* immobilisation amortissable *}}
|
||||||
|
{{if $_POST.date_achat|parse_date === false}}
|
||||||
|
{{:error message="Erreur : la date d'achat (%s) est invalide"|args:$_POST.date_achat}}
|
||||||
|
{{/if}}
|
||||||
|
{{if $_POST.date_mes|parse_date === false}}
|
||||||
|
{{:error message="Erreur : la date de mise en service (%s) est invalide"|args:$_POST.date_mes}}
|
||||||
|
{{/if}}
|
||||||
{{if $_POST.date_achat|parse_date > $ligne_immo.date_achat}}
|
{{if $_POST.date_achat|parse_date > $ligne_immo.date_achat}}
|
||||||
{{:assign da=$ligne_immo.date_achat|date_short}}
|
{{:assign da=$ligne_immo.date_achat|date_short}}
|
||||||
{{:error message="Erreur : la date d'achat (%s) ne peut être postérieure à la date de l'écriture d'immobilisation (%s)"|args:$_POST.date_achat:$da}}
|
{{:error message="Erreur : la date d'achat (%s) ne peut être postérieure à la date de l'écriture d'immobilisation (%s)"|args:$_POST.date_achat:$da}}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="save"}}
|
{{#form on="save"}}
|
||||||
|
|
||||||
{{if $_POST.montant == null}}
|
{{if $_POST.montant == null || $_POST.montant == 0}}
|
||||||
{{if $montant_affecte == 0}}
|
{{if $montant_affecte == 0}}
|
||||||
{{:assign saved_credit=null}}
|
{{:assign saved_credit=null}}
|
||||||
{{:assign montant_credit=$credit_line.amount}}
|
{{:assign montant_credit=$credit_line.amount}}
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,6 @@
|
||||||
{{:assign amort_number=$linked_amort|count}}
|
{{:assign amort_number=$linked_amort|count}}
|
||||||
|
|
||||||
{{#foreach from=$linked_amort|ksort item="line"}}
|
{{#foreach from=$linked_amort|ksort item="line"}}
|
||||||
{{if $first_amort_date == null}}
|
|
||||||
{{:assign first_amort_date=$line.date}}
|
|
||||||
{{/if}}
|
|
||||||
{{if $last_amort_date == null}}
|
{{if $last_amort_date == null}}
|
||||||
{{:assign last_amort_date=$line.date}}
|
{{:assign last_amort_date=$line.date}}
|
||||||
{{elseif $line.date > $last_amort_date}}
|
{{elseif $line.date > $last_amort_date}}
|
||||||
|
|
@ -82,11 +79,15 @@
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="proceed"}}
|
{{#form on="proceed"}}
|
||||||
|
|
||||||
|
{{* vérifier la validité de la date de sortie *}}
|
||||||
{{if $_POST.date_sortie == null}}
|
{{if $_POST.date_sortie == null}}
|
||||||
{{:error message="Vous devez renseigner la date de sortie"}}
|
{{:error message="Vous devez renseigner la date de sortie"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* vérifier la validité de la date de sortie *}}
|
{{if $_POST.date_sortie|parse_date === false}}
|
||||||
|
{{:error message="Erreur : la date de sortie (%s) est invalide"|args:$_POST.date_sortie}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{if $info_immo.date_mes != null}}
|
{{if $info_immo.date_mes != null}}
|
||||||
{{if $_POST.date_sortie|parse_date < $info_immo.date_mes}}
|
{{if $_POST.date_sortie|parse_date < $info_immo.date_mes}}
|
||||||
{{:assign immo_date=$info_immo.date_mes|date_short}}
|
{{:assign immo_date=$info_immo.date_mes|date_short}}
|
||||||
|
|
@ -96,6 +97,7 @@
|
||||||
{{:assign immo_date=$ligne_immo.date_achat|date_short}}
|
{{:assign immo_date=$ligne_immo.date_achat|date_short}}
|
||||||
{{:error message="La date de sortie doit être postérieure à la date d'acquisition de l'immobilisation (%s)"|args:$immo_date}}
|
{{:error message="La date de sortie doit être postérieure à la date d'acquisition de l'immobilisation (%s)"|args:$immo_date}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $amort_number != 0 && $_POST.date_sortie|parse_date <= $last_amort_date}}
|
{{if $amort_number != 0 && $_POST.date_sortie|parse_date <= $last_amort_date}}
|
||||||
{{:assign last_amort_date=$last_amort_date|date_short}}
|
{{:assign last_amort_date=$last_amort_date|date_short}}
|
||||||
{{:error message="La date de sortie doit être postérieure à la date du dernier amortissement (%s)"|args:$last_amort_date}}
|
{{:error message="La date de sortie doit être postérieure à la date du dernier amortissement (%s)"|args:$last_amort_date}}
|
||||||
|
|
@ -103,6 +105,7 @@
|
||||||
|
|
||||||
{{:assign ts_exit = $_POST.date_sortie|parse_date|strtotime}}
|
{{:assign ts_exit = $_POST.date_sortie|parse_date|strtotime}}
|
||||||
{{:assign exercice_ok=false}}
|
{{:assign exercice_ok=false}}
|
||||||
|
|
||||||
{{* vérifier que la date de sortie est dans l'exercice choisi *}}
|
{{* vérifier que la date de sortie est dans l'exercice choisi *}}
|
||||||
{{#foreach from=$years item="current_year"}}
|
{{#foreach from=$years item="current_year"}}
|
||||||
{{if $current_year.id == $_POST.id_year}}
|
{{if $current_year.id == $_POST.id_year}}
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,7 @@
|
||||||
{{:assign type_immo=$_GET.type_immo}}
|
{{:assign type_immo=$_GET.type_immo}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $type_immo == "managed"}}
|
{{if $type_immo == "amortized"}}
|
||||||
{{: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"}}
|
{{:admin_header title="Immobilisations amorties" custom_css="./style.css" current="module_amortization"}}
|
||||||
{{elseif $type_immo == "archived"}}
|
{{elseif $type_immo == "archived"}}
|
||||||
{{:admin_header title="Immobilisations archivées" custom_css="./style.css" current="module_amortization"}}
|
{{:admin_header title="Immobilisations archivées" custom_css="./style.css" current="module_amortization"}}
|
||||||
|
|
@ -17,6 +15,9 @@
|
||||||
{{:admin_header title="Immobilisations à classer" custom_css="./style.css" current="module_amortization"}}
|
{{:admin_header title="Immobilisations à classer" custom_css="./style.css" current="module_amortization"}}
|
||||||
{{elseif $type_immo == "unfinished"}}
|
{{elseif $type_immo == "unfinished"}}
|
||||||
{{:admin_header title="Immobilisations en cours de constitution" custom_css="./style.css" current="module_amortization" subcurrent="unfinished"}}
|
{{:admin_header title="Immobilisations en cours de constitution" custom_css="./style.css" current="module_amortization" subcurrent="unfinished"}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign type_immo="managed"}}
|
||||||
|
{{:admin_header title="Immobilisations en cours d'amortissement" custom_css="./style.css" current="module_amortization"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:include file="_nav.html" current=$type_immo}}
|
{{:include file="_nav.html" current=$type_immo}}
|
||||||
|
|
||||||
|
|
@ -46,7 +47,7 @@
|
||||||
{{:include file="_archives.html"}}
|
{{:include file="_archives.html"}}
|
||||||
{{elseif $type_immo == "unfinished"}}
|
{{elseif $type_immo == "unfinished"}}
|
||||||
{{:include file="_unfinished.html"}}
|
{{:include file="_unfinished.html"}}
|
||||||
{{elseif $type_immo == "managed" || $type_immo == "amortized"}}
|
{{else}}
|
||||||
{{:include file="_immobilisations.html"}}
|
{{:include file="_immobilisations.html"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,18 @@
|
||||||
|
|
||||||
{{* traiter la saisie *}}
|
{{* traiter la saisie *}}
|
||||||
{{#form on="save"}}
|
{{#form on="save"}}
|
||||||
|
{{if $_POST.date_achat == null || $_POST.date_achat|parse_date == $ligne_immo.date_achat}}
|
||||||
|
{{:assign date_achat=null}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign date_achat=$_POST.date_achat|parse_date}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{if $_POST.date_mes == null || $_POST.date_mes == $_POST.date_achat}}
|
||||||
|
{{:assign date_mes=null}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign date_mes=$_POST.date_mes|parse_date}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{if $_POST.date_achat|parse_date > $ligne_immo.date_achat}}
|
{{if $_POST.date_achat|parse_date > $ligne_immo.date_achat}}
|
||||||
{{:assign da=$ligne_immo.date_achat|date_short}}
|
{{:assign da=$ligne_immo.date_achat|date_short}}
|
||||||
{{:error message="Erreur : la date d'achat (%s) ne peut être postérieure à la date de l'écriture d'immobilisation (%s)"|args:$_POST.date_achat:$da}}
|
{{:error message="Erreur : la date d'achat (%s) ne peut être postérieure à la date de l'écriture d'immobilisation (%s)"|args:$_POST.date_achat:$da}}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
name="Amortissements"
|
name="Amortissements"
|
||||||
description="Immobilisations et amortissements\nversion 0.42"
|
description="Immobilisations et amortissements\nversion 0.42.2"
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,9 @@
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="save"}}
|
{{#form on="save"}}
|
||||||
{{* vérifier que la date est située dans un exercice compatible *}}
|
{{* vérifier que la date est située dans un exercice compatible *}}
|
||||||
|
{{if $_POST.date_amort|parse_date === false}}
|
||||||
|
{{:error message="Erreur : la date d'amortissement (%s) est invalide"|args:$_POST.date_amort}}
|
||||||
|
{{/if}}
|
||||||
{{:assign ts_date = $_POST.date_amort|parse_date|strtotime}}
|
{{:assign ts_date = $_POST.date_amort|parse_date|strtotime}}
|
||||||
{{:assign ok=false}}
|
{{:assign ok=false}}
|
||||||
{{#foreach from=$years}}
|
{{#foreach from=$years}}
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,9 @@
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="transfer"}}
|
{{#form on="transfer"}}
|
||||||
{{* vérifier que la date de mise en service est postérieure aux dates d'acquisition *}}
|
{{* vérifier que la date de mise en service est postérieure aux dates d'acquisition *}}
|
||||||
|
{{if $_POST.date_mes|parse_date === false}}
|
||||||
|
{{:error message="Erreur : la date de mise en service (%s) est invalide"|args:$_POST.date_mes}}
|
||||||
|
{{/if}}
|
||||||
{{if $_POST.date_mes|parse_date < $max_date}}
|
{{if $_POST.date_mes|parse_date < $max_date}}
|
||||||
{{:assign dacq=$max_date|date_short}}
|
{{:assign dacq=$max_date|date_short}}
|
||||||
{{:error message="La date de mise en service (%s) doit être postérieure à la date d'acquisition d'immobilisation la plus récente (%s) !"|args:$_POST.date_mes:$dacq}}
|
{{:error message="La date de mise en service (%s) doit être postérieure à la date d'acquisition d'immobilisation la plus récente (%s) !"|args:$_POST.date_mes:$dacq}}
|
||||||
|
|
@ -96,6 +99,9 @@
|
||||||
{{:assign status="ignored"}}
|
{{:assign status="ignored"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign duration=$_POST.duree|intval}}
|
{{:assign duration=$_POST.duree|intval}}
|
||||||
|
{{if $duration <= 0}}
|
||||||
|
{{:error message="Erreur : la durée d'amortissement doit être strictement positive"}}
|
||||||
|
{{/if}}
|
||||||
{{:assign status="managed"}}
|
{{:assign status="managed"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -320,6 +320,8 @@
|
||||||
:year_id = $_GET.year
|
:year_id = $_GET.year
|
||||||
}}
|
}}
|
||||||
{{:assign chart_id=$id}}
|
{{:assign chart_id=$id}}
|
||||||
|
{{else}}
|
||||||
|
{{:error message="Pas de plan comptable pour l'exercice %s"|args:$_GET.year}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue