Amélioration détection erreur classement sortie bilan
This commit is contained in:
parent
18e97956fe
commit
8810498843
2 changed files with 75 additions and 5 deletions
|
|
@ -84,6 +84,39 @@
|
|||
assign="exit_line"
|
||||
}}
|
||||
{{/select}}
|
||||
|
||||
{{* lignes de l'écriture de sortie *}}
|
||||
{{#select
|
||||
line.label as line_label,
|
||||
line.credit,
|
||||
line.debit,
|
||||
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
|
||||
WHERE trans.id = :exit_trans_id;
|
||||
:exit_trans_id = $exit_line.trans_id
|
||||
assign="trans"
|
||||
}}
|
||||
{{:assign var="exit_trans.%s"|args:$account_code value=$trans}}
|
||||
{{/select}}
|
||||
|
||||
{{:assign acc_codes=$exit_trans|keys}}
|
||||
{{#foreach from=$linked_amort}}
|
||||
{{if $account_code|in:$acc_codes}}
|
||||
{{:assign var="exit_amort" from="exit_trans.%s.debit"|args:$account_code}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{if $exit_amort != $total_amort}}
|
||||
{{:assign exit_amort_display=$exit_amort|money_currency:false|replace:" ":" "}}
|
||||
{{:assign total_amort_display=$total_amort|money_currency:false|replace:" ":" "}}
|
||||
{{: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}}
|
||||
|
||||
{{*
|
||||
|
|
@ -225,7 +258,35 @@
|
|||
</dl>
|
||||
</div>
|
||||
|
||||
<h3 class="ruler">Écriture de sortie du bilan attachée à l'immobilisation</h3>
|
||||
{{if $erreur}}
|
||||
<p class="block error">{{$message}}<br />Vérifiez si vous avez correctement attaché les écritures d'amortissement.</p>
|
||||
<table class="list error">
|
||||
<caption>Détails de l'écriture de sortie de bilan</caption>
|
||||
<thead class="error">
|
||||
<tr>
|
||||
<td class="num">Numéro</td>
|
||||
<td>Compte</td>
|
||||
<td class="nombre">Débit</td>
|
||||
<td class="nombre">Crédit</td>
|
||||
<td>Libellé</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#foreach from=$exit_trans key="account_code" item="line"}}
|
||||
{{:assign account_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.id_year}}
|
||||
<tr>
|
||||
<td class="num"><a href="{{$account_url}}">{{$line.account_code}}</a></td>
|
||||
<td>{{$line.account_label}}</td>
|
||||
<td class="money">{{$line.debit|money_currency:false}}</td>
|
||||
<td class="money">{{$line.credit|money_currency:false}}</td>
|
||||
<td>{{$line.line_label}}</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/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}}
|
||||
<table class="list">
|
||||
|
|
@ -262,7 +323,7 @@
|
|||
</table>
|
||||
{{elseif $exit_lines}}
|
||||
<p class="block alert">
|
||||
Vous pouvez attacher une écriture de sortie du bilan à l'immobilisation
|
||||
Vous pouvez attacher une écriture de sortie de bilan à l'immobilisation
|
||||
</p>
|
||||
{{/if}}
|
||||
|
||||
|
|
@ -302,7 +363,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
{{elseif $exit_line == null}}
|
||||
<p class="block alert">Aucune écriture de sortie du bilan avec un
|
||||
<p class="block error">Aucune écriture de sortie de bilan avec un
|
||||
montant de {{$solde|money_currency_html:false|raw}} au crédit du
|
||||
compte {{$ligne_immo.account_code}} — {{$ligne_immo.account_label}} ;
|
||||
<br />
|
||||
|
|
@ -321,10 +382,10 @@
|
|||
<form method="post" action="">
|
||||
<p class="submit">
|
||||
{{:button type="submit" name="backward" label="Revenir à l'étape précédente" shape="left" class="main"}}
|
||||
{{if $exit_line}}
|
||||
{{if $exit_line && ! $erreur}}
|
||||
{{:button type="submit" name="validate" label="Terminer" shape="check" class="main"}}
|
||||
{{else}}
|
||||
{{:button type="submit" name="finish" label="Terminer" shape="export" class="main"}}
|
||||
{{:button type="submit" name="finish" label="Annuler" shape="delete" class="main"}}
|
||||
{{/if}}
|
||||
</p>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -74,6 +74,15 @@ table.list tbody tr.ignored:nth-child(even) {
|
|||
font-style: italic;
|
||||
background: rgba(255, 255, 200, 0.5);
|
||||
}
|
||||
|
||||
table.error {
|
||||
background-color: #fcc;
|
||||
}
|
||||
table.error tr, table.error td, table.error thead td {
|
||||
background-image : none;
|
||||
background-color: #fcc;
|
||||
}
|
||||
|
||||
html.dark table.list tbody tr.ignored:nth-child(odd) {
|
||||
font-style: italic;
|
||||
background: rgba(100, 100, 0, 0.4);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue