diff --git a/_archives.html b/_archives.html index be33053..8a8f8ad 100644 --- a/_archives.html +++ b/_archives.html @@ -34,7 +34,6 @@
Aucun amortissement enregistré pour cette immobilisation
{{/if}} {{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.
+ Il y a des écritures d'amortissement qui ne sont pas attachées à une immobilisation !
+ Utilisez le bouton « Attacher un amortissement » pour les afficher ; vous pourrez choisir d'en attacher certaines à cette immobilisation.
Aucun amortissement enregistré pour cette immobilisation ; utilisez le bouton « Enregistrer un amortissement » pour enregistrer un nouvel amortissement
+{{/if}} {{:form_errors}} {{:admin_footer}} diff --git a/attach_amort.html b/attach_amort.html index 755ff70..adf9e5c 100644 --- a/attach_amort.html +++ b/attach_amort.html @@ -144,9 +144,9 @@ {{/if}} {{if $_GET.from == "exit"}} - {{:redirect to="exit_step2.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}} + {{:redirect force="exit_step2.html?immo_doc_id=%s&ok=1&msg=attach_amort"|args:$_GET.immo_doc_id}} {{else}} - {{:redirect to="amortization.html?immo_doc_id=%s&type_immo=%s&ok=1&msg=attach_amort"|args:$_GET.immo_doc_id:$status}} + {{:redirect force="amortization.html?immo_doc_id=%s&type_immo=%s&ok=1&msg=attach_amort"|args:$_GET.immo_doc_id:$status}} {{/if}} {{/form}} diff --git a/attach_credit.html b/attach_credit.html index 7cd7b16..5028718 100644 --- a/attach_credit.html +++ b/attach_credit.html @@ -125,11 +125,11 @@ {{/if}} {{if $_GET.from == "exit"}} - {{:redirect force="exit_step1.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}} + {{:redirect force="exit_step1.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id}} {{else}} - {{:redirect to="amortization.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id}} + {{:redirect force="details_immo.html?immo_doc_id=%s&ok=1&msg=attach_credit"|args:$_GET.immo_doc_id}} + {{*:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id*}} {{/if}} -{{*:redirect to="details_immo.html?immo_doc_id=%s&ok=1&msg=attach_credit"|args:$_GET.immo_doc_id*}} {{/form}} {{:admin_header title="Écritures au crédit du compte d'immobilisation" custom_css="./style.css" current="module_amortization"}} diff --git a/delete_infos.html b/delete_infos.html index 6ec1875..8af819c 100644 --- a/delete_infos.html +++ b/delete_infos.html @@ -20,10 +20,9 @@ {{#select trans.id FROM acc_transactions_lines AS line - INNER JOIN !table ON $$.credit_line_id = line.id + INNER JOIN !table AS credit_link ON $$.credit_line_id = line.id INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id - WHERE $$.type = - "credit_link" AND $$.immo_doc_id = :immo_doc_id + WHERE $$.type = "credit_link" AND $$.immo_doc_id = :immo_doc_id ; !table = $module.table :immo_doc_id = $_GET.immo_doc_id|intval @@ -60,8 +59,7 @@ }} {{* supprimer les docs de liaison *}} - {{:delete type="immo_link" where="$$.immo_doc_id = :immo_doc_id" :immo_doc_id = $_GET.immo_doc_id|intval}} - + {{:delete type="credit_link" where="$$.immo_doc_id = :immo_doc_id" :immo_doc_id = $_GET.immo_doc_id|intval}} {{/if}} {{* supprimer les infos de l'immobilisation *}} diff --git a/detach_amort.html b/detach_amort.html index 14be3bc..eba97ee 100644 --- a/detach_amort.html +++ b/detach_amort.html @@ -26,7 +26,7 @@ }} {{if $_GET.from == "exit"}} - {{:redirect to="exit_step2.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}} + {{:redirect force="exit_step2.html?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_GET.immo_doc_id}} {{else}} - {{:redirect to="amortization.html?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_GET.immo_doc_id:}} + {{:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_GET.immo_doc_id:}} {{/if}} diff --git a/detach_credit.html b/detach_credit.html index fb13fcc..1abc8d9 100644 --- a/detach_credit.html +++ b/detach_credit.html @@ -25,8 +25,8 @@ }} {{if $_GET.from == "exit"}} - {{:redirect to="exit_step1.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}} + {{:redirect force="exit_step1.html?immo_doc_id=%s&ok=1&msg=detach_avoir"|args:$_GET.immo_doc_id}} {{else}} - {{:redirect to="amortization.html?immo_doc_id=%s&ok=1&msg=detach_avoir&"|args:$_GET.immo_doc_id}} + {{:redirect force="details_immo.html?immo_doc_id=%s&ok=1&msg=detach&"|args:$_GET.immo_doc_id}} + {{*:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=detach_avoir"|args:$_GET.immo_doc_id*}} {{/if}} -{{*:redirect to="details_immo.html?immo_doc_id=%s&ok=1&msg=detach&"|args:$_GET.immo_doc_id*}} diff --git a/details_immo.html b/details_immo.html index 0896717..ca3d93b 100644 --- a/details_immo.html +++ b/details_immo.html @@ -31,25 +31,19 @@ {{:admin_header title="Détails de l'immobilisation" custom_css="./style.css" current="module_amortization"}} -{{* {{if ! $dialog}} {{:assign subsubcurrent=null}} - {{if $total_credits == 0 && $total_amort == 0}} - {{:assign subsubcurrent="credit"}} - {{/if}} {{if $total_amort == 0}} - {{:assign subsubcurrent=$subsubcurrent|cat:"-modif"}} + {{:assign subsubcurrent="credit"}} {{/if}} {{:include file="_nav.html" current="index" subcurrent="details" subsubcurrent=$subsubcurrent}} {{/if}} -*}} {{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$ligne_immo.trans_id}} +{{* +*}} {{if $_GET.ok}} {{if $_GET.msg|match:"attach_amort"}} @@ -96,7 +91,9 @@{{$msg}}
+{{/if}} +| N° | Date | Libellé | Montant | +N° compte | +Compte | {{#foreach from=$linked_immos item="line"}} {{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}} + {{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}} |
| #{{$line.trans_id}} | {{$line.date|date_short}} | {{$line.label}} | {{"%f"|math:$line.amount|money_currency_html:false|raw}} | +{{$line.account_code}} | +{{$line.account_label}} | {{:linkbutton label="Détacher" href="detach_credit.html?immo_doc_id=%s&credit_line_id=%s&from=exit"|args:$_GET.immo_doc_id:$line.credit_line_id shape="minus"}} | @@ -173,10 +186,14 @@ {{/foreach}}
Vous pouvez attacher une ou plusieurs écritures d'avoir à votre immobilisation
+{{else}} ++ Aucune écriture au crédit du compte d'immobilisation ; vous pouvez passer à la suite +
{{/if}} {{if $credit_lines}} diff --git a/exit_step2.html b/exit_step2.html index 72deafe..699b947 100644 --- a/exit_step2.html +++ b/exit_step2.html @@ -1,18 +1,16 @@ {{* -*- brindille -*- *}} {{* - Associer les différentes écritures à une immo créée avant la mise - en service du module et sortie du bilan + Associer les différentes écritures à une immo créée et sortie du + bilan avant la mise en service du module @param immo_doc_id : id du doc associé à l'immobilisation *}} {{* données de l'immobilisation *}} -{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id keep="ligne_immo, message"}} +{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id keep="info_immo, ligne_immo, message"}} {{if $message != null}} {{:error message=$message}} {{/if}} -{{* voir si un document a été associé à l'immo *}} -{{#load id=$ligne_immo.line_id assign="info_immo"}}{{/load}} {{#form on="backward"}} {{:redirect to="exit_step1.html?immo_doc_id=%s"|args:$_GET.immo_doc_id}} @@ -37,44 +35,6 @@ {{* lister les amortissements liés à l'immobilisation *}} {{:include file="./_get_amort_lines.html" immo_doc_id=$_GET.immo_doc_id keep="linked_amort, total_amort"}} -{{* - chercher des écritures au crédit du compte de l'immo sans doc associé - - line.credit < ligne_immo.amount => peut-être un avoir - - line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan -*}} -{{#select - trans.id as trans_id, - trans.label as trans_label, - trans.date as date, - trans.id_year as year, - line.id as credit_line_id, - line.label as line_label, - line.credit as amount, - 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 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 - acc.code = :acc_code - AND line.credit > 0 - AND credit_line_id NOT IN ( - SELECT json_extract(link.document, '$.credit_line_id') AS line_id FROM !table as link - WHERE json_extract(link.document, '$.type') == "credit_link") - ; - :acc_code=$ligne_immo.account_code - !table =$module.table - assign="credit_line" - }} - {{if $credit_line.amount < $solde}} - {{:assign var="credit_lines." value=$credit_line}} - {{elseif $credit_line.amount == $solde}} - {{:assign var="exit_lines." value=$credit_line}} - {{/if}} -{{/select}} - {{* déterminer le compte d'amortissement en fonction du compte d'immobilisation *}} {{:include file="./_get_amort_code.html" @@ -132,6 +92,15 @@ {{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}} +{{if $_GET.ok}} + {{if $_GET.msg|match:"attach_amort"}} + {{:assign msg="Écriture d'amortissement attachée"}} + {{elseif $_GET.msg|match:"detach_amort"}} + {{:assign msg="Écriture d'amortissement détachée"}} + {{/if}} +{{$msg}}
+{{/if}} ++ Vous pouvez attacher une ou plusieurs écritures d'amortissement à l'immobilisation +
{{else}}- Vous pouvez attacher une ou plusieurs écritures d'amortissement à votre immobilisation + Aucune écriture d'amortissement à rattacher ; vous pouvez passer à la suite
{{/if}} -| #{{$line.amort_trans_id}} | {{$line.date|date_short}} | -{{$line.trans_label}} + | + {{if $line.line_label != null}} + {{$line.line_label}} + {{if $line.trans_label != $line.line_label}} + — {{$line.trans_label}} + {{/if}} + {{else}} + {{$line.trans_label}} + {{/if}} +{{* + {{$line.trans_label}} {{if $line.line_label != null && $line.line_label != $line.trans_label}} — {{$line.line_label}}{{/if}} +*}} | {{"%f"|math:$line.amort_amount|money_html:false|raw}} | {{$line.account_code}} | diff --git a/exit_step3.html b/exit_step3.html index 045cdc5..671b415 100644 --- a/exit_step3.html +++ b/exit_step3.html @@ -1,15 +1,11 @@ {{* -*- brindille -*- *}} {{* - Associer les différentes écritures à une immo créée avant la mise - en service du module et sortie du bilan + Associer les différentes écritures à une immo créée et sortie du + bilan avant la mise en service du module @param immo_doc_id : id du doc associé à l'immobilisation *}} -{{* - TODO : affichage après attachement écriture sortie bilan (ligne attachée, bouton détacher) -*}} - {{* données de l'immobilisation *}} {{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id keep="info_immo, ligne_immo, message"}} {{if $message != null}} @@ -29,6 +25,10 @@ {{:redirect to="index.html?type_immo=archived"}} {{/form}} +{{#form on="finish"}} + {{:redirect to="index.html?type_immo=managed"}} +{{/form}} + {{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}} {{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}} {{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}} @@ -68,11 +68,11 @@ {{/select}} {{/if}} -{{* chercher des écritures au crédit du compte de l'immo sans doc associé *}} {{* - - line.credit < ligne_immo.amount => peut-être un avoir - - line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan - *}} + chercher des écritures au crédit du compte de l'immo sans doc associé + - line.credit < ligne_immo.amount => peut-être un avoir + - line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan +*}} {{#select trans.id as trans_id, trans.label as trans_label, @@ -103,9 +103,7 @@ !table =$module.table assign="credit_line" }} - {{if $credit_line.amount < $solde}} - {{:assign var="credit_lines." value=$credit_line}} - {{elseif $credit_line.amount == $solde}} + {{if $credit_line.amount == $solde}} {{:assign var="exit_lines." value=$credit_line}} {{/if}} {{/select}} @@ -233,9 +231,9 @@
- Vous pouvez attacher une écriture de sortie du bilan à votre immobilisation + Vous pouvez attacher une écriture de sortie du bilan à l'immobilisation
{{/if}} @@ -275,14 +273,16 @@ {{elseif $exit_line == null}} -Aucune écriture de sortie du bilan
+Aucune écriture de sortie du bilan. Vérifiez l'attachement d'écriture d'avoir.
{{/if}} diff --git a/link_immo.html b/link_immo.html index a05eab1..77f5cd1 100644 --- a/link_immo.html +++ b/link_immo.html @@ -10,6 +10,10 @@ {{if $message != null}} {{:error message=$message}} {{/if}} +{{:assign label_immo=$ligne_immo.trans_label}} +{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}} + {{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}} +{{/if}} {{* lister les écritures au crédit du compte de l'immobilisation diff --git a/modify_infos.html b/modify_infos.html index 354b3f3..1b6d615 100644 --- a/modify_infos.html +++ b/modify_infos.html @@ -168,7 +168,7 @@ {{else}} {{:assign type_immo="other"}} {{/if}} - {{:redirect force="index.html?ok=1&msg=infos&type_immo=%s"|args:$type_immo}} + {{:redirect force="details_immo.html?immo_doc_id=%s&type_immo=%s&ok=1&msg=infos"|args:$_GET.immo_doc_id:$type_immo}} {{/form}} @@ -219,6 +219,7 @@ {{/if}} {{:input type="date" name="date_achat" label="Date d'acquisition" default=$info_immo.date_achat}} {{:input type="date" name="date_mes" label="Date de mise en service" default=$info_immo.date_mes}} +{{* {{if $linked_immos != null}}