Compare commits
No commits in common. "003af639ea40d085f8f550801a443763b50607d3" and "7903afbd0cabd92b8b08ae1fd84b3ba093cdbee6" have entirely different histories.
003af639ea
...
7903afbd0c
9 changed files with 24 additions and 47 deletions
|
|
@ -4,14 +4,15 @@ Ce module permet de gérer les écritures d'amortissements pour les immobilisati
|
|||
|
||||
- lister les immobilisations
|
||||
- ajouter une nouvelle immobilisation
|
||||
- lister les amortissements d'une immobilisation
|
||||
- lister les amortissements d'une immobilisation :
|
||||
- amortissements déjà enregistrés
|
||||
- amortissements à venir
|
||||
- associer une écriture d'amortissement à une immobilisation
|
||||
- enregistrer un nouvel amortissement
|
||||
- incorporer d'anciennes immobilisations et leurs amortisements
|
||||
|
||||
## Installation
|
||||
- télécharger [l'archive zip](https://link.infini.fr/amortissement)
|
||||
- cliquer « Configuration » puis « Extensions »
|
||||
- en bas de la page, cliquer « Importer un module »
|
||||
- sélectionner l'archive téléchargée ci-dessus
|
||||
- activer le module
|
||||
|
||||
- activer le module qui est maintenant présent dans la liste des extensions inactives
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@
|
|||
<td><a href="{{$compte_url}}">{{$account_code}}</a></td>
|
||||
<td>{{$account_label}}</td>
|
||||
<td class="actions">
|
||||
{{:linkbutton label="Modifier" href="exit_step1.html?immo_doc_id=%s"|args:$info_immo.id shape="edit"}}
|
||||
{{:linkbutton label="Modifier" href="exit_step4.html?immo_doc_id=%s"|args:$info_immo.id shape="edit"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/select}}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{*
|
||||
Supprimer l'association entre une ligne d'immo et une autre ligne (amort, credit, cession, sortie)
|
||||
Supprimer l'association entre deux lignes
|
||||
@param immo_doc_id : id du doc associé à la ligne d'immobilisation
|
||||
@param line_id : id de la ligne à détacher
|
||||
*}}
|
||||
|
||||
{{* données de l'immobilisation *}}
|
||||
{{:include file="_get_immo_data.html" immo_doc_id=$immo_doc_id|intval keep="ligne_immo, message"}}
|
||||
{{if $message != null}}
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@
|
|||
{{:admin_header title="Détails de l'immobilisation" custom_css="./style.css" current="module_amortization"}}
|
||||
|
||||
{{* barre de navigation *}}
|
||||
{{if $_GET.type_immo == "amortized" && $valeur_residuelle == 0}}
|
||||
{{if $_GET.type_immo == "amortized" || $valeur_residuelle == 0 }}
|
||||
{{:assign current="amortized"}}
|
||||
{{elseif $_GET.type_immo == "archived"}}
|
||||
{{:assign current="archived"}}
|
||||
{{elseif $_GET.type_immo == null || $_GET.type_immo == "managed" || $valeur_residuelle > 0}}
|
||||
{{elseif $_GET.type_immo == null || $_GET.type_immo == "managed"}}
|
||||
{{:assign current="managed"}}
|
||||
{{else}}
|
||||
{{:assign current="other"}}
|
||||
|
|
@ -150,7 +150,7 @@
|
|||
|
||||
<h3 class="ruler">Avoirs</h3>
|
||||
<nav class="actions">
|
||||
{{if $total_amort == 0 || ! $created_amort}}
|
||||
{{if $total_amort == 0}}
|
||||
{{:linkbutton label="Attacher une écriture d'avoir" href="link_immo.html?immo_doc_id=%s"|args:$_GET.immo_doc_id shape="link" target="_dialog"}}
|
||||
{{/if}}
|
||||
</nav>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
- line.credit < ligne_immo.amount => peut-être un avoir
|
||||
- line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan
|
||||
*}}
|
||||
{{:assign account_code=$ligne_immo.account_code|cat:"%"}}
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
trans.label as trans_label,
|
||||
|
|
@ -41,15 +40,15 @@
|
|||
line.id as credit_line_id,
|
||||
line.label as line_label,
|
||||
line.credit as amount,
|
||||
account.id as account_id,
|
||||
account.code as account_code,
|
||||
account.label as account_label
|
||||
acc.id as account_id,
|
||||
acc.code as account_code,
|
||||
acc.label as account_label
|
||||
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_accounts AS acc ON line.id_account = acc.id
|
||||
LEFT JOIN module_data_amortization AS mda ON json_extract(mda.document, '$.amort_line_id') = line.id
|
||||
WHERE
|
||||
account.code LIKE :account_code
|
||||
acc.code = :acc_code
|
||||
AND line.credit > 0
|
||||
AND credit_line_id NOT IN (
|
||||
SELECT json_extract(credit_link.document, '$.credit_line_id') AS line_id FROM !table as credit_link
|
||||
|
|
@ -59,7 +58,7 @@
|
|||
WHERE json_extract(exit_link.document, '$.type') == "exit_link"
|
||||
)
|
||||
;
|
||||
:account_code=$account_code
|
||||
:acc_code=$ligne_immo.account_code
|
||||
!table =$module.table
|
||||
assign="credit_line"
|
||||
}}
|
||||
|
|
@ -76,6 +75,7 @@
|
|||
}}
|
||||
|
||||
{{* chercher des écritures d'amortissement correspondant au compte d'une immo sans doc associé *}}
|
||||
{{* TODO écritures d'amort pas entièrement affectées *}}
|
||||
{{#select
|
||||
line.id as amort_line_id,
|
||||
line.credit as amort_amount,
|
||||
|
|
@ -105,7 +105,7 @@
|
|||
{{:assign keep_amort=true}}
|
||||
{{#load type="amort_link"
|
||||
where="$$.amort_line_id = :amort_line_id"
|
||||
:amort_line_id=$amort_line.amort_line_id
|
||||
:amort_line_id=$amort_line.amort_line_id|intval
|
||||
assign="amort_link"
|
||||
}}
|
||||
{{if $amort_link.amount == null || $amort_link.amount == 0}}
|
||||
|
|
@ -123,7 +123,6 @@
|
|||
{{/select}}
|
||||
|
||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||
{{:include file="_nav.html" current="archived" subcurrent="exit"}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg|match:"attach_avoir"}}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
}}
|
||||
|
||||
{{* chercher des écritures d'amortissement correspondant au compte d'une immo sans doc associé *}}
|
||||
{{* TODO écritures d'amort pas entièrement affectées *}}
|
||||
{{#select
|
||||
line.id as amort_line_id,
|
||||
line.credit as amort_amount,
|
||||
|
|
@ -90,7 +91,6 @@
|
|||
{{/select}}
|
||||
|
||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||
{{:include file="_nav.html" current="archived" subcurrent="exit"}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg|match:"attach_amort"}}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||
{{*
|
||||
Associer une écriture de cession à une immo créée et sortie du
|
||||
bilan avant la mise en service du module
|
||||
|
|
@ -58,21 +59,6 @@
|
|||
assign="line"
|
||||
}}
|
||||
{{* voir si l'écriture de cession est déjà liée à une immo *}}
|
||||
{{* TODO VOIR SI TUTILE
|
||||
{{#load type="cession_link"
|
||||
where="$$.cession_line_id = :cession_line_id"
|
||||
:cession_line_id = $line.line_id
|
||||
assign="cession_link"
|
||||
}}
|
||||
{{:debug line=$line cession_link=$cession_link}}
|
||||
{{:assign total_cession="%d+%d"|math:$total_cession:$line.amount}}
|
||||
{{:assign var="line.linked_id" value=$linked_id}}
|
||||
{{:assign var="linked_cessions." value=$line}}
|
||||
{{else}}
|
||||
{{:assign var="free_cessions." value=$line}}
|
||||
{{/load}}
|
||||
*}}
|
||||
|
||||
{{#select
|
||||
CASE WHEN links.id_related = :trans_id
|
||||
THEN links.id_transaction
|
||||
|
|
@ -94,9 +80,6 @@
|
|||
{{/select}}
|
||||
{{*:debug linked_cessions=$linked_cessions free_cessions=$free_cessions total_cession=$total_cession*}}
|
||||
|
||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||
{{:include file="_nav.html" current="archived" subcurrent="exit"}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg|match:"attach_cession"}}
|
||||
{{:assign msg="Écriture de cession attachée"}}
|
||||
|
|
|
|||
|
|
@ -164,7 +164,6 @@
|
|||
{{/select}}
|
||||
|
||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||
{{:include file="_nav.html" current="archived" subcurrent="exit"}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg|match:"attach_exit"}}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
{{*
|
||||
lister les écritures au crédit du compte de l'immobilisation
|
||||
*}}
|
||||
{{:assign account_code=$ligne_immo.account_code|cat:"%"}}
|
||||
{{#select
|
||||
line.id as credit_line_id,
|
||||
line.id_transaction as credit_trans_id,
|
||||
|
|
@ -35,15 +34,12 @@
|
|||
INNER JOIN acc_transactions AS trans ON trans.id = line.id_transaction
|
||||
INNER JOIN acc_accounts AS account ON account.id = line.id_account
|
||||
INNER JOIN acc_years AS y ON y.id = trans.id_year
|
||||
WHERE account.code LIKE :account_code AND credit > 0
|
||||
WHERE account.code = :account_code AND credit > 0
|
||||
AND credit_line_id NOT IN (
|
||||
SELECT json_extract(link.document, '$.credit_line_id') AS credit_line_id FROM !table as link
|
||||
WHERE json_extract(link.document, '$.type') == "credit_link"
|
||||
UNION
|
||||
SELECT json_extract(exit_link.document, '$.exit_line_id') AS line_id FROM !table as exit_link
|
||||
WHERE json_extract(exit_link.document, '$.type') == "exit_link")
|
||||
WHERE json_extract(link.document, '$.type') == "credit_link")
|
||||
ORDER BY trans.date, trans.label;
|
||||
:account_code = $account_code
|
||||
:account_code = $ligne_immo.account_code
|
||||
!table =$module.table
|
||||
assign="other_immos."
|
||||
}}
|
||||
|
|
@ -64,7 +60,7 @@
|
|||
<section class="immobilisation">
|
||||
<fieldset>
|
||||
<legend>
|
||||
Écritures au crédit du compte d'immobilisation « {{$ligne_immo.account_code}} » et sous-comptes
|
||||
Écritures au crédit du compte d'immobilisation « {{$ligne_immo.account_code}} »
|
||||
</legend>
|
||||
|
||||
<div class="informations">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue