Amélioration présentation
This commit is contained in:
parent
c852fecb69
commit
023a2b81bd
10 changed files with 58 additions and 27 deletions
|
|
@ -3,8 +3,8 @@
|
||||||
{{*
|
{{*
|
||||||
chercher des écritures liées à l'immo paramètre au crédit du même compte
|
chercher des écritures liées à l'immo paramètre au crédit du même compte
|
||||||
@param immo_doc_id : id du doc associé à l'immobilisation
|
@param immo_doc_id : id du doc associé à l'immobilisation
|
||||||
@param linked_immos : liste des écritures liées
|
@result linked_immos : liste des écritures liées
|
||||||
@param total_credits : montant total des écritures
|
@result total_credits : montant total des écritures
|
||||||
*}}
|
*}}
|
||||||
{{:assign linked_immos=null}}
|
{{:assign linked_immos=null}}
|
||||||
{{:assign total_credits=0}}
|
{{:assign total_credits=0}}
|
||||||
|
|
@ -14,14 +14,19 @@
|
||||||
line.id as line_id,
|
line.id as line_id,
|
||||||
trans.id as trans_id,
|
trans.id as trans_id,
|
||||||
trans.label,
|
trans.label,
|
||||||
trans.date
|
trans.date,
|
||||||
|
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
|
FROM acc_transactions_lines AS line
|
||||||
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
||||||
|
INNER join acc_accounts AS account on line.id_account = account.id
|
||||||
WHERE line.id = :credit_line_id;
|
WHERE line.id = :credit_line_id;
|
||||||
:credit_line_id=$credit_line_id
|
:credit_line_id=$credit_line_id
|
||||||
}}
|
}}
|
||||||
{{:assign credit=$credit}}
|
{{:assign credit=$credit}}
|
||||||
{{:assign var="linked_immos." doc=$id trans_id=$trans_id credit_line_id=$line_id label=$label amount=$credit date=$date}}
|
{{:assign var="linked_immos." doc=$id trans_id=$trans_id credit_line_id=$line_id label=$label amount=$credit date=$date account_id=$account_id account_code=$account_code account_label=$account_label year=$year}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{if $amount == null}}
|
{{if $amount == null}}
|
||||||
{{:assign total_credits="%d+%d"|math:$total_credits:$credit}}
|
{{:assign total_credits="%d+%d"|math:$total_credits:$credit}}
|
||||||
|
|
|
||||||
|
|
@ -172,8 +172,8 @@
|
||||||
label="Paramètres"
|
label="Paramètres"
|
||||||
href="add_infos.html?immo_line_id=%s"|args:$immo_line_id
|
href="add_infos.html?immo_line_id=%s"|args:$immo_line_id
|
||||||
shape="settings"
|
shape="settings"
|
||||||
|
target="_dialog"
|
||||||
}}
|
}}
|
||||||
{{* target="_dialog"*}}
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,22 @@
|
||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
|
Classer une immobilisation non prise en charge
|
||||||
@param immo_line_id
|
@param immo_line_id
|
||||||
|
|
||||||
TODO ? :
|
|
||||||
- séparer les cas des immo simples et complexes (BOI)
|
|
||||||
par exemple pour la durée d'amort par défaut {{:input ...}}
|
|
||||||
- prise en charge immo => param = immo_line_id
|
|
||||||
- modif param immo => param = immo_doc_id
|
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* cas de la prise en charge *}}
|
|
||||||
{{* données de l'immobilisation *}}
|
{{* données de l'immobilisation *}}
|
||||||
{{:assign montant_affecte=0}}
|
{{:assign montant_affecte=0}}
|
||||||
{{#load type="immo" where="$$.line = :line_id" :line_id=$_GET.immo_line_id|intval assign="info_immo"}}
|
{{#load type="immo" where="$$.line = :line_id" :line_id=$_GET.immo_line_id|intval assign="info_immo"}}
|
||||||
{{:assign montant_affecte="%d+%d"|math:$montant_affecte:$amount}}
|
{{:assign montant_affecte="%d+%d"|math:$montant_affecte:$amount}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
{{if $info_immo != null}}
|
||||||
|
{{:assign date_defaut=$info_immo.date}}
|
||||||
|
{{:assign duree_defaut=$info_immo.duration}}
|
||||||
|
{{:assign choix_defaut=$info_immo.status}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign duree_defaut=null}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
trans.id as immo_trans_id,
|
trans.id as immo_trans_id,
|
||||||
|
|
@ -139,7 +140,7 @@
|
||||||
status=$status
|
status=$status
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{if $_POST.amortir}}
|
{{if $_POST.classify == "managed"}}
|
||||||
{{:assign type_immo="managed"}}
|
{{:assign type_immo="managed"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign type_immo="other"}}
|
{{:assign type_immo="other"}}
|
||||||
|
|
@ -219,6 +220,7 @@ function toggleInputs(event) {
|
||||||
const managed = classement_immo.querySelector('input[type=radio][value=managed]');
|
const managed = classement_immo.querySelector('input[type=radio][value=managed]');
|
||||||
if (managed.checked) {
|
if (managed.checked) {
|
||||||
g.toggle('.masquable', true);
|
g.toggle('.masquable', true);
|
||||||
|
document.getElementById('f_duree').focus();
|
||||||
} else {
|
} else {
|
||||||
g.toggle('.masquable', false);
|
g.toggle('.masquable', false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,9 +144,9 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $_GET.from == "exit"}}
|
{{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}}
|
{{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}}
|
{{/if}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,9 +125,9 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $_GET.from == "exit"}}
|
{{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}}
|
{{else}}
|
||||||
{{:redirect to="amortization.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id}}
|
{{:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=attach_avoir"|args:$_GET.immo_doc_id}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{*:redirect to="details_immo.html?immo_doc_id=%s&ok=1&msg=attach_credit"|args:$_GET.immo_doc_id*}}
|
{{*:redirect to="details_immo.html?immo_doc_id=%s&ok=1&msg=attach_credit"|args:$_GET.immo_doc_id*}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{if $_GET.from == "exit"}}
|
{{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}}
|
{{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}}
|
{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{if $_GET.from == "exit"}}
|
{{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}}
|
{{else}}
|
||||||
{{:redirect to="amortization.html?immo_doc_id=%s&ok=1&msg=detach_avoir&"|args:$_GET.immo_doc_id}}
|
{{:redirect force="amortization.html?immo_doc_id=%s&ok=1&msg=detach_avoir"|args:$_GET.immo_doc_id}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{*:redirect to="details_immo.html?immo_doc_id=%s&ok=1&msg=detach&"|args:$_GET.immo_doc_id*}}
|
{{*:redirect to="details_immo.html?immo_doc_id=%s&ok=1&msg=detach&"|args:$_GET.immo_doc_id*}}
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,15 @@
|
||||||
|
|
||||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||||
|
|
||||||
|
{{if $_GET.ok}}
|
||||||
|
{{if $_GET.msg|match:"attach_avoir"}}
|
||||||
|
{{:assign msg="Écriture d'avoir attachée"}}
|
||||||
|
{{elseif $_GET.msg|match:"detach_avoir"}}
|
||||||
|
{{:assign msg="Écriture d'avoir détachée"}}
|
||||||
|
{{/if}}
|
||||||
|
<p class="block confirm">{{$msg}}</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
|
|
@ -147,25 +156,27 @@
|
||||||
|
|
||||||
{{if $linked_immos != null}}
|
{{if $linked_immos != null}}
|
||||||
<h3 class="ruler">Écritures d'avoir attachées à l'immobilisation</h3>
|
<h3 class="ruler">Écritures d'avoir attachées à l'immobilisation</h3>
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{if $linked_immos != null}}
|
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<td class="num">N°</td>
|
<td class="num">N°</td>
|
||||||
<td>Date</td>
|
<td>Date</td>
|
||||||
<td>Libellé</td>
|
<td>Libellé</td>
|
||||||
<td class="nombre">Montant</td>
|
<td class="nombre">Montant</td>
|
||||||
|
<td>N° compte</td>
|
||||||
|
<td>Compte</td>
|
||||||
<td class="actions"></td>
|
<td class="actions"></td>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#foreach from=$linked_immos item="line"}}
|
{{#foreach from=$linked_immos item="line"}}
|
||||||
{{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
{{: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}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$url}}">#{{$line.trans_id}}</a></td>
|
<td class="num"><a href="{{$url}}">#{{$line.trans_id}}</a></td>
|
||||||
<td>{{$line.date|date_short}}</td>
|
<td>{{$line.date|date_short}}</td>
|
||||||
<td>{{$line.label}}</td>
|
<td>{{$line.label}}</td>
|
||||||
<td class="money">{{"%f"|math:$line.amount|money_currency_html:false|raw}}</td>
|
<td class="money">{{"%f"|math:$line.amount|money_currency_html:false|raw}}</td>
|
||||||
|
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||||
|
<td>{{$line.account_label}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{: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"}}
|
{{: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"}}
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -173,10 +184,14 @@
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{else}}
|
{{elseif $credit_lines}}
|
||||||
<p class="block alert">
|
<p class="block alert">
|
||||||
Vous pouvez attacher une ou plusieurs écritures d'avoir à votre immobilisation
|
Vous pouvez attacher une ou plusieurs écritures d'avoir à votre immobilisation
|
||||||
</p>
|
</p>
|
||||||
|
{{else}}
|
||||||
|
<p class="block alert">
|
||||||
|
Aucune écriture au crédit du compte d'immobilisation ; vous pouvez passer à la suite
|
||||||
|
</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if $credit_lines}}
|
{{if $credit_lines}}
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,15 @@
|
||||||
|
|
||||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
{{: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}}
|
||||||
|
<p class="block confirm">{{$msg}}</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
|
|
@ -196,7 +205,7 @@
|
||||||
</table>
|
</table>
|
||||||
{{else}}
|
{{else}}
|
||||||
<p class="block alert">
|
<p class="block alert">
|
||||||
Vous pouvez attacher une ou plusieurs écritures d'amortissement à votre immobilisation
|
Vous pouvez attacher une ou plusieurs écritures d'amortissement à l'immobilisation
|
||||||
</p>
|
</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,7 @@
|
||||||
</table>
|
</table>
|
||||||
{{else}}
|
{{else}}
|
||||||
<p class="block alert">
|
<p class="block alert">
|
||||||
Vous pouvez attacher une écriture de sortie du bilan à votre immobilisation
|
Vous pouvez attacher une écriture de sortie du bilan à l'immobilisation
|
||||||
</p>
|
</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue