diff --git a/_archives.html b/_archives.html index b5d2cc6..a4356d6 100644 --- a/_archives.html +++ b/_archives.html @@ -153,7 +153,7 @@ {{$account_code}} {{$account_label}} - {{:linkbutton label="Modifier" href="exit_step1.html?immo_doc_id=%s&from=exit"|args:$info_immo.id shape="edit"}} + {{:linkbutton label="Modifier" href="exit_step1.html?immo_doc_id=%s"|args:$info_immo.id shape="edit"}} {{/select}} diff --git a/_unfinished.html b/_unfinished.html index f67f188..edbd320 100644 --- a/_unfinished.html +++ b/_unfinished.html @@ -129,6 +129,7 @@ {{* TODO cas où : - il y a (au moins) une écriture d'avoir + - il y a une écriture qui solde l'immo (montant = montant immo - avoir *}} {{* voir s'il existe une écriture qui solde l'immobilisation (voir ci-dessus) *}} diff --git a/attach_amort.html b/attach_amort.html index c03821b..95767e2 100644 --- a/attach_amort.html +++ b/attach_amort.html @@ -130,7 +130,7 @@ {{/if}} {{if $_GET.from == "exit"}} - {{:redirect force="exit_step2.html?immo_doc_id=%s&from=exit&ok=1&msg=attach_amort"|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 force="amortization.html?immo_doc_id=%s&type_immo=%s&ok=1&msg=attach_amort"|args:$_GET.immo_doc_id:$status}} {{/if}} diff --git a/attach_cession.html b/attach_cession.html index bd78460..8ffe851 100644 --- a/attach_cession.html +++ b/attach_cession.html @@ -36,4 +36,4 @@ cession_line_id=$_GET.cession_line_id|intval }} -{{:redirect force="exit_step3.html?immo_doc_id=%s&from=exit&ok=1&msg=attach_cession"|args:$_GET.immo_doc_id}} +{{:redirect force="exit_step3.html?immo_doc_id=%s&ok=1&msg=attach_cession"|args:$_GET.immo_doc_id}} diff --git a/attach_credit.html b/attach_credit.html index 59cc802..e081434 100644 --- a/attach_credit.html +++ b/attach_credit.html @@ -93,6 +93,10 @@ {{* Lier l'écriture de crédit à l'écriture d'immobilisation *}} {{:include file="_common_attach.html" immo_doc_id=$_GET.immo_doc_id trans_id=$credit_line.trans_id}} + {{* + TODO ? vérifier le succès avant d'enregistrer le doc ? + *}} + {{* enregistrer la liaison des lignes d'immo *}} {{:save key=""|uuid @@ -103,7 +107,7 @@ }} {{if $_GET.from == "exit"}} - {{:redirect force="exit_step1.html?immo_doc_id=%s&from=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id:$_GET.from}} + {{:redirect force="exit_step1.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id}} {{else}} {{:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id}} {{/if}} diff --git a/attach_exit.html b/attach_exit.html index 36cf6bf..2dda568 100644 --- a/attach_exit.html +++ b/attach_exit.html @@ -36,4 +36,4 @@ exit_line_id=$_GET.exit_line_id|intval }} -{{:redirect to="exit_step4.html?immo_doc_id=%s&from=exit&ok=1&msg=attach_exit"|args:$_GET.immo_doc_id}} +{{:redirect to="exit_step4.html?immo_doc_id=%s&ok=1&msg=attach_exit"|args:$_GET.immo_doc_id}} diff --git a/balance_sheet_exit.html b/balance_sheet_exit.html index da92038..f3c4ae0 100644 --- a/balance_sheet_exit.html +++ b/balance_sheet_exit.html @@ -10,6 +10,12 @@ {{if $message != null}} {{:error message=$message}} {{/if}} +{{* TODO VÉRIFIER SI UTILE *}} +{{* +{{if $info_immo.duration == null || $info_immo.duration == 0}} + {{:error message="Vous devez renseigner la durée d'amortissement au préalable"}} +{{/if}} +*}} {{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}} {{if $label_immo|strpos:$ligne_immo.line_label === false}} diff --git a/detach_amort.html b/detach_amort.html index 873c924..b058716 100644 --- a/detach_amort.html +++ b/detach_amort.html @@ -26,7 +26,7 @@ {{/if}} {{if $_GET.from == "exit"}} - {{:redirect force="exit_step2.html?immo_doc_id=%s&from=exit&ok=1&msg=detach_amort"|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 force="amortization.html?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_GET.immo_doc_id:}} {{/if}} diff --git a/detach_cession.html b/detach_cession.html index 2733fcc..eab7863 100644 --- a/detach_cession.html +++ b/detach_cession.html @@ -18,4 +18,4 @@ {{:delete id=$id}} {{/load}} -{{:redirect to="exit_step3.html?immo_doc_id=%s&from=exit&ok=1&msg=detach_cession"|args:$_GET.immo_doc_id}} +{{:redirect to="exit_step3.html?immo_doc_id=%s&ok=1&msg=detach_cession"|args:$_GET.immo_doc_id}} diff --git a/detach_credit.html b/detach_credit.html index 9b7da0e..9665e85 100644 --- a/detach_credit.html +++ b/detach_credit.html @@ -19,7 +19,7 @@ {{/load}} {{if $_GET.from == "exit"}} - {{:redirect force="exit_step1.html?immo_doc_id=%s&from=%s&ok=1&msg=detach_avoir"|args:$_GET.immo_doc_id:$_GET.from}} + {{:redirect force="exit_step1.html?immo_doc_id=%s&ok=1&msg=detach_avoir"|args:$_GET.immo_doc_id}} {{else}} {{:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=detach_avoir"|args:$_GET.immo_doc_id}} {{/if}} diff --git a/detach_exit.html b/detach_exit.html index 094bd88..1a71701 100644 --- a/detach_exit.html +++ b/detach_exit.html @@ -18,4 +18,4 @@ {{:delete id=$id}} {{/load}} -{{:redirect to="exit_step4.html?immo_doc_id=%s&from=exit&ok=1&msg=detach_exit"|args:$_GET.immo_doc_id}} +{{:redirect to="exit_step4.html?immo_doc_id=%s&ok=1&msg=detach_exit"|args:$_GET.immo_doc_id}} diff --git a/exit_step1.html b/exit_step1.html index 3ffa2cd..5744fb6 100644 --- a/exit_step1.html +++ b/exit_step1.html @@ -129,6 +129,7 @@ {{else}} {{:assign current="archived"}} {{/if}} +{{*:include file="_nav.html" current=$current subcurrent="exit"*}} {{if $_GET.ok}} {{if $_GET.msg|match:"attach_avoir"}} @@ -162,15 +163,6 @@ -{{if $credit_lines}} - -{{/if}} -

Écritures d'avoir attachées à l'immobilisation

{{if $linked_immos != null}} @@ -211,6 +203,42 @@

{{/if}} +{{if $credit_lines}} +

Autres écritures au crédit du compte d'immobilisation

+
+ + + + + + + + + + + + + {{#foreach from=$credit_lines}} + {{:assign credit_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:$year}} + + + + + + + + + + {{/foreach}} + +
DateLibelléMontantN° compteCompte
#{{$trans_id}}{{$date|date_short}}{{$trans_label}} + {{if $line_label != null && $line_label != $trans_label}} — {{$line_label}}{{/if}} + {{$amount|money_html|raw}}{{$account_code}}{{$account_label}} + {{:linkbutton label="Attacher" href="attach_credit.html?immo_doc_id=%s&credit_line_id=%s&from=exit"|args:$_GET.immo_doc_id:$credit_line_id shape="plus" target="_dialog"}} +
+{{/if}} +

{{:button type="submit" name="proceed" label="Poursuivre" shape="right" class="main"}} diff --git a/exit_step2.html b/exit_step2.html index acf7cc0..6c451fc 100644 --- a/exit_step2.html +++ b/exit_step2.html @@ -95,6 +95,7 @@ {{else}} {{:assign current="archived"}} {{/if}} +{{*:include file="_nav.html" current=$current subcurrent="exit"*}} {{if $_GET.ok}} {{if $_GET.msg|match:"attach_amort"}} @@ -128,15 +129,6 @@ -{{if $free_amort_lines}} -

-{{/if}} -

Écritures d'amortissement attachées à l'immobilisation

{{if $linked_amort != null}} @@ -189,6 +181,55 @@

{{/if}} + +{{if $free_amort_lines}} +

Autres écritures d'amortissements

+
+ + + + + + + + + + + + + + {{#foreach from=$free_amort_lines item="line"}} + {{:assign amort_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.amort_trans_id}} + {{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}} + + + + + + + + + + {{/foreach}} + +
DateLibelléMontantN° compteCompte
#{{$line.amort_trans_id}}{{$line.date|date_short}} + {{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}}{{$line.account_label}} + {{:linkbutton label="Attacher" href="attach_amort.html?immo_doc_id=%s&amort_line_id=%s&from=exit"|args:$_GET.immo_doc_id:$line.amort_line_id shape="plus" target="_dialog"}} +
+{{/if}} +

{{:button type="submit" name="backward" label="Revenir à l'étape précédente" shape="left" class="main"}} diff --git a/exit_step3.html b/exit_step3.html index 365d817..f55e5b5 100644 --- a/exit_step3.html +++ b/exit_step3.html @@ -92,6 +92,7 @@ {{:assign var="free_cessions." value=$line}} {{/select}} {{/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"}} {{if $_GET.from == "exit"}} @@ -99,6 +100,7 @@ {{else}} {{:assign current="archived"}} {{/if}} +{{*:include file="_nav.html" current=$current subcurrent="exit"*}} {{if $_GET.ok}} {{if $_GET.msg|match:"attach_cession"}} @@ -136,15 +138,6 @@ -{{if $linked_cessions == null && $free_cessions != null}} -

-{{/if}} -

Écriture de cession attachée à l'immobilisation

{{if $linked_cessions != null}} @@ -197,6 +190,51 @@

{{/if}} + +{{if $free_cessions}} +

Autres écritures de cession

+
+ + + + + + + + + + + + + + {{#foreach from=$free_cessions item="line"}} + {{:assign cession_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}} + + + + + + + + + + {{/foreach}} + +
DateLibelléMontantN° compteCompte
#{{$line.trans_id}}{{$line.date|date_short}} + {{if $line.line_label != null}} + {{$line.line_label}} + {{if $line.trans_label != $line.line_label}} + — {{$line.trans_label}} + {{/if}} + {{else}} + {{$line.trans_label}} + {{/if}} + {{"%f"|math:$line.amount|money_html:false|raw}}{{$line.account_code}}{{$line.account_label}} + {{:linkbutton label="Attacher" href="attach_cession.html?immo_doc_id=%s&cession_line_id=%s&from=exit"|args:$_GET.immo_doc_id:$line.line_id shape="plus"}} +
+{{/if}} +

{{:button type="submit" name="backward" label="Revenir à l'étape précédente" shape="left" class="main"}} diff --git a/exit_step4.html b/exit_step4.html index d880d2e..ed7be7a 100644 --- a/exit_step4.html +++ b/exit_step4.html @@ -12,6 +12,23 @@ {{:error message=$message}} {{/if}} +{{#form on="backward"}} + {{:redirect to="exit_step3.html?immo_doc_id=%s&from=%s"|args:$_GET.immo_doc_id:$_GET.from}} +{{/form}} + +{{#form on="validate"}} + {{* mettre à jour l'état de l'immobilisation *}} + {{:save + key=$info_immo.key + status="archived" + }} + {{:redirect to="index.html?type_immo=archived"}} +{{/form}} + +{{#form on="finish"}} + {{:redirect to="index.html?type_immo=other"}} +{{/form}} + {{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}} {{if $label_immo|strpos:$ligne_immo.line_label === false}} {{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}} @@ -43,7 +60,6 @@ {{else}} {{:assign montant_cession=$amount}} {{/if}} - {{:assign cession_doc_id=$id}} {{/load}} {{* chercher une écriture de sortie de bilan associée *}} @@ -101,13 +117,6 @@ {{:assign erreur=1}} {{:assign message="Le montant des amortissement dans l'écriture de sortie (%s) est différent du total des amortissements associés à l'immobilisation (%s)."|args:$exit_amort_display:$total_amort_display}} {{/if}} - - {{if $exit_line.amount != $solde}} - {{:assign erreur=2}} - {{:assign exit_line_amount=$exit_line.amount|money_currency:false|replace:" ":" "}} - {{:assign solde_immo=$solde|money_currency:false|replace:" ":" "}} - {{:assign message="Le montant de de l'immobilisation dans l'écriture de sortie (%s) est différent du montant à amortir (%s)."|args:$exit_line_amount:$solde_immo}} - {{/if}} {{/if}} {{* @@ -158,6 +167,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, @@ -204,32 +214,13 @@ {{/if}} {{/select}} -{{#form on="backward"}} - {{:redirect to="exit_step3.html?immo_doc_id=%s&from=%s"|args:$_GET.immo_doc_id:$_GET.from}} -{{/form}} - -{{#form on="validate"}} - {{* mettre à jour l'état de l'immobilisation *}} - {{:save - key=$info_immo.key - status="archived" - }} - {{:redirect to="index.html?type_immo=archived"}} -{{/form}} - -{{#form on="cancel"}} - {{* supprimer les docs de cession et de sortie *}} - {{if $cession_doc_id != null}}{{:delete id=$cession_doc_id}}{{/if}} - {{if $exit_info != null}}{{:delete id=$exit_info.id}}{{/if}} - {{:redirect to="index.html?type_immo=other"}} -{{/form}} - {{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}} {{if $_GET.from == "exit"}} {{:assign current="other"}} {{else}} {{:assign current="archived"}} {{/if}} +{{*:include file="_nav.html" current=$current subcurrent="exit"*}} {{if $_GET.ok}} {{if $_GET.msg|match:"attach_exit"}} @@ -268,13 +259,7 @@ {{if $erreur}} -

{{$message}}
- {{if $erreur == 1}} - Vérifiez si vous avez correctement attaché les écritures d'amortissement. - {{elseif $erreur == 2}} - Vérifiez si vous avez correctement attaché les éventuelles écritures d'avoir. - {{/if}} -

+

{{$message}}
Vérifiez si vous avez correctement attaché les écritures d'amortissement.

@@ -301,15 +286,6 @@
Détails de l'écriture de sortie de bilan
{{/if}} -{{if $exit_lines}} - -{{/if}} -

Écriture de sortie de bilan attachée à l'immobilisation

{{if $exit_line != null}} {{:assign exit_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$exit_line.trans_id}} @@ -352,7 +328,6 @@ {{/if}} {{if $exit_lines}} -{{*

Écritures non rattachées

@@ -387,7 +362,6 @@ {{/foreach}}
-*}} {{elseif $exit_line == null}}

Aucune écriture de sortie de bilan avec un montant de {{$solde|money_currency_html:false|raw}} au crédit du @@ -411,7 +385,7 @@ {{if $exit_line && ! $erreur}} {{:button type="submit" name="validate" label="Terminer" shape="check" class="main"}} {{else}} - {{:button type="submit" name="cancel" label="Annuler" shape="delete" class="main"}} + {{:button type="submit" name="finish" label="Annuler" shape="delete" class="main"}} {{/if}}

diff --git a/index.html b/index.html index 0627e9f..e0018df 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@ {{:include file="_nav.html" current=$type_immo}} {{* Mise à niveau *}} -{{:assign module_version="0.40.0"}} +{{:assign module_version="0.33"}} {{:include file="upgrade.html" module_version=$module_version}} {{* supprimer les documents sans écriture associée *}} diff --git a/link_immo.html b/link_immo.html index 2a049dc..73e071b 100644 --- a/link_immo.html +++ b/link_immo.html @@ -12,9 +12,7 @@ {{/if}} {{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$ligne_immo.trans_id}} -{{:assign date_immo=$info_immo.date_mes|or:$info_immo.date_achat|or:$ligne_immo.date_achat}} -{{:assign montant_immo=$info_immo.amount|or:$ligne_immo.amount}} - +{{:assign date_debut=$info_immo.date_mes|or:$info_immo.date_achat|or:$ligne_immo.date_achat}} {{:assign label_immo=$info_immo.label|or:$ligne_immo.trans_label}} {{if $label_immo|strpos:$ligne_immo.line_label ===false }} {{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}} @@ -23,10 +21,6 @@ {{:assign var="ligne_immo.amount" value=$info_immo.amount}} {{/if}} -{{* déduire le montant des écritures liées à l'immo courante au crédit du même compte *}} -{{:include file="_get_credit_lines.html" immo_doc_id=$_GET.immo_doc_id keep="linked_immos, total_credits"}} -{{:assign solde="%d-%d"|math:$montant_immo:$total_credits}} - {{* lister les écritures au crédit du compte de l'immobilisation *}} @@ -65,11 +59,8 @@ :account_code = $account_code !table = $module.table :date_immo = $date_immo - assign="credit_line" + assign="other_immos." }} - {{if $credit_line.credit_amount < $solde}} - {{:assign var="other_immos." value=$credit_line}} - {{/if}} {{/select}} {{:admin_header title="Écritures au crédit du compte d'immobilisation" custom_css="./style.css" current="module_amortization"}} @@ -87,12 +78,12 @@