Réorganisation sortie bilan (onglets) + contrôle cohérence montant
This commit is contained in:
parent
9e620c3efb
commit
24707afd31
17 changed files with 327 additions and 173 deletions
|
|
@ -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_step1.html?immo_doc_id=%s&from=exit"|args:$info_immo.id shape="edit"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/select}}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@
|
|||
{{/if}}
|
||||
|
||||
{{if $_GET.from == "exit"}}
|
||||
{{:redirect force="exit_step2.html?immo_doc_id=%s&ok=1&msg=attach_amort"|args:$_GET.immo_doc_id}}
|
||||
{{:redirect force="exit_step2.html?immo_doc_id=%s&from=exit&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}}
|
||||
|
|
|
|||
|
|
@ -36,4 +36,4 @@
|
|||
cession_line_id=$_GET.cession_line_id|intval
|
||||
}}
|
||||
|
||||
{{:redirect force="exit_step3.html?immo_doc_id=%s&ok=1&msg=attach_cession"|args:$_GET.immo_doc_id}}
|
||||
{{:redirect force="exit_step3.html?immo_doc_id=%s&from=exit&ok=1&msg=attach_cession"|args:$_GET.immo_doc_id}}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@
|
|||
}}
|
||||
|
||||
{{if $_GET.from == "exit"}}
|
||||
{{:redirect force="exit_step1.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id}}
|
||||
{{:redirect force="exit_step1.html?immo_doc_id=%s&from=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id:$_GET.from}}
|
||||
{{else}}
|
||||
{{:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id}}
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -36,4 +36,4 @@
|
|||
exit_line_id=$_GET.exit_line_id|intval
|
||||
}}
|
||||
|
||||
{{:redirect to="exit_step4.html?immo_doc_id=%s&ok=1&msg=attach_exit"|args:$_GET.immo_doc_id}}
|
||||
{{:redirect to="exit_step4.html?immo_doc_id=%s&from=exit&ok=1&msg=attach_exit"|args:$_GET.immo_doc_id}}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
{{/if}}
|
||||
|
||||
{{if $_GET.from == "exit"}}
|
||||
{{:redirect force="exit_step2.html?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_GET.immo_doc_id}}
|
||||
{{:redirect force="exit_step2.html?immo_doc_id=%s&from=exit&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}}
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@
|
|||
{{:delete id=$id}}
|
||||
{{/load}}
|
||||
|
||||
{{:redirect to="exit_step3.html?immo_doc_id=%s&ok=1&msg=detach_cession"|args:$_GET.immo_doc_id}}
|
||||
{{:redirect to="exit_step3.html?immo_doc_id=%s&from=exit&ok=1&msg=detach_cession"|args:$_GET.immo_doc_id}}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
{{/load}}
|
||||
|
||||
{{if $_GET.from == "exit"}}
|
||||
{{:redirect force="exit_step1.html?immo_doc_id=%s&ok=1&msg=detach_avoir"|args:$_GET.immo_doc_id}}
|
||||
{{:redirect force="exit_step1.html?immo_doc_id=%s&from=%s&ok=1&msg=detach_avoir"|args:$_GET.immo_doc_id:$_GET.from}}
|
||||
{{else}}
|
||||
{{:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=detach_avoir"|args:$_GET.immo_doc_id}}
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@
|
|||
{{:delete id=$id}}
|
||||
{{/load}}
|
||||
|
||||
{{:redirect to="exit_step4.html?immo_doc_id=%s&ok=1&msg=detach_exit"|args:$_GET.immo_doc_id}}
|
||||
{{:redirect to="exit_step4.html?immo_doc_id=%s&from=exit&ok=1&msg=detach_exit"|args:$_GET.immo_doc_id}}
|
||||
|
|
|
|||
|
|
@ -129,7 +129,6 @@
|
|||
{{else}}
|
||||
{{:assign current="archived"}}
|
||||
{{/if}}
|
||||
{{*:include file="_nav.html" current=$current subcurrent="exit"*}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg|match:"attach_avoir"}}
|
||||
|
|
@ -163,6 +162,15 @@
|
|||
</dl>
|
||||
</div>
|
||||
|
||||
{{if $credit_lines}}
|
||||
<nav class="actions">
|
||||
{{:linkbutton
|
||||
label="Attacher une écriture d'avoir"
|
||||
href="link_immo.html?immo_doc_id=%s&filter=true&from=%s"|args:$_GET.immo_doc_id:$_GET.from shape="link"
|
||||
target="_dialog"}}
|
||||
</nav>
|
||||
{{/if}}
|
||||
|
||||
<h3 class="ruler">Écritures d'avoir attachées à l'immobilisation</h3>
|
||||
{{if $linked_immos != null}}
|
||||
<table class="list">
|
||||
|
|
@ -203,42 +211,6 @@
|
|||
</p>
|
||||
{{/if}}
|
||||
|
||||
{{if $credit_lines}}
|
||||
<h3 class="ruler">Autres écritures au crédit du compte d'immobilisation</h3>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="num">N°</td>
|
||||
<td>Date</td>
|
||||
<td>Libellé</td>
|
||||
<td class="nombre">Montant</td>
|
||||
<td>N° compte</td>
|
||||
<td>Compte</td>
|
||||
<td class="actions"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#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}}
|
||||
<tr>
|
||||
<td class="num"><a href="{{$credit_url}}">#{{$trans_id}}</a></td>
|
||||
<td>{{$date|date_short}}</td>
|
||||
<td>{{$trans_label}}
|
||||
{{if $line_label != null && $line_label != $trans_label}} — {{$line_label}}{{/if}}
|
||||
</td>
|
||||
<td class="money">{{$amount|money_html|raw}}</td>
|
||||
<td><a href="{{$compte_url}}">{{$account_code}}</a></td>
|
||||
<td>{{$account_label}}</td>
|
||||
<td class="actions">
|
||||
{{: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"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/if}}
|
||||
|
||||
<form method="post" action="exit_step2.html?immo_doc_id={{$_GET.immo_doc_id}}&from={{$_GET.from}}">
|
||||
<p class="submit">
|
||||
{{:button type="submit" name="proceed" label="Poursuivre" shape="right" class="main"}}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,6 @@
|
|||
{{else}}
|
||||
{{:assign current="archived"}}
|
||||
{{/if}}
|
||||
{{*:include file="_nav.html" current=$current subcurrent="exit"*}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg|match:"attach_amort"}}
|
||||
|
|
@ -129,6 +128,15 @@
|
|||
</dl>
|
||||
</div>
|
||||
|
||||
{{if $free_amort_lines}}
|
||||
<nav class="actions">
|
||||
{{:linkbutton
|
||||
label="Attacher une écriture d'amortissement"
|
||||
href="other_amortizations.html?immo_doc_id=%s&filter=true&from=%s"|args:$_GET.immo_doc_id:$_GET.from shape="link"
|
||||
target="_dialog"}}
|
||||
</nav>
|
||||
{{/if}}
|
||||
|
||||
<h3 class="ruler">Écritures d'amortissement attachées à l'immobilisation</h3>
|
||||
{{if $linked_amort != null}}
|
||||
<table class="list">
|
||||
|
|
@ -181,55 +189,6 @@
|
|||
</p>
|
||||
{{/if}}
|
||||
|
||||
|
||||
{{if $free_amort_lines}}
|
||||
<h3 class="ruler">Autres écritures d'amortissements</h3>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="num">N°</td>
|
||||
<td>Date</td>
|
||||
<td>Libellé</td>
|
||||
<td class="nombre">Montant</td>
|
||||
<td>N° compte</td>
|
||||
<td>Compte</td>
|
||||
<td class="actions"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{{#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}}
|
||||
<tr>
|
||||
<td class="num"><a href="{{$amort_url}}">#{{$line.amort_trans_id}}</a></td>
|
||||
<td>{{$line.date|date_short}}</td>
|
||||
<td>
|
||||
{{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}}
|
||||
*}}
|
||||
</td>
|
||||
<td class="money">{{"%f"|math:$line.amort_amount|money_html:false|raw}}</td>
|
||||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||
<td>{{$line.account_label}}</td>
|
||||
<td class="actions">
|
||||
{{: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"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/if}}
|
||||
|
||||
<form method="post" action="">
|
||||
<p class="submit">
|
||||
{{:button type="submit" name="backward" label="Revenir à l'étape précédente" shape="left" class="main"}}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@
|
|||
{{: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"}}
|
||||
|
|
@ -100,7 +99,6 @@
|
|||
{{else}}
|
||||
{{:assign current="archived"}}
|
||||
{{/if}}
|
||||
{{*:include file="_nav.html" current=$current subcurrent="exit"*}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg|match:"attach_cession"}}
|
||||
|
|
@ -138,6 +136,15 @@
|
|||
</dl>
|
||||
</div>
|
||||
|
||||
{{if $linked_cessions == null && $free_cessions != null}}
|
||||
<nav class="actions">
|
||||
{{:linkbutton
|
||||
label="Attacher une écriture de cession"
|
||||
href="list_cessions.html?immo_doc_id=%s&filter=true&from=%s"|args:$_GET.immo_doc_id:$_GET.from shape="link"
|
||||
target="_dialog"}}
|
||||
</nav>
|
||||
{{/if}}
|
||||
|
||||
<h3 class="ruler">Écriture de cession attachée à l'immobilisation</h3>
|
||||
{{if $linked_cessions != null}}
|
||||
<table class="list">
|
||||
|
|
@ -190,51 +197,6 @@
|
|||
</p>
|
||||
{{/if}}
|
||||
|
||||
|
||||
{{if $free_cessions}}
|
||||
<h3 class="ruler">Autres écritures de cession</h3>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="num">N°</td>
|
||||
<td>Date</td>
|
||||
<td>Libellé</td>
|
||||
<td class="nombre">Montant</td>
|
||||
<td>N° compte</td>
|
||||
<td>Compte</td>
|
||||
<td class="actions"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{{#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}}
|
||||
<tr>
|
||||
<td class="num"><a href="{{$cession_url}}">#{{$line.trans_id}}</a></td>
|
||||
<td>{{$line.date|date_short}}</td>
|
||||
<td>
|
||||
{{if $line.line_label != null}}
|
||||
{{$line.line_label}}
|
||||
{{if $line.trans_label != $line.line_label}}
|
||||
— {{$line.trans_label}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{$line.trans_label}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="money">{{"%f"|math:$line.amount|money_html:false|raw}}</td>
|
||||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||
<td>{{$line.account_label}}</td>
|
||||
<td class="actions">
|
||||
{{: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"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/if}}
|
||||
|
||||
<form method="post" action="">
|
||||
<p class="submit">
|
||||
{{:button type="submit" name="backward" label="Revenir à l'étape précédente" shape="left" class="main"}}
|
||||
|
|
|
|||
|
|
@ -12,23 +12,6 @@
|
|||
{{: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}}
|
||||
|
|
@ -60,6 +43,7 @@
|
|||
{{else}}
|
||||
{{:assign montant_cession=$amount}}
|
||||
{{/if}}
|
||||
{{:assign cession_doc_id=$id}}
|
||||
{{/load}}
|
||||
|
||||
{{* chercher une écriture de sortie de bilan associée *}}
|
||||
|
|
@ -117,6 +101,13 @@
|
|||
{{: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}}
|
||||
|
||||
{{*
|
||||
|
|
@ -214,13 +205,32 @@
|
|||
{{/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"}}
|
||||
|
|
@ -259,7 +269,13 @@
|
|||
</div>
|
||||
|
||||
{{if $erreur}}
|
||||
<p class="block error">{{$message}}<br />Vérifiez si vous avez correctement attaché les écritures d'amortissement.</p>
|
||||
<p class="block error">{{$message}}<br />
|
||||
{{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}}
|
||||
</p>
|
||||
<table class="list error">
|
||||
<caption>Détails de l'écriture de sortie de bilan</caption>
|
||||
<thead class="error">
|
||||
|
|
@ -286,6 +302,15 @@
|
|||
</table>
|
||||
{{/if}}
|
||||
|
||||
{{if $exit_lines}}
|
||||
<nav class="actions">
|
||||
{{:linkbutton
|
||||
label="Attacher une écriture sortie de bilan"
|
||||
href="list_exit.html?immo_doc_id=%s&filter=true&from=%s"|args:$_GET.immo_doc_id:$_GET.from shape="link"
|
||||
target="_dialog"}}
|
||||
</nav>
|
||||
{{/if}}
|
||||
|
||||
<h3 class="ruler">Écriture de sortie de bilan attachée à l'immobilisation</h3>
|
||||
{{if $exit_line != null}}
|
||||
{{:assign exit_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$exit_line.trans_id}}
|
||||
|
|
@ -328,6 +353,7 @@
|
|||
{{/if}}
|
||||
|
||||
{{if $exit_lines}}
|
||||
{{*
|
||||
<h3 class="ruler">Écritures non rattachées</h3>
|
||||
<table class="list">
|
||||
<thead>
|
||||
|
|
@ -362,6 +388,7 @@
|
|||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
*}}
|
||||
{{elseif $exit_line == null}}
|
||||
<p class="block error">Aucune écriture de sortie de bilan avec un
|
||||
montant de {{$solde|money_currency_html:false|raw}} au crédit du
|
||||
|
|
@ -385,7 +412,7 @@
|
|||
{{if $exit_line && ! $erreur}}
|
||||
{{:button type="submit" name="validate" label="Terminer" shape="check" class="main"}}
|
||||
{{else}}
|
||||
{{:button type="submit" name="finish" label="Annuler" shape="delete" class="main"}}
|
||||
{{:button type="submit" name="cancel" label="Annuler" shape="delete" class="main"}}
|
||||
{{/if}}
|
||||
</p>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@
|
|||
{{/if}}
|
||||
|
||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$ligne_immo.trans_id}}
|
||||
{{:assign date_debut=$info_immo.date_mes|or:$info_immo.date_achat|or:$ligne_immo.date_achat}}
|
||||
{{: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 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}}
|
||||
|
|
@ -21,6 +23,10 @@
|
|||
{{: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
|
||||
*}}
|
||||
|
|
@ -59,8 +65,11 @@
|
|||
:account_code = $account_code
|
||||
!table = $module.table
|
||||
:date_immo = $date_immo
|
||||
assign="other_immos."
|
||||
assign="credit_line"
|
||||
}}
|
||||
{{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"}}
|
||||
|
|
@ -78,12 +87,12 @@
|
|||
<nav class="tabs">
|
||||
<ul>
|
||||
<li {{if $_GET.filter}}class="current"{{/if}}>
|
||||
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&filter=true">
|
||||
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&filter=true&from={{$_GET.from}}">
|
||||
Compte {{$ligne_immo.account_code}} et sous-comptes
|
||||
</a>
|
||||
</li>
|
||||
<li {{if ! $_GET.filter}}class="current"{{/if}}>
|
||||
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}">
|
||||
<a href="link_immo.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&from={{$_GET.from}}">
|
||||
Compte {{$ligne_immo.account_code|substr:0:2}} et sous-comptes
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -98,7 +107,7 @@
|
|||
<dt>Montant</dt>
|
||||
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
||||
<dt>Date de l'immobilisation</dt>
|
||||
<dd>{{$date_debut|date_short}}</dd>
|
||||
<dd>{{$date_immo|date_short}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
|
@ -129,7 +138,7 @@
|
|||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||
<td>{{$line.account_label}}</td>
|
||||
<td class="actions">
|
||||
{{:linkbutton label="Attacher" href="attach_credit.html?credit_line_id=%d&immo_doc_id=%s"|args:$line.credit_line_id:$_GET.immo_doc_id shape="plus"}}
|
||||
{{:linkbutton label="Attacher" href="attach_credit.html?credit_line_id=%d&immo_doc_id=%s&from=%s"|args:$line.credit_line_id:$_GET.immo_doc_id:$_GET.from shape="plus"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
|
|
|
|||
118
list_cessions.html
Normal file
118
list_cessions.html
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{*
|
||||
Lister les écritures de cession du compte de l'immobilisation
|
||||
paramètre et proposer de les attacher à l'immo paramètre
|
||||
@param immo_doc_id : document associé à l'immo
|
||||
*}}
|
||||
{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id|intval keep="info_immo, ligne_immo, message"}}
|
||||
{{if $message != null}}
|
||||
{{:error message=$message}}
|
||||
{{/if}}
|
||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$ligne_immo.trans_id}}
|
||||
{{: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}}
|
||||
{{/if}}
|
||||
{{if $info_immo.amount != null}}
|
||||
{{:assign var="ligne_immo.amount" value=$info_immo.amount}}
|
||||
{{/if}}
|
||||
|
||||
{{:assign total_cession=0}}
|
||||
{{#select
|
||||
line.id as line_id,
|
||||
line.credit as amount,
|
||||
line.label as line_label,
|
||||
trans.id as trans_id,
|
||||
trans.date as date,
|
||||
trans.label as trans_label,
|
||||
trans.id_year as year,
|
||||
account.id as account_id,
|
||||
account.code as account_code,
|
||||
account.label as account_label
|
||||
FROM acc_transactions_lines AS line
|
||||
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
||||
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
||||
WHERE account.code LIKE :code_cession_new OR account.code LIKE :code_cession_old
|
||||
;
|
||||
:code_cession_new = "757%"
|
||||
:code_cession_old = "775%"
|
||||
assign="line"
|
||||
}}
|
||||
{{#select
|
||||
CASE WHEN links.id_related = :trans_id
|
||||
THEN links.id_transaction
|
||||
ELSE links.id_related
|
||||
END as linked_id
|
||||
FROM acc_transactions_links as links
|
||||
WHERE links.id_transaction = :trans_id OR links.id_related = :trans_id
|
||||
;
|
||||
:trans_id = $line.trans_id
|
||||
}}
|
||||
{{if $linked_id == $ligne_immo.trans_id}}
|
||||
{{:assign total_cession="%d+%d"|math:$total_cession:$line.amount}}
|
||||
{{:assign var="line.linked_id" value=$linked_id}}
|
||||
{{:assign var="linked_cessions." value=$line}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{:assign var="free_cessions." value=$line}}
|
||||
{{/select}}
|
||||
{{/select}}
|
||||
|
||||
{{:admin_header title="Écritures de cession du compte d'immobilisation" custom_css="./style.css" current="module_amortization"}}
|
||||
|
||||
<div class="informations">
|
||||
<dl class="describe">
|
||||
<dt>Immobilisation</dt>
|
||||
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||
<dt>Montant</dt>
|
||||
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
||||
<dt>Date de l'immobilisation</dt>
|
||||
<dd>{{$date_debut|date_short}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{{if $free_cessions}}
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="num">N°</td>
|
||||
<td>Date</td>
|
||||
<td>Libellé</td>
|
||||
<td class="nombre">Montant</td>
|
||||
<td>N° compte</td>
|
||||
<td>Compte</td>
|
||||
<td class="actions"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{{#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}}
|
||||
<tr>
|
||||
<td class="num"><a href="{{$cession_url}}">#{{$line.trans_id}}</a></td>
|
||||
<td>{{$line.date|date_short}}</td>
|
||||
<td>
|
||||
{{if $line.line_label != null}}
|
||||
{{$line.line_label}}
|
||||
{{if $line.trans_label != $line.line_label}}
|
||||
— {{$line.trans_label}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{$line.trans_label}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="money">{{"%f"|math:$line.amount|money_html:false|raw}}</td>
|
||||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||
<td>{{$line.account_label}}</td>
|
||||
<td class="actions">
|
||||
{{: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"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
<p class="help">Sélectionner une écriture de cession pour l'associer à l'immobilisation</p>
|
||||
</table>
|
||||
{{/if}}
|
||||
108
list_exit.html
Normal file
108
list_exit.html
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{*
|
||||
Lister les écritures de sortie de bilan du compte de l'immobilisation
|
||||
paramètre et proposer de les attacher à l'immo paramètre
|
||||
@param immo_doc_id : document associé à l'immo
|
||||
*}}
|
||||
{{:include file="_get_immo_data.html" immo_doc_id=$_GET.immo_doc_id|intval keep="info_immo, ligne_immo, message"}}
|
||||
{{if $message != null}}
|
||||
{{:error message=$message}}
|
||||
{{/if}}
|
||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$ligne_immo.trans_id}}
|
||||
{{: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}}
|
||||
{{/if}}
|
||||
{{if $info_immo.amount != null}}
|
||||
{{: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:$ligne_immo.amount:$total_credits}}
|
||||
|
||||
{{#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(credit_link.document, '$.credit_line_id') AS line_id FROM !table as credit_link
|
||||
WHERE json_extract(credit_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"
|
||||
)
|
||||
;
|
||||
:acc_code=$ligne_immo.account_code
|
||||
!table =$module.table
|
||||
assign="credit_line"
|
||||
}}
|
||||
{{if $credit_line.amount == $solde}}
|
||||
{{:assign var="exit_lines." value=$credit_line}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
|
||||
{{:admin_header title="Écritures de cession du compte d'immobilisation" custom_css="./style.css" current="module_amortization"}}
|
||||
|
||||
<div class="informations">
|
||||
<dl class="describe">
|
||||
<dt>Immobilisation</dt>
|
||||
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||
<dt>Montant</dt>
|
||||
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
||||
<dt>Date de l'immobilisation</dt>
|
||||
<dd>{{$date_debut|date_short}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{{if $exit_lines}}
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="num">N°</td>
|
||||
<td>Date</td>
|
||||
<td>Libellé</td>
|
||||
<td class="nombre">Montant</td>
|
||||
<td>N° compte</td>
|
||||
<td>Compte</td>
|
||||
<td class="actions"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#foreach from=$exit_lines item="line"}}
|
||||
{{:assign exit_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}}
|
||||
<tr>
|
||||
<td class="num"><a href="{{$exit_url}}">#{{$line.trans_id}}</a></td>
|
||||
<td>{{$line.date|date_short}}</td>
|
||||
<td>{{$line.trans_label}}
|
||||
{{if $line.line_label != null && $line.line_label != $line.trans_label}} — {{$line.line_label}}{{/if}}
|
||||
</td>
|
||||
<td class="money">{{"%f"|math:$line.amount|money_html:false|raw}}</td>
|
||||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||
<td>{{$line.account_label}}</td>
|
||||
<td class="actions">
|
||||
{{:linkbutton label="Attacher" href="attach_exit.html?immo_doc_id=%s&exit_line_id=%s&from=exit"|args:$_GET.immo_doc_id:$line.credit_line_id shape="plus"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
<p class="help">Sélectionner une écriture de sortie de bilan pour l'associer à l'immobilisation</p>
|
||||
</table>
|
||||
{{/if}}
|
||||
|
|
@ -59,12 +59,12 @@
|
|||
<nav class="tabs">
|
||||
<ul>
|
||||
<li {{if $_GET.filter}}class="current"{{/if}}>
|
||||
<a href="other_amortizations.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&filter=true">
|
||||
<a href="other_amortizations.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&filter=true&from={{$_GET.from}}">
|
||||
Amortissements du compte {{$code_amort}}
|
||||
</a>
|
||||
</li>
|
||||
<li {{if ! $_GET.filter}}class="current"{{/if}}>
|
||||
<a href="other_amortizations.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}">
|
||||
<a href="other_amortizations.html?immo_doc_id={{$_GET.immo_doc_id}}{{if $dialog}}&_dialog{{/if}}&from={{$_GET.from}}">
|
||||
Tous les amortissements
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -118,7 +118,7 @@
|
|||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||
<td>{{$line.account_label}}</td>
|
||||
<td class="actions">
|
||||
{{:linkbutton label="Attacher" href="attach_amort.html?immo_doc_id=%s&amort_line_id=%s"|args:$_GET.immo_doc_id:$line.line_id shape="plus"}}
|
||||
{{:linkbutton label="Attacher" href="attach_amort.html?immo_doc_id=%s&amort_line_id=%s&from=%s"|args:$_GET.immo_doc_id:$line.line_id:$_GET.from shape="plus"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
|
|
@ -130,7 +130,6 @@
|
|||
{{/if}}
|
||||
</section>
|
||||
|
||||
|
||||
{{:form_errors}}
|
||||
{{:admin_footer}}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue